| | |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="产品信息" prop="partcode"> |
| | | <el-select |
| | | v-model="dialogForm.partcode" |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="partcodeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in partcodeArr" |
| | | :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"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- filterable--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- @change="partcodeChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in partcodeArr"--> |
| | | <!-- :key="item.partcode"--> |
| | | <!-- :label="item.partname+' / '+item.partcode"--> |
| | | <!-- :value="item.partcode"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="mesSetting.route" |
| | |
| | | :on-exceed="handleExceed" |
| | | :auto-upload="false" |
| | | :multiple="false" |
| | | accept=".mp4,.pdf,.png,.jpeg,.jpg,.svg,.txt,.xlsx,.xls" |
| | | > |
| | | <!-- accept=".mp4,.pdf"--> |
| | | <!-- accept=".mp4,.pdf,.png,.jpeg,.jpg"--> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | |
| | | </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> |
| | | |
| | |
| | | import { ProcessSopAddSeave, ProcessSopDeleteSeave, ProcessSopSearch, ProcessSopMaxVersion } from '@/api/SopManager' |
| | | import waves from '@/directive/waves' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import { PartSelect } from '@/api/ProductModel' |
| | | import { PartSelect, TMaterielClassTree, TMaterielData } from '@/api/ProductModel' |
| | | import { PartSelectRpute, RouteSelectStep } from '@/api/basicSettings' |
| | | import arrayToTree from 'array-to-tree' |
| | | |
| | | export default { |
| | | name: 'SopRoute', |
| | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | partcode: '', // 设备类型编码 |
| | | partname: '', // |
| | | |
| | | route: '', // 物料编码 |
| | | stepcode: '', |
| | | defilename: '', |
| | |
| | | { code: 'P002', name: '检验指导书' }, |
| | | { code: 'P003', name: '图纸' } |
| | | ], |
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')) |
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')), |
| | | |
| | | 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 |
| | | |
| | | } |
| | | }, |
| | |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | this.getProcessSopSearch() |
| | | this.getPartSelect() |
| | | // this.getPartSelect() |
| | | this.getTMaterielClassTree() |
| | | }, |
| | | created() { |
| | | this.getProcessSopSearch() |
| | | this.getPartSelect() |
| | | // this.getPartSelect() |
| | | this.getTMaterielClassTree() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | 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 |
| | | }, |
| | | |
| | | async dialogVisibleConfirmSuitobject() { |
| | | await this.partcodeChange(this.dialogForm.partcode) |
| | | 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.partcodeArr.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 |
| | | }, |
| | | |
| | | async getPartSelect() { |
| | | const { data: res } = await PartSelect() |
| | | this.partcodeArr = res |
| | |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | console.log(this.$refs.uploadFileRef.uploadFiles[0]) |
| | | // console.log(this.$refs.uploadFileRef.uploadFiles[0]) |
| | | if (!this.$refs.uploadFileRef.uploadFiles[0]) { |
| | | this.$message.info('请选择文件上传!') |
| | | return this.$message.info('请选择文件上传!') |
| | | } |
| | | |
| | | const isLt100M = this.$refs.uploadFileRef.uploadFiles[0].size / 1024 / 1024 <= 1024 |
| | | const isLt100M = this.$refs.uploadFileRef.uploadFiles[0].size / 1024 / 1024 <= 10 |
| | | if (!isLt100M) { |
| | | return this.$message.info('请检查,上传文件大小不能超过1024MB!') |
| | | return this.$message.info('请检查,上传文件大小不能超过10MB!') |
| | | } |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .elTableDiv { |
| | | ::v-deep .el-radio__label { |
| | | display: none !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | |
| | | </style> |