diff --git a/src/api/chooselist/chooselist.js b/src/api/chooselist/chooselist.js index 75b72c8..43ab934 100644 --- a/src/api/chooselist/chooselist.js +++ b/src/api/chooselist/chooselist.js @@ -5,3 +5,9 @@ export const getChooselist = data => createAPI(`/chooselist/getChooselist/${data export const getChooselistData = data => createAPI(`/chooselist/getChooselistData`,'post',data) + + +export const getChooselistEam = data => createAPI(`/chooselist/getChooselist/${data.tagNo}`,'get',data) + + +export const getChooselistDataEam = data => createAPI(`/chooselist/getChooselistData`,'post',data) diff --git a/src/views/modules/common/Chooselist_eam.vue b/src/views/modules/common/Chooselist_eam.vue new file mode 100644 index 0000000..068e661 --- /dev/null +++ b/src/views/modules/common/Chooselist_eam.vue @@ -0,0 +1,271 @@ + + + + diff --git a/src/views/modules/manufacturer/manufacturerInformation.vue b/src/views/modules/manufacturer/manufacturerInformation.vue index 4939b3a..4127470 100644 --- a/src/views/modules/manufacturer/manufacturerInformation.vue +++ b/src/views/modules/manufacturer/manufacturerInformation.vue @@ -150,7 +150,7 @@ export default { totalPage: 0, // 条件查询 searchData: { - site: '', + site: this.$store.state.user.site, userName: this.$store.state.user.name, buDesc: '', manufacturerNo: '', diff --git a/src/views/modules/part/external.vue b/src/views/modules/part/external.vue index 6699153..6bd890c 100644 --- a/src/views/modules/part/external.vue +++ b/src/views/modules/part/external.vue @@ -8,6 +8,7 @@ import { selectUnitList, updateExternalPart } from '../../../api/part/external' +import Chooselist from '@/views/modules/common/Chooselist_eam' import dayjs from 'dayjs' import PictureModule from './picture/picture.vue' import LinkedCustomer from './customer/linkedCustomer.vue' @@ -46,7 +47,7 @@ let part = { } export default { name: 'ExternalPart', - components: {LabelTemplate, LinkedManufacturer, LinkedCustomer, PictureModule}, + components: {LabelTemplate, LinkedManufacturer, LinkedCustomer, PictureModule,Chooselist}, props: { height: { type: Number, @@ -83,6 +84,11 @@ export default { ...part, active: 'Y', }, + tempData:{ + orderRef1: 'partInfo', + orderRef2: 'partInfoFormat', + site: this.$store.state.user.site, + }, partCategoryList: [], category: {}, partRules: { @@ -762,6 +768,15 @@ export default { columnWidth: 80 }, ], + rules: { + site: [ + { + required: true, + message: ' ', + trigger: ['blur', 'change'] + } + ], + }, activeName: 'partPicture', currentPart: {}, externalPartCustomerList: [], @@ -816,6 +831,27 @@ export default { }, }, methods: { + + // 获取基础数据列表S + getBaseList (val,type) { + this.tagNo = val + this.$nextTick(() => { + let strVal = '' + let conSql = '' + if (val === 93 ) { + strVal = this.tempData.site ? this.tempData.site : '' + } + this.$refs.baseList.init(val, strVal,conSql) + }) + }, + + /* 列表方法的回调 */ + getBaseData (val) { + if (this.tagNo === 93) { + this.tempData.site = val.SiteID + } + }, + getExternalPartPictureList (val) { let params = { partNo: this.currentPart.partNo, @@ -1262,35 +1298,40 @@ export default { saveUploadFile () { // 判断文件是否上传 if (null == this.fileList || 0 === this.fileList.length) { - this.$message.error("请先上传文件!") + this.$message.error("Please upload the file first!") return false } - // 提示将删除之前的数据 - this.$confirm('Do you confirm the upload? If the Part Info already exists, we will delete it!', 'Warning', { - confirmButtonText: 'OK', - cancelButtonText: 'Cancel', - type: 'warning' - }).then(() => { - const formData = new FormData() - formData.append("file", this.fileList[0].raw) - formData.append("createBy", this.$store.state.user.name) - formData.append("site", this.$store.state.user.site.toString()) - this.isLoading = true - savePartInfoByExcel(formData).then(({data}) => { - if (data.code === 0) { - // 关闭窗口并刷新页面 - this.provisionalDataDialogHandle() - } else { - this.isLoading = false - this.$message.warning(data.msg) + // 提示将删除之前的数据 + this.$confirm('Do you confirm the upload? If the Part Info already exists, we will delete it!', 'Warning', { + confirmButtonText: 'OK', + cancelButtonText: 'Cancel', + type: 'warning' + }).then(() => { + // 判断文件是否上传 + if (null == this.fileList || 0 === this.fileList.length) { + this.$message.error("请先上传文件!") + return false } - }) - }).catch(() => { - this.$message({ - type: 'info', - message: 'Cancel upload' - }) - }) + const formData = new FormData() + formData.append("file", this.fileList[0].raw) + formData.append("createBy", this.$store.state.user.name) + formData.append("site", this.tempData.site.toString()) + this.isLoading = true + savePartInfoByExcel(formData).then(({data}) => { + if (data.code === 0) { + // 关闭窗口并刷新页面 + this.provisionalDataDialogHandle() + } else { + this.isLoading = false + this.$message.warning(data.msg) + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: 'Cancel upload' + }) + }); }, provisionalDataDialogHandle () { @@ -1329,10 +1370,7 @@ export default { id: 0, fileName: '' } - let tempData = { - orderRef1: 'partInfo', - orderRef2: 'partInfoFormat' - } + let tempData = this.tempData await queryFileId(tempData).then(({data}) => { if (data && data.code === 0) { file.id = data.data.id @@ -1664,10 +1702,13 @@ export default { - + - - + + + Site + + Download file template @@ -1713,6 +1754,8 @@ export default { + +
@@ -1720,5 +1763,7 @@ export default {