| | |
| | | <el-table-column |
| | | label="工序单价" |
| | | show-tooltip-when-overflow |
| | | prop="stepprice" |
| | | prop="unprice" |
| | | /> |
| | | <el-table-column |
| | | label="已生产数量" |
| | |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="stepcode" |
| | | > |
| | | <el-table-column type="expand"> |
| | | <template slot-scope="props"> |
| | |
| | | :data="props.row.children" |
| | | style="width: 96%;margin: auto;" |
| | | border |
| | | row-key="eqp_code" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column |
| | |
| | | label="设备/往来名称" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="eqp_value" |
| | | label="设备节拍" |
| | | min-width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div style="display: flex;align-items: center"> |
| | | <el-input |
| | | v-model="row.eqp_value" |
| | | placeholder="请输入" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | @change="val=>eqpValueChange(val,row)" |
| | | /> |
| | | <div style="margin-left: 5px">秒</div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="stand_value" |
| | | label="生产节拍" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.stand_value + ' ' + '秒/次' }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cavity_qty" |
| | | label="腔型数" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.cavity_qty" |
| | | placeholder="请输入" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | @change="val=>cavityQtyChange(val,row)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="eqp_value"--> |
| | | <!-- label="设备节拍"--> |
| | | <!-- min-width="150"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div style="display: flex;align-items: center">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.eqp_value"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"--> |
| | | <!-- @change="val=>eqpValueChange(val,row)"--> |
| | | <!-- />--> |
| | | <!-- <div style="margin-left: 5px">秒</div>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="stand_value"--> |
| | | <!-- label="生产节拍"--> |
| | | <!-- min-width="120"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div>{{ row.stand_value + ' ' + '秒/次' }}</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="cavity_qty"--> |
| | | <!-- label="腔型数"--> |
| | | <!-- min-width="120"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.cavity_qty"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"--> |
| | | <!-- @change="val=>cavityQtyChange(val,row)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="unprice" |
| | | label="工序工价" |
| | | label="设备工价" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.unprice" oninput="value=value.replace(/[^0-9.]/g,'')" /> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- v-if="!sourceType"--> |
| | | <el-table-column |
| | | |
| | | prop="enable" |
| | | label="是否启用" |
| | | min-width="150" |
| | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="stepprice" |
| | | prop="unprice" |
| | | label="生产单价" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.stepprice" |
| | | v-model="row.unprice" |
| | | placeholder="请输入工序单价" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 100%" |
| | |
| | | type="primary" |
| | | style="margin-left: 37px" |
| | | @click="view" |
| | | >预 览/下 载</el-button> |
| | | >预 览/下 载 |
| | | </el-button> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | |
| | | UpdateMesOrderStepSearch |
| | | } from '@/api/WorkOrder' |
| | | import { PartSelect } from '@/api/ProductModel' |
| | | import { PrentOrganization, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData' |
| | | import { PrentOrganization, PrentOrganizationNoCompany, StepData, StepEqpData } from '@/api/GeneralBasicData' |
| | | import Sortable from 'sortablejs' |
| | | import ElDragSelect from '@/components/DragSelect' |
| | | import { MesOrderPrintSearch } from '@/api/GridReport' // base on element-ui |
| | | import DateType from '@/components/DateType' |
| | | import { PartSelectRpute, RouteSelectStep } from '@/api/basicSettings' |
| | | import { DeviceSopSearch } from '@/api/DeviceManager' |
| | | |
| | | export default { |
| | | name: 'WorkOrderList', |
| | | components: { |
| | |
| | | }, |
| | | sopArr: [], |
| | | routeCode: '', // 工艺路线code |
| | | partCode: '' |
| | | partCode: '', |
| | | |
| | | StepEqpArr: [], |
| | | |
| | | editStepEqpArr: [], |
| | | |
| | | flag1: false |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | console.log(val, 1) |
| | | const arr = JSON.parse(JSON.stringify(this.stepTableData)) |
| | | const arrStepcode = arr.map(i => i.stepcode) |
| | | |
| | | console.log(arr, 3) |
| | | this.stepTableData = [] |
| | | val.forEach(i => { |
| | | let children = [] |
| | | |
| | | if (arrStepcode.includes(i)) { // 子项保持不变 |
| | | children = arr.find(j => j.stepcode === i).children |
| | | } else { |
| | | // 1.先查找自己原有子项是否有 |
| | | console.log(this.editStepEqpArr.find(j => j.step_code === i), 'this.editStepEqpArr.find(j => j.step_code === i)') |
| | | if (this.editStepEqpArr.find(j => j.step_code === i)) { |
| | | children = this.editStepEqpArr.find(j => j.step_code === i).children |
| | | |
| | | console.log(children, 10) |
| | | } else { |
| | | // 再查找 历史最新或者基础资料是否有 |
| | | if (this.sourceType) { |
| | | children = this.StepEqpArr.find(j => j.step_code === i).children |
| | | console.log(children, 11) |
| | | } |
| | | if (!this.sourceType) { |
| | | children = this.StepEqpArr.find(j => j.step_code === i).children |
| | | console.log(children, 12) |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i, |
| | | stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname, |
| | | stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0 |
| | | unprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).unprice : 0, |
| | | // children:arrStepcode.includes(i)? arr.find(j => j.stepcode === i).children: |
| | | |
| | | children |
| | | |
| | | } |
| | | ) |
| | | }) |
| | |
| | | // }) |
| | | }, |
| | | methods: { |
| | | // 工序设备基础资料 |
| | | async getStepEqpData() { |
| | | const { data: res } = await StepEqpData() |
| | | this.StepEqpArr = res |
| | | }, |
| | | |
| | | // 弹出框关闭 |
| | | handleSopClose() { |
| | | this.SopDialogVisible = false |
| | |
| | | }, |
| | | // 工序来源切换 |
| | | sourceTypeChange(val) { |
| | | this.flag1 = false |
| | | this.stepTableData = [] |
| | | if (val) { |
| | | this.getMesOrderNewStepContent() |
| | |
| | | if (res.code === '200') { |
| | | this.getSelect() |
| | | this.getPrentOrganizationNoCompany() |
| | | this.getStepEqpData() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | const { data: res } = await UpdateMesOrderStepSearch(data) |
| | | this.dialogForm.mesmaxqty = res.canupdate_qty |
| | | this.editStepEqpArr = JSON.parse(JSON.stringify(res.stepdata)) |
| | | |
| | | this.flag1 = res.stepdata.length !== 0 |
| | | // console.log(this.editStepEqpArr.find(i => i.step_code === '102')) |
| | | if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | if (this.dialogForm.routecode) { |
| | | await this.getPartcodeChangeDialog() |
| | | // this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (res.stepdata.length > 0) { |
| | |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.step_name, |
| | | stepprice: i.unprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | |
| | | }, |
| | | // 工艺路线值改变 |
| | | async routecodeChange() { |
| | | if (!this.flag1) { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | | routecode: this.dialogForm.routecode |
| | | } |
| | | const { data: res } = await RouteSelectStep(data) |
| | | |
| | | console.log(res, 887) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | |
| | | { |
| | | stepcode: i.code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.unprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | |
| | | if (this.flag1 && !this.sourceType) { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | | routecode: this.dialogForm.routecode |
| | | } |
| | | const { data: res } = await RouteSelectStep(data) |
| | | console.log(res, 887) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.sort((a, b) => a.step_seq - b.step_seq) |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.code, |
| | | // stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | // return |
| | | // } |
| | | |
| | | if (this.sourceType) { |
| | | const data = { |
| | | routecode: this.dialogForm.routecode, |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } else { |
| | | console.log(9) |
| | | await this.routecodeChange() |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | this.flag1 = false |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | return this.$message.info('此工单的最大修改数值为:' + this.dialogForm.mesmaxqty) |
| | | } |
| | | |
| | | const workListSub = [] |
| | | const WorkListSub = [] |
| | | this.stepTableData.forEach((i, j) => { |
| | | workListSub.push( |
| | | const children = [] |
| | | if (i.children.length > 0) { |
| | | i.children.forEach(k => { |
| | | if (k.enable === 'Y') { |
| | | children.push({ |
| | | eqpcode: k.eqp_code, |
| | | unprice: parseFloat(k.unprice) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | WorkListSub.push( |
| | | { |
| | | stepseq: j + 1, |
| | | stepcode: i.stepcode, |
| | | stepprice: i.stepprice, |
| | | unprice: i.unprice, |
| | | isbott: j === 0 ? 'Y' : 'N', |
| | | isend: j === this.stepTableData.length - 1 ? 'Y' : 'N' |
| | | isend: j === this.stepTableData.length - 1 ? 'Y' : 'N', |
| | | WorkEqpListSub: children |
| | | } |
| | | ) |
| | | }) |
| | | |
| | | if (workListSub.length === 0) { |
| | | if (WorkListSub.length === 0) { |
| | | return this.$message.info('工序不能为空!') |
| | | } |
| | | |
| | |
| | | woqty: this.dialogForm.mesqty, // 工单数量 |
| | | deliverydate: this.dialogForm.deliverydate, // 交付时间 |
| | | data_sources: this.dialogForm.data_sources, // 数据来源 |
| | | isstep: workListSub.length > 0 ? 'Y' : 'N', // |
| | | isstep: WorkListSub.length > 0 ? 'Y' : 'N', // |
| | | difference: this.dialogForm.mesqty - this.dialogForm.mesqtyinit, // 数据差值 |
| | | routecode: this.dialogForm.routecode, |
| | | workListSub |
| | | WorkListSub |
| | | } |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |