| | |
| | | v-el-drag-dialog |
| | | title="文件上传" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | width="1000px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | top="5vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="产品信息" prop="partcode"> |
| | | <el-form-item label="产品信息"> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | |
| | | @click="selectSuitpart" |
| | | >选择物料 |
| | | </el-button> |
| | | <div v-if="dialogForm.partcode.toString().trim().length>0"> |
| | | 已选择{{ dialogForm.partcode }} {{ dialogForm.partname }} |
| | | <div v-if="multipleSelection.length>0"> |
| | | 已选择{{ multipleSelection.length }}个物料 |
| | | </div> |
| | | <!-- <div v-if="dialogForm.partcode.toString().trim().length>0">--> |
| | | <!-- 已选择{{ dialogForm.partcode }} {{ dialogForm.partname }}--> |
| | | <!-- </div>--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.partcode"--> |
| | | <!-- style="width: 200px"--> |
| | |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | :popper-append-to-body="false" |
| | | @change="stepcodeChange" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="版本号"> |
| | | <el-input v-model="dialogForm.fileversion" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="文件上传" prop="Files"> |
| | | <div style="width: 200px;"> |
| | | <el-upload |
| | |
| | | </el-button> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label-width="120" label="对应版本号"> |
| | | <el-table |
| | | :data="versionList" |
| | | border |
| | | style="width: 800px" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | height="300" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | width="60" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="materielcode" |
| | | label="物料编码" |
| | | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="materielname" |
| | | label="物料名称" |
| | | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="materielspec" |
| | | label="规格型号" |
| | | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | label="工序编码" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="工序名称" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="file_version" |
| | | label="版本号" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | </el-table> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="partcode" |
| | | @row-click="rowClick2" |
| | | :row-key="getRowKey" |
| | | @select-all="handleSelectionAllChange" |
| | | @select="handleSelectionChange" |
| | | > |
| | | |
| | | <!-- @row-click="rowClick2"--> |
| | | <el-table-column |
| | | width="50" |
| | | type="selection" |
| | | :reserve-selection="true" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="dialogForm.partcode" |
| | | :label="row.partcode" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | </template> |
| | | <!-- <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" |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="is_retdproc" |
| | | label="是否绑定工艺" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.is_retdproc==='Y'" size="small" type="success">已绑定</el-tag> |
| | | <el-tag v-else size="small" type="danger">未绑定</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { ProcessSopAddSeave, ProcessSopDeleteSeave, ProcessSopSearch, ProcessSopMaxVersion } from '@/api/SopManager' |
| | | import { |
| | | ProcessSopAddSeave, |
| | | ProcessSopDeleteSeave, |
| | | ProcessSopSearch, |
| | | ProcessSopMaxVersion, |
| | | ProcessSopPartSelectRpute |
| | | } from '@/api/SopManager' |
| | | import waves from '@/directive/waves' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import { PartSelect, TMaterielClassTree, TMaterielData } from '@/api/ProductModel' |
| | |
| | | form: { |
| | | check: 'N', // 是否选中最高版本 |
| | | search: '', // 搜索关键字 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | prop: 'materielcode,routecode,stepcode', // 排序字段 |
| | | order: 'asc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | |
| | | partname: '', // |
| | | |
| | | route: '', // 物料编码 |
| | | stepcode: '', |
| | | stepcode: [], |
| | | defilename: '', |
| | | filetypecode: '', // 文件类型编码 |
| | | Files: '', // 文件 |
| | |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | }, |
| | | suitobjectTotal: 0 |
| | | suitobjectTotal: 0, |
| | | multipleSelection: [], |
| | | versionList: [] |
| | | |
| | | } |
| | | }, |
| | |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | getRowKey(row) { |
| | | return row.partcode |
| | | }, |
| | | handleSelectionAllChange(val) { |
| | | this.multipleSelection = JSON.parse(JSON.stringify(val)) |
| | | }, |
| | | handleSelectionChange(val, row) { |
| | | const arrAll = JSON.parse(JSON.stringify(val)) |
| | | if (this.multipleSelection.filter((item) => item.partcode === row.partcode).length === 0) { |
| | | this.multipleSelection = arrAll |
| | | } else { |
| | | this.multipleSelection = arrAll.filter((item) => item.partcode !== row.partcode) |
| | | } |
| | | }, |
| | | selectSuitpart() { |
| | | this.dialogVisibleSuitobject = true |
| | | this.$nextTick(() => { |
| | |
| | | }, |
| | | |
| | | async dialogVisibleConfirmSuitobject() { |
| | | await this.partcodeChange(this.dialogForm.partcode) |
| | | const { data: res } = await ProcessSopPartSelectRpute(this.multipleSelection.map(i => i.partcode)) |
| | | // await this.partcodeChange(this.dialogForm.partcode) |
| | | if (this.mesSetting.route) { |
| | | this.routeArr = res |
| | | } else { |
| | | this.stepcodeArr = res |
| | | } |
| | | this.dialogForm.route = '' |
| | | this.dialogForm.stepcode = [] |
| | | this.dialogVisibleSuitobject = false |
| | | |
| | | this.versionList = [] |
| | | // await this.stepcodeChange() |
| | | }, |
| | | |
| | | rowClick2(row, event, column) { |
| | |
| | | this.stepcodeArr = res |
| | | } |
| | | this.dialogForm.route = '' |
| | | this.dialogForm.stepcode = '' |
| | | this.dialogForm.stepcode = [] |
| | | await this.stepcodeChange() |
| | | }, |
| | | async routeChange() { |
| | |
| | | } |
| | | const { data: res } = await RouteSelectStep(data) |
| | | this.stepcodeArr = res |
| | | this.dialogForm.stepcode = '' |
| | | this.dialogForm.stepcode = [] |
| | | await this.stepcodeChange() |
| | | }, |
| | | async stepcodeChange() { |
| | | if (this.dialogForm.partcode && this.dialogForm.stepcode && this.dialogForm.filetypecode) { |
| | | if (this.multipleSelection && this.dialogForm.filetypecode) { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | | // partcode: this.dialogForm.partcode, |
| | | partcode: this.multipleSelection.map(i => i.partcode), |
| | | routecode: this.dialogForm.route, |
| | | stepcode: this.dialogForm.stepcode, |
| | | filetypecode: this.dialogForm.filetypecode |
| | | } |
| | | const { data: res } = await ProcessSopMaxVersion(data) |
| | | this.dialogForm.fileversion = res |
| | | this.versionList = res |
| | | } |
| | | }, |
| | | |
| | |
| | | this.dialogForm.fileversion = '' |
| | | this.dialogForm.stepcode = '' |
| | | this.dialogForm.Files = '' |
| | | this.multipleSelection = [] |
| | | this.versionList = [] |
| | | this.$refs.uploadFileRef.clearFiles() |
| | | this.$refs.dialogForm.clearValidate() |
| | | this.$refs.tableDataRef3.clearSelection() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | if (this.multipleSelection.length === 0) { |
| | | return this.$message.info('请先选择产品!') |
| | | } |
| | | |
| | | // const sopPartVersionList = [] |
| | | // this.versionList.forEach(i => { |
| | | // sopPartVersionList.push({ |
| | | // PartCode: i.materielcode, |
| | | // Routecode: this.dialogForm.route, |
| | | // StepCode: i.stepcode, |
| | | // Version: i.file_version |
| | | // }) |
| | | // }) |
| | | |
| | | const formData = new FormData() |
| | | formData.append('partcode', this.dialogForm.partcode) |
| | | formData.append('routecode', this.dialogForm.route) |
| | | formData.append('stepcode', this.dialogForm.stepcode) |
| | | this.versionList.forEach((i, index) => { |
| | | formData.append(`sopPartVersionList[${index}].PartCode`, i.materielcode) |
| | | formData.append(`sopPartVersionList[${index}].Routecode`, this.dialogForm.route) |
| | | formData.append(`sopPartVersionList[${index}].StepCode`, i.stepcode) |
| | | formData.append(`sopPartVersionList[${index}].Version`, i.file_version) |
| | | }) |
| | | // formData.append('sopPartVersionList', JSON.stringify(sopPartVersionList).toString()) |
| | | // formData.append('partcode', this.dialogForm.partcode) |
| | | // formData.append('routecode', this.dialogForm.route) |
| | | // formData.append('stepcode', this.dialogForm.stepcode) |
| | | formData.append('filename', this.$refs.uploadFileRef.uploadFiles[0].name) |
| | | formData.append('filetypecode', this.dialogForm.filetypecode) |
| | | formData.append('version', this.dialogForm.fileversion) |
| | | // formData.append('version', this.dialogForm.fileversion) |
| | | formData.append('file', this.$refs.uploadFileRef.uploadFiles[0].raw) |
| | | // for (var [key, value] of formData) { |
| | | // console.log(key, value) |