diff --git a/src/api/manufacturer/manufacturerInformation.js b/src/api/manufacturer/manufacturerInformation.js
new file mode 100644
index 0000000..a53df77
--- /dev/null
+++ b/src/api/manufacturer/manufacturerInformation.js
@@ -0,0 +1,26 @@
+import { createAPI } from "@/utils/httpRequest.js";
+
+/**
+ * 制造商信息列表查询
+ * @param data
+ * @returns {*}
+ */
+export const manufacturerInformationSearch = data => createAPI(`/manufacturerInformation/manufacturerInformationSearch`,'post',data)
+/**
+ * 制造商信息新增
+ * @param data
+ * @returns {*}
+ */
+export const manufacturerInformationSave = data => createAPI(`/manufacturerInformation/manufacturerInformationSave`,'post',data)
+/**
+ * 制造商信息编辑
+ * @param data
+ * @returns {*}
+ */
+export const manufacturerInformationEdit = data => createAPI(`/manufacturerInformation/manufacturerInformationEdit`,'post',data)
+/**
+ * 制造商信息删除
+ * @param data
+ * @returns {*}
+ */
+export const manufacturerInformationDelete = data => createAPI(`/manufacturerInformation/manufacturerInformationDelete`,'post',data)
diff --git a/src/api/part/external.js b/src/api/part/external.js
index 6b59f44..06e24b9 100644
--- a/src/api/part/external.js
+++ b/src/api/part/external.js
@@ -8,3 +8,8 @@ export const saveExternalPart = (data) => createAPI('/part/save', 'post', data)
export const removeExternalPart = (data) => createAPI('/part/remove', 'post', data)
export const updateExternalPart = (data) => createAPI('/part/update', 'post', data)
+
+export const selectExternalPartAndCustomerPage = (data) => createAPI(`/part/customer1/${data.no}/${data.size}`, 'post', data)
+
+export const selectExternalPartAndManufacturerPage = (data) => createAPI(`/part/manufacturer1/${data.no}/${data.size}`, 'post', data)
+
diff --git a/src/views/modules/manufacturer/manufacturerInformation.vue b/src/views/modules/manufacturer/manufacturerInformation.vue
new file mode 100644
index 0000000..0765609
--- /dev/null
+++ b/src/views/modules/manufacturer/manufacturerInformation.vue
@@ -0,0 +1,549 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Query
+ New
+
+
+
+
+
+
+ {{ scope.row[item.columnProp] }}
+
+
+
+
+
+ Edit
+ Delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Active
+
+
+
+
+
+
+
+
+
+
+ Save
+ Cancel
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/part/customer/linkedCustomer.vue b/src/views/modules/part/customer/linkedCustomer.vue
index e8b98a8..facc889 100644
--- a/src/views/modules/part/customer/linkedCustomer.vue
+++ b/src/views/modules/part/customer/linkedCustomer.vue
@@ -32,6 +32,10 @@ export default {
type:Array,
default:()=>[],
},
+ visible:{
+ type:Boolean,
+ default:true,
+ }
},
data(){
return{
@@ -153,11 +157,12 @@ export default {
-
+
New Customer
{
if (data && data.code === 0){
this.partList = data.rows;
@@ -1198,6 +1202,15 @@ export default {
},
computed:{
+ },
+ activated() {
+ if (this.$route.query.site && this.$route.query.partNo){
+ let part1 = {
+ site: this.$route.query.site,
+ partNo: this.$route.query.partNo,
+ }
+ this.handleSelectExternalPartPage(part1);
+ }
},
created () {
this.selectUnitList();
@@ -1286,10 +1299,10 @@ export default {
-
+
-
+
diff --git a/src/views/modules/part/manufacturer/linkedManufacturer.vue b/src/views/modules/part/manufacturer/linkedManufacturer.vue
index ae507db..80384d3 100644
--- a/src/views/modules/part/manufacturer/linkedManufacturer.vue
+++ b/src/views/modules/part/manufacturer/linkedManufacturer.vue
@@ -29,6 +29,10 @@ export default {
type:Array,
default:()=>[],
},
+ visible:{
+ type:Boolean,
+ default:true,
+ }
},
data(){
return{
@@ -150,11 +154,12 @@ export default {
-
+
New Manufacturer
+import {
+ removeExternalPart,
+ saveExternalPart,
+ selectExternalPartList, selectExternalPartAndCustomerPage,
+ selectUnitList,
+ updateExternalPart
+} from '../../../api/part/external'
+import dayjs from 'dayjs'
+import PictureModule from './picture/picture.vue'
+import LinkedCustomer from './customer/linkedCustomer.vue'
+import {getExternalPartCustomerList} from '../../../api/part/externalPartCustomer'
+import {getExternalPartPictureList} from '../../../api/part/externalPartPicture'
+import LinkedManufacturer from './manufacturer/linkedManufacturer.vue'
+import {getExternalPartManufacturerList} from '../../../api/part/externalPartManufacturer'
+import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table'
+import {Decimal} from 'decimal.js'
+import {getCategoryList} from '../../../api/category/category'
+import {countryList} from '../../../api/dict/country'
+import {getSiteDetail} from '../../../api/factory/site'
+import LabelTemplate from './template/labelTemplate.vue'
+
+let part = {
+ site:'',
+ partNo:'',
+ partDesc:'',
+ umId:'',
+ freeInfo:'',
+ freeInfo2:'',
+ rev:'',
+ active:'',
+ tradingMark:'N',
+ packingWeight:undefined,
+ weightUmId:undefined,
+ moldCode:'',
+ category:'',
+ qtyPerCarton:0,
+ qtyPerRoll:0,
+ rollsPerCarton:0,
+ printStr1:'',
+ printStr2:'',
+ printStr3:'',
+ customerNo:'',
+ customerName:'',
+}
+export default {
+ name: "ExternalPart",
+ components: {LabelTemplate, LinkedManufacturer, LinkedCustomer, PictureModule},
+ props:{
+ height:{
+ type:Number,
+ default: 310
+ },
+ ofComponents: {
+ type:Boolean,
+ default: false
+ }
+ },
+ data(){
+ return{
+ no:1,
+ size:50,
+ total:0,
+ part: {
+ ...part
+ },
+ savePart:{
+ ...part,
+ active:'Y',
+ },
+ partCategoryList:[
+
+ ],
+ category:{},
+ partRules:{
+ partNo: [{ required: true, message: 'Please input Part No', trigger: ['blur','change'] }],
+ partDesc: [{ required: true, message: 'Please input Part Description', trigger: ['blur','change'] }],
+ umId: [{ required: true, message: 'Please select UM', trigger: ['blur','change'] }],
+ rev: [{ required: true, message: 'Please select Rev No', trigger: ['blur','change'] }],
+ moldCode: [{ required: true, message: 'Please select Mold Code', trigger: ['blur','change'] }],
+ qtyPerCarton: [{ required: true, message: 'Please input Qty Per Carton', trigger: ['blur','change'] }],
+ qtyPerRoll: [{ required: true, message: 'Please input Qty Per Roll', trigger: ['blur','change'] }],
+ rollsPerCarton: [{ required: true, message: 'Please input Rolls Per Carton', trigger: ['blur','change'] }],
+ freeInfo2: [{ required: true, message: 'Please select OOC', trigger: ['blur','change'] }],
+ },
+ savePartVisible:false,
+ partTableLoading:false,
+ partList:[],
+ unitList:[],
+ columnList:[
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TablePartNo',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "partNo",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Part No",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TablePartDesc',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "partDesc",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Part Description",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableCustomerNo',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "customerNo",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Customer No",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableCustomerName',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "customerName",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Customer Name",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableRev',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "rev",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "REV No",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableCategory',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "category",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Part Category",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableUmName',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "moldCode",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Mold Code",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableUmName',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "umName",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "UM",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 60
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableQtyPerRoll',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "qtyPerRoll",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Qty Per Roll",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableRollsPerCarton',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "rollsPerCarton",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Rolls Per Carton",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableQtyPerCarton',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "qtyPerCarton",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Qty Per Carton",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableFreeInfo',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "freeInfo",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Free Info",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableFreeInfo2',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "freeInfo2",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Free Info2",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableTradingMark',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "tradingMark",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Trading Mark",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TablePackingWeight',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "packingWeight",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Packing Weight",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableWeightUM',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "weightUmName",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Weight UM",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableActive',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "active",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Active",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableCreateBy',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "createBy",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Created By",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableCreateTime',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "createTime",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Created Time",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableUpdateBy',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "updateBy",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Updated By",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004TableUpdateTime',
+ tableId: "10004Table",
+ tableName: "Part Table",
+ columnProp: "updateTime",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Updated Time",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },
+ ],
+ manufacturerColumnList:[
+ {
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4ManufacturerNo',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "manufacturerNo",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Manufacturer No",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4ManufacturerName',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "manufacturerName",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Manufacturer Name",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4CreateTime',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "createTime",
+ headerAlign: "center",
+ align: "center",
+ columnLabel: "Created Time",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4CreateBy',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "createBy",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Created By",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4UpdateTime',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "updateTime",
+ headerAlign: "center",
+ align: "center",
+ columnLabel: "Updated Time",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 140
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 10004,
+ serialNumber: '10004Table4UpdateBy',
+ tableId: "10004Table4",
+ tableName: "外部料号供应商信息表",
+ columnProp: "updateBy",
+ headerAlign: "center",
+ align: "left",
+ columnLabel: "Updated By",
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 10,
+ status: true,
+ fixed: '',
+ columnWidth: 80
+ },
+ ],
+ activeName:'linkedManufacturer',
+ currentPart:{},
+ externalPartCustomerList:[],
+ pictureList:[],
+ externalPartManufacturerList:[],
+ base64List:[],
+ countryList:[],
+ }
+ },
+ watch:{
+ currentPart(newVal,oldVal){
+ if (!this.ofComponents){
+ // 调用 子组件信息查询
+ this.getExternalPartManufacturerList();
+ }
+ },
+ "savePart.partNo"(newVal,oldVal){
+ this.savePart.partNo = newVal.toUpperCase()
+ },
+ "savePart.category"(newVal,oldVal){
+ const category = this.partCategoryList.find((item)=>item.categoryValue === newVal);
+ if (category){
+ // this.savePart.manufacturerRequired = category.manufacturerRequired;
+ // this.savePart.moldCodeRequired = category.moldCodeRequired;
+ // this.savePart.serialNumberRequired = category.serialNumberRequired;
+ // this.savePart.rollLabelRequired = category.rollLabelRequired;
+ // if (this.savePart.serialNumberRequired === 'Y'){
+ // this.savePart.qtyPerRoll = 1;
+ // this.savePart.rollsPerCarton = 1;
+ // }
+ // if (category.showCartonQtyPerRoll === 'N'){
+ // this.savePart.qtyPerRoll = 1;
+ // }
+ // if (category.showCartonRollsPerCarton === 'N'){
+ // this.savePart.rollsPerCarton = 1;
+ // }
+ // this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
+ // this.savePart.qtyPerCarton = this.qtyPerCarton();
+ this.category = JSON.parse(JSON.stringify(category))
+ }
+ },
+ "part.partNo"(newVal,oldVal){
+ this.part.partNo = newVal.toUpperCase()
+ },
+ "savePart.qtyPerRoll"(newVal,oldVal){
+ this.savePart.qtyPerCarton = this.qtyPerCarton();
+ },
+ "savePart.rollsPerCarton"(newVal,oldVal){
+ this.savePart.qtyPerCarton = this.qtyPerCarton();
+ },
+ },
+ methods:{
+ // getExternalPartPictureList(val){
+ // let params = {
+ // partNo: this.currentPart.partNo,
+ // site: this.currentPart.site,
+ // pictureClassify:'BoxPicture',
+ // }
+ // getExternalPartPictureList(params).then(({data})=>{
+ // if (data && data.code === 0){
+ // this.pictureList = data.rows;
+ // if (val === true){
+ // this.$nextTick(()=>{
+ // this.$refs.picture.handleBasePictureList();
+ // })
+ // }
+ // }else {
+ // this.$message.warning(data.msg)
+ // }
+ // }).catch((error)=>{
+ // this.$message.error(error)
+ // })
+ // },
+ rowPartStyle({row}){
+ if (row.customerNo === this.currentPart.customerNo && row.partNo === this.currentPart.partNo){
+ return {
+ background: 'rgb(232,246,246)',
+ }
+ }
+ },
+ selectUnitList(){
+ selectUnitList().then(({data})=>{
+ if (data && data.code === 0){
+ this.unitList = data.rows;
+ if (this.unitList.length > 0){
+ this.savePart.umId = this.unitList[0].umId;
+ }
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ selectExternalPartList(){
+ let params = {
+ ...this.part,
+ site: this.$store.state.user.site,
+ }
+ selectExternalPartList(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.partList = data.rows;
+ if (this.partList.length > 0 && !this.ofComponents){
+ this.currentPart = {...this.partList[0]}
+ }
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ // handleSave(){
+ // if (this.savePartVisible){
+ // if ((this.savePart.packingWeight || this.savePart.packingWeight == 0) && !this.savePart.weightUmId){
+ // this.$message.warning('Please select Weight UM')
+ // return
+ // }
+ // this.$refs.savePartForm.validate((valid,obj) => {
+ // if (valid) {
+ // if (this.savePart.qtyPerCarton === 0){
+ // this.$message.warning('Qty Per Carton can not be 0')
+ // return
+ // }
+ // let params = {
+ // ...this.savePart,
+ // site: this.$store.state.user.site,
+ // createBy: this.$store.state.user.name,
+ // createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+ // }
+ // saveExternalPart(params).then(({data})=>{
+ // if (data && data.code === 0){
+ // this.handleSelectExternalPartAndCustomerPage()
+ // this.savePartVisible = false
+ // this.$message.success(data.msg)
+ // }else {
+ // this.$message.warning(data.msg)
+ // }
+ // }).catch((error)=>{
+ // this.$message.error(error)
+ // })
+ // }else {
+ // for (let i = 0; i < Object.keys(obj).length; i++) {
+ // this.$message.warning(obj[Object.keys(obj)[i]][0].message)
+ // break
+ // }
+ // }
+ // })
+ // }else {
+ // this.savePart = {
+ // ...part,
+ // active: 'Y',
+ // umId: this.unitList.length > 0 ? this.unitList[0].umId : '',
+ // category: '',
+ // manufacturerRequired: 'N',
+ // moldCodeRequired: 'N',
+ // serialNumberRequired: 'N',
+ // }
+ // this.getCountryList();
+ // this.savePart.freeInfo2 = this.defaultCountry
+ // this.savePart.category = this.partCategoryList.length > 0 ? this.partCategoryList[0].categoryValue : ''
+ // this.savePartVisible = true;
+ // }
+ // },
+ // closeSavePart(){
+ // this.savePart = {
+ // ...part,
+ // active: 'Y',
+ // }
+ // if (this.unitList.length > 0){
+ // this.savePart.umId = this.unitList[0].umId;
+ // }
+ // this.$refs.savePartForm.resetFields()
+ // },
+ // removeExternalPart(row){
+ // removeExternalPart(row).then(({data})=>{
+ // if (data && data.code === 0){
+ // this.selectExternalPartList()
+ // this.$message.success(data.msg)
+ // }else {
+ // this.$message.warning(data.msg)
+ // }
+ // }).catch((error)=>{
+ // this.$message.error(error)
+ // })
+ // },
+ handleRowClick(row, column, event,type){
+ this.currentPart = {...row}
+ if (type === 0){
+ this.getCountryList();
+ this.savePart = {...row}
+ this.savePartVisible = true;
+ }
+ },
+ handleDblRowClick(row, column, event,type){
+ if (this.ofComponents){
+ this.$emit('rowClick',row)
+ }else {
+ this.currentPart = {...row}
+ if (type === 0){
+ this.savePart = {...row}
+ this.savePartVisible = true;
+ }
+ }
+ },
+ // handleUpdate(){
+ // if ((this.savePart.packingWeight || this.savePart.packingWeight == 0) && !this.savePart.weightUmId){
+ // this.$message.warning('Please select Weight UM')
+ // return
+ // }
+ // this.$refs.savePartForm.validate((valid,obj) => {
+ // if (valid) {
+ // if (this.savePart.qtyPerCarton === 0){
+ // this.$message.warning('Qty Per Carton can not be 0')
+ // return
+ // }
+ // let params = {
+ // ...this.savePart,
+ // site: this.$store.state.user.site,
+ // createBy: undefined,
+ // createTime: undefined,
+ // updateBy: this.$store.state.user.name,
+ // updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+ // }
+ // updateExternalPart(params).then(({data})=>{
+ // if (data && data.code === 0){
+ // this.handleSelectExternalPartAndCustomerPage()
+ // this.savePartVisible = false
+ // this.$message.success(data.msg)
+ // }else {
+ // this.$message.warning(data.msg)
+ // }
+ // }).catch((error)=>{
+ // this.$message.error(error)
+ // })
+ // }else {
+ // for (let i = 0; i < Object.keys(obj).length; i++) {
+ // this.$message.warning(obj[Object.keys(obj)[i]][0].message)
+ // break
+ // }
+ // }
+ // })
+ // },
+ // getExternalPartCustomerList(){
+ // let params = {
+ // partNo: this.currentPart.partNo,
+ // site: this.currentPart.site,
+ // }
+ // getExternalPartCustomerList(params).then(({data})=>{
+ // if (data && data.code === 0){
+ // this.externalPartCustomerList = data.rows;
+ // }else {
+ // this.$message.warning(data.msg)
+ // }
+ // }).catch((error)=>{
+ // this.$message.error(error)
+ // })
+ // },
+ getExternalPartManufacturerList(){
+ let params = {
+ partNo: this.currentPart.partNo,
+ site: this.currentPart.site,
+ }
+ getExternalPartManufacturerList(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.externalPartManufacturerList = data.rows;
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ async convertToBase64(fileUrls) {
+ this.base64List = []
+ for (const fileUrl of fileUrls) {
+ const base64Url = await this.getFileAsBase64(fileUrl);
+ this.base64List.push(base64Url);
+ }
+ },
+ getFileAsBase64(fileUrl) {
+ return new Promise((resolve, reject) => {
+ const img = new Image();
+ img.crossOrigin = 'Anonymous';
+ img.src = fileUrl;
+ img.onload = () => {
+ const canvas = document.createElement('canvas');
+ const ctx = canvas.getContext('2d');
+ canvas.width = img.width;
+ canvas.height = img.height;
+ ctx.drawImage(img, 0, 0);
+ const base64data = canvas.toDataURL('image/jpeg');
+ resolve(base64data);
+ };
+ img.onerror = (error) => {
+ reject(error);
+ };
+ });
+ },
+ async getTableUserColumn (tableId, columnId) {
+ let queryTableUser = {
+ userId: this.$store.state.user.name,
+ functionId: this.$route.meta.menuId,
+ tableId: tableId,
+ status: true,
+ languageCode: this.$i18n.locale
+ }
+ await getTableUserListLanguage(queryTableUser).then(({data}) => {
+ if (data.rows.length > 0) {
+ this.caseTable(data.rows,columnId)
+ } else {
+ this.getColumnList(tableId, columnId)
+ }
+ })
+ },
+
+// 获取 tableDefault 列
+ async getColumnList (tableId, columnId) {
+ let queryTable = {
+ functionId: this.$route.meta.menuId,
+ tableId: tableId,
+ languageCode: this.$i18n.locale
+ }
+ await getTableDefaultListLanguage(queryTable).then(({data}) => {
+ if (!data.rows.length === 0) {
+ this.caseTable(data.rows,columnId)
+ } else {
+
+ }
+ })
+ },
+ caseTable(list,columnId){
+ if (list.length > 0){
+ switch (columnId) {
+ case 1:
+ this.columnList = list
+ break;
+ case 2:
+ this.pictureColumnList = list
+ break;
+ case 3:
+ this.customerColumnList = list
+ break;
+ case 4:
+ this.manufacturerColumnList = list
+ break;
+ }
+ }
+ },
+ qtyPerCarton(){
+ return new Decimal(this.savePart.qtyPerRoll).mul(this.savePart.rollsPerCarton).toNumber();
+ },
+ getCategoryList(){
+ let params = {};
+ getCategoryList(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.partCategoryList = data.rows;
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ changeQtyRollCarton(){
+ this.savePart.qtyPerRoll = this.savePart.qtyPerCarton;
+ },
+ getCountryList(){
+ let params = {
+
+ }
+ countryList(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.countryList = data.rows
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ getUserSiteDefaultCountry(){
+ let params = this.$store.state.user.site
+ getSiteDetail(params).then(({data})=>{
+ if (data && data.code === 0){
+ if (data.row && data.row.defaultCountry){
+ this.defaultCountry = data.row.defaultCountry
+ }
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ handleSelectExternalPartAndCustomerPage(){
+ let params = {
+ ...this.part,
+ site: this.$store.state.user.site,
+ no:this.no,
+ size:this.size,
+ }
+ selectExternalPartAndCustomerPage(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.partList = data.rows;
+ if (this.partList.length > 0 && !this.ofComponents){
+ this.currentPart = {...this.partList[0]}
+ }
+ this.total = data.total;
+ this.getExternalPartManufacturerList();
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ handleSizeChange(val){
+ this.size = val;
+ this.handleSelectExternalPartAndCustomerPage();
+ },
+ handleCurrentChange(val){
+ this.no = val;
+ this.handleSelectExternalPartAndCustomerPage();
+ },
+ changeCategory(val){
+ const category = this.partCategoryList.find((item)=>item.categoryValue === val);
+ if (category){
+ this.savePart.manufacturerRequired = category.manufacturerRequired;
+ this.savePart.moldCodeRequired = category.moldCodeRequired;
+ this.savePart.serialNumberRequired = category.serialNumberRequired;
+ this.savePart.rollLabelRequired = category.rollLabelRequired;
+ if (this.savePart.serialNumberRequired === 'Y'){
+ this.savePart.qtyPerRoll = 1;
+ this.savePart.rollsPerCarton = 1;
+ }
+ if (category.showCartonQtyPerRoll === 'N'){
+ this.savePart.qtyPerRoll = 1;
+ }
+ if (category.showCartonRollsPerCarton === 'N'){
+ this.savePart.rollsPerCarton = 1;
+ }
+ this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
+ this.savePart.qtyPerCarton = this.qtyPerCarton();
+ this.category = JSON.parse(JSON.stringify(category))
+ }
+ },
+ /**
+ * 当前值发生变化的时候修改
+ * @param row
+ * @param oldRow
+ */
+ changeCurrentRow (row, oldRow) {
+ // 判断是否是获取焦点的事件
+ if (row) {
+ this.currentPart = JSON.parse(JSON.stringify(row))
+ this.getExternalPartManufacturerList();
+ }
+ },
+
+ toMes (row) {
+ this.$router.push({ path: 'part-external', query: { site: row.site , partNo:row.partNo}})
+ },
+ },
+ computed:{
+
+ },
+ created () {
+ this.selectUnitList();
+ this.getCategoryList();
+ // this.getCountryList();
+ // this.selectExternalPartList();
+ this.handleSelectExternalPartAndCustomerPage();
+ this.getUserSiteDefaultCountry();
+ this.getTableUserColumn("10004Table", 1)
+ this.getTableUserColumn("10004Table2", 2)
+ this.getTableUserColumn("10004Table3", 3)
+ this.getTableUserColumn("10004Table4", 4)
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Query
+
+
+
+
+
+
+ Part Info
+
+
+
+
+ {{ scope.row[item.columnProp] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
diff --git a/src/views/modules/part/partManufacturer.vue b/src/views/modules/part/partManufacturer.vue
new file mode 100644
index 0000000..16adc1b
--- /dev/null
+++ b/src/views/modules/part/partManufacturer.vue
@@ -0,0 +1,1114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Query
+
+
+
+
+
+
+ Part Info
+
+
+
+
+ {{ scope.row[item.columnProp] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+