| | |
| | | label="产品名称/编码" |
| | | prop="partcode" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.partcode" |
| | | filterable |
| | | :disabled="operation!=='add'" |
| | | :popper-append-to-body="false" |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | @change="partcodeChangeDialog" |
| | | > |
| | | <el-option |
| | | v-for="item in partArr" |
| | | :key="item.partcode" |
| | | :label="item.partname+'/'+item.partcode" |
| | | :value="item.partcode" |
| | | /> |
| | | </el-select> |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="selectSuitpart" |
| | | >选择物料</el-button> |
| | | <div v-if="dialogForm.partcode.toString().trim().length>0"> |
| | | 已选择{{ dialogForm.partcode }} {{ dialogForm.partname }} |
| | | </div> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.partcode"--> |
| | | <!-- filterable--> |
| | | <!-- :disabled="operation!=='add'"--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="partcodeChangeDialog"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in partArr"--> |
| | | <!-- :key="item.partcode"--> |
| | | <!-- :label="item.partname+'/'+item.partcode"--> |
| | | <!-- :value="item.partcode"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="operation!=='add'" label="产品名称" prop="partname">--> |
| | | <!-- <el-input v-model="dialogForm.partname" disabled style="width: 200px" />--> |
| | |
| | | </div> |
| | | <div |
| | | id="qrCode0" |
| | | :key="formApprove.mesordercode" |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | |
| | | width="70" |
| | | align="center" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- id="column1"--> |
| | | <!-- prop="stepqrcode"--> |
| | | <!-- label="工序二维码"--> |
| | | <!-- width="100"--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | |
| | | <!-- <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="stepqrcode" |
| | | label="工序二维码" |
| | | prop="stepcode" |
| | | label="工序编码" |
| | | width="100" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | |
| | | <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" /> |
| | | </template> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="stepname" |
| | | label="工序" |
| | | label="工序名称" |
| | | width="120" |
| | | align="center" |
| | | /> |
| | |
| | | </div> |
| | | <div |
| | | id="qrCode1" |
| | | :key="formApprove.mesordercode" |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | |
| | | width="70" |
| | | align="center" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- id="column1"--> |
| | | <!-- prop="stepqrcode"--> |
| | | <!-- label="工序二维码"--> |
| | | <!-- width="100"--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | |
| | | <!-- <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="stepqrcode" |
| | | label="工序二维码" |
| | | prop="stepcode" |
| | | label="工序编码" |
| | | width="100" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | |
| | | <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" /> |
| | | </template> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="stepname" |
| | |
| | | label="产品名称" |
| | | prop="partcode" |
| | | > |
| | | <div style="width: 200px;">{{ partArr.find(item => item.partcode === i.partcode).partname }}</div> |
| | | <div style="width: 200px;">{{ suitobjectTableData.find(item => item.partcode === i.partcode).partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="产品编码" |
| | |
| | | |
| | | <el-form-item label="产品规格" prop="partspec"> |
| | | <div style="width: 200px;">{{ |
| | | partArr.find(item => item.partcode === i.partcode).partspec ? partArr.find(item => item.partcode === i.partcode).partspec : '/' |
| | | suitobjectTableData.find(item => item.partcode === i.partcode).partspec ? suitobjectTableData.find(item => item.partcode === i.partcode).partspec : '/' |
| | | }} |
| | | </div> |
| | | </el-form-item> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!--选择物料--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="dialogForm.suitobject==='P'?'选择物料':'选择物料类别'" |
| | | :visible.sync="dialogVisibleSuitobject" |
| | | width="1460px" |
| | | :close-on-click-modal="false" |
| | | top="5vh" |
| | | @closed="handleCloseSuitobject" |
| | | @close="handleCloseSuitobject" |
| | | > |
| | | |
| | | <div style="display: flex"> |
| | | <div style="width: 300px;margin-right: 20px;background:#fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">存货档案</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | style="padding: 10px;overflow: auto;height: 600px;" |
| | | :data="treeLeft" |
| | | node-key="code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | @node-click="getTMaterielData" |
| | | /> |
| | | </div> |
| | | <div |
| | | style=" width:calc(100% - 300px);" |
| | | > |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="suitobjectForm" |
| | | :model="suitobjectForm" |
| | | label-width="80px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="存货编码" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partcode" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="存货名称" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partname" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="存货规格" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partspec" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </div> |
| | | <div class="bodySearchReset"> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | >查询 |
| | | </el-button> |
| | | <el-button |
| | | v-waves |
| | | type="info" |
| | | icon="el-icon-refresh" |
| | | @click="resetSuitobject" |
| | | >重置 |
| | | </el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef3" |
| | | class="tableFixed" |
| | | :data="suitobjectTableData" |
| | | height="520" |
| | | border |
| | | row-class-name="custom-row" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="partcode" |
| | | @row-click="rowClick2" |
| | | > |
| | | |
| | | <el-table-column |
| | | width="50" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="dialogForm.partcode" |
| | | :label="row.partcode" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="70" |
| | | fixed |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="存货编码" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="存货名称" |
| | | show-tooltip-when-overflow |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="规格型号" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="idinventoryclassname" |
| | | label="所属类别" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!--分页--> |
| | | <pagination |
| | | :total="suitobjectTotal" |
| | | :page.sync="suitobjectForm.page" |
| | | :limit.sync="suitobjectForm.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | /> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancelSuitobject">返 回</el-button> |
| | | <el-button |
| | | v-waves |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | type="primary" |
| | | @click="dialogVisibleConfirmSuitobject" |
| | | >确 认</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | MesOrderSearch, MesOrderSopSearch, UpdateMesOrderStepListSearch, |
| | | UpdateMesOrderStepSearch |
| | | } from '@/api/WorkOrder' |
| | | import { PartSelect } from '@/api/ProductModel' |
| | | import { PartSelect, TMaterielClassTree, TMaterielData } from '@/api/ProductModel' |
| | | import { PrentOrganization, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData' |
| | | import Sortable from 'sortablejs' |
| | | import ElDragSelect from '@/components/DragSelect' |
| | |
| | | import DateType from '@/components/DateType' |
| | | import { PartSelectRpute, PartSelectRputeList, RouteSelectStep, RouteSelectStepList } from '@/api/basicSettings' |
| | | import { DeviceSopSearch } from '@/api/DeviceManager' |
| | | import arrayToTree from 'array-to-tree' |
| | | |
| | | export default { |
| | | name: 'WorkOrderList', |
| | |
| | | partCode: '', |
| | | |
| | | dialogVisibleBatchUpdate: false, // 批量修改 |
| | | formData3: [] |
| | | formData3: [], |
| | | |
| | | dialogVisibleSuitobject: false, |
| | | treeLeft: [ |
| | | { |
| | | code: '-1', |
| | | name: '全部' |
| | | } |
| | | ], // 左侧树 |
| | | treeLeftArr: [], |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | |
| | | suitobjectTableData: [], |
| | | suitobjectForm: { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | }, |
| | | suitobjectTotal: 0 |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | // }) |
| | | }, |
| | | methods: { |
| | | selectSuitpart() { |
| | | this.dialogVisibleSuitobject = true |
| | | this.$nextTick(() => { |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }) |
| | | }, |
| | | handleCloseSuitobject() { |
| | | this.suitobjectForm = { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | } |
| | | }, |
| | | dialogVisibleCancelSuitobject() { |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | dialogVisibleConfirmSuitobject() { |
| | | this.dialogForm.routecode = '' |
| | | |
| | | if (this.mesSetting.route) { |
| | | this.getPartcodeChangeDialog() |
| | | } else { |
| | | this.getBasicProcessData() |
| | | } |
| | | |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | rowClick2(row, event, column) { |
| | | this.dialogForm.partcode = row.partcode |
| | | this.dialogForm.partname = this.suitobjectTableData.find(i => i.partcode === row.partcode).partname |
| | | this.dialogForm.partspec = this.suitobjectTableData.find(i => i.partcode === row.partcode).partspec |
| | | }, |
| | | |
| | | resetSuitobject() { |
| | | this.suitobjectForm.inventoryclasscode = '' |
| | | this.suitobjectForm.partcode = '' |
| | | this.suitobjectForm.partname = '' |
| | | this.suitobjectForm.partspec = '' |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }, |
| | | async getTMaterielClassTree() { |
| | | const res = await TMaterielClassTree() |
| | | res.data.forEach(i => { |
| | | i.idparent = i.idparent ? i.idparent : '-1' |
| | | }) |
| | | this.treeLeftArr = res.data |
| | | this.treeLeftArr.forEach(e => { |
| | | e.name = e.code + ' ' + e.name |
| | | }) |
| | | this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), { |
| | | parentProperty: 'idparent', |
| | | customID: 'code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | }, |
| | | async getTMaterielData(node) { |
| | | const result = this.getChildrenCodeMethod(node, []) |
| | | if (result.includes('-1')) { |
| | | result.shift() |
| | | } |
| | | this.suitobjectForm.inventoryclasscode = result.join(',') |
| | | const res = await TMaterielData(this.suitobjectForm) |
| | | |
| | | this.suitobjectTableData = res.data |
| | | this.suitobjectTotal = res.count |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataRef3.doLayout() |
| | | }) |
| | | }, |
| | | // 递归取子集的所有code |
| | | getChildrenCodeMethod(node, result) { |
| | | result.push(node.code) |
| | | if (node.children && node.children.length > 0) { |
| | | node.children.forEach(i => { |
| | | this.getChildrenCodeMethod(i, result) |
| | | }) |
| | | } |
| | | return result |
| | | }, |
| | | |
| | | mesqtyInputChange(val) { |
| | | if (this.stepTableData && this.stepTableData.length > 0) { |
| | | this.stepTableData.forEach(i => { |
| | |
| | | if (res.code === '200') { |
| | | this.getSelect() |
| | | this.getPrentOrganizationNoCompany() |
| | | this.getTMaterielClassTree() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | async getSelect() { |
| | | // 获取产品信息 |
| | | const { data: res1 } = await PartSelect() |
| | | this.partArr = res1 |
| | | // const { data: res1 } = await PartSelect() |
| | | // this.partArr = res1 |
| | | |
| | | // 获取组织 |
| | | const { data: res2 } = await PrentOrganization() |
| | |
| | | this.dialogForm.mesmaxqty = res.canupdate_qty |
| | | if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | if (!this.dialogForm.routecode) { |
| | | return this.$message.error('请先将产品绑定工艺路线!') |
| | | } |
| | | if (!this.dialogForm.routecode) { |
| | | await this.getPartcodeChangeDialog() |
| | | } else { |
| | | const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) |
| | |
| | | this.routecodeArr = res |
| | | |
| | | // if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | this.dialogForm.routecode = this.partArr.find(item => item.partcode === this.dialogForm.partcode).default_route |
| | | this.dialogForm.routecode = this.suitobjectTableData.find(item => item.partcode === this.dialogForm.partcode).default_route |
| | | if (this.dialogForm.routecode && !this.sourceType) { |
| | | await this.routecodeChange() |
| | | } else { |
| | |
| | | res3 = res2.data.recordset |
| | | } |
| | | |
| | | console.log(JSON.parse(JSON.stringify(res2.data.recordset))) |
| | | |
| | | // this.tableDataPrint = res3 |
| | | this.tableDataPrint = this.chunkArray(res3, 8) |
| | | this.tableDataPrint = this.chunkArray(res3, 15) |
| | | |
| | | this.formApprove.mesordercode = res3[0].wo_code |
| | | this.formApprove.m_po = res3[0].m_po || '/' |
| | |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | } else { |
| | | new QRCode(this.$refs['qrCodeDiv' + seq], { |
| | | text: text, |
| | | width: size === 'big' ? 90 : 60, |
| | | height: size === 'big' ? 90 : 60, |
| | | // colorDark: '#333333', // 二维码颜色 |
| | | colorDark: '#000', // 二维码颜色 |
| | | colorLight: '#ffffff', // 二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | // new QRCode(this.$refs['qrCodeDiv' + seq], { |
| | | // text: text, |
| | | // width: size === 'big' ? 90 : 60, |
| | | // height: size === 'big' ? 90 : 60, |
| | | // // colorDark: '#333333', // 二维码颜色 |
| | | // colorDark: '#000', // 二维码颜色 |
| | | // colorLight: '#ffffff', // 二维码背景色 |
| | | // correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | // }) |
| | | } |
| | | }, |
| | | |