From 248d9f8b01d9a395af66f2336cb0b1eeeff2bd0a Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 19 二月 2025 10:10:03 +0800 Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev --- src/views/business/materialOrder/customsInspection.vue | 323 ++++++++++++----------------------------------------- 1 files changed, 75 insertions(+), 248 deletions(-) diff --git a/src/views/business/materialOrder/customsInspection.vue b/src/views/business/materialOrder/customsInspection.vue index 8b85f92..63eb53f 100644 --- a/src/views/business/materialOrder/customsInspection.vue +++ b/src/views/business/materialOrder/customsInspection.vue @@ -1,35 +1,35 @@ <template> - <div class="ins_order_add"> + <div class="app-container"> <div> - <el-row class="title"> - <el-col :span="active > 1 && isShowTab ? 5 : 6" style="padding-left: 20px;text-align: left;">閲囪喘璁㈠崟淇℃伅</el-col> - <el-col v-if="active > 1 && isShowTab" :span="4" style="text-align: left;margin-top: 12px"> - <ul class="tab"> + <div class="header"> + <div> + <span>閲囪喘璁㈠崟淇℃伅</span> + <ul class="tab" v-if="active > 1 && isShowTab"> <li v-for="(m,i) in dataTitle" :key="i" :class="{active:i===dataIndex}" @click="handleDataTab(m,i)">{{m.label}}</li> </ul> - </el-col> - <el-col :span="active > 1 && isShowTab ? 15 : 18" style="text-align: right;"> - <el-select v-show="active==1" v-model="template" placeholder="涓嬪崟妯℃澘" size="medium" style="margin-right: 10px;" - @change="selectInsOrderTemplateById"> + </div> + <div> + <el-select v-show="active==1" v-model="template" placeholder="涓嬪崟妯℃澘" size="small" style="margin-right: 10px;" + @change="selectInsOrderTemplateByIdList"> <el-option v-for="(a, ai) in templates" :key="ai" :label="a.name" :value="a.id"> <span style="float: left">{{ a.name }}</span> <i class="el-icon-delete" style="float: right; color: #66b1ff; font-size: 16px" @click.stop="handleDelete(a)"></i> </el-option> </el-select> - <el-button v-show="active==1" size="medium" @click="templateDia=true"> + <el-button v-show="active==1" size="small" @click="templateDia=true"> <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span> </el-button> - <el-button v-show="active==1 && addObj.orderType === '杩涘巶妫�楠�'" :loading="noNeedCheckLoad" size="medium" type="primary" @click="noNeedCheck">鍏嶆</el-button> - <el-button v-show="active==1" :loading="saveLoad" size="medium" type="primary" @click="save">鎻愪氦</el-button> - <el-button size="medium" @click="goBack"> + <el-button v-show="active==1 && addObj.orderType === '杩涘巶妫�楠�'" :loading="noNeedCheckLoad" size="small" type="primary" @click="noNeedCheck">鍏嶆</el-button> + <el-button v-show="active==1" :loading="saveLoad" size="small" type="primary" @click="save">鎻愪氦</el-button> + <el-button size="small" @click="goBack"> <span style="color: #3A7BFA;">杩斿洖</span> </el-button> - </el-col> - </el-row> + </div> + </div> </div> <div class="search"> - <el-form ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="120px"> + <el-form ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="90px"> <el-row> <el-col :span="6"> <el-form-item class="addObj-form-item" label="閲囪喘璁㈠崟鍙�:"> @@ -85,7 +85,7 @@ <el-row> <el-col :span="6"> <el-form-item class="addObj-form-item" label="鍗曚綅:" prop="buyUnitMeas"> - <el-input v-model="addObj.buyUnitMeas" class="addObj-info" disabled size="small"></el-input> + <el-input v-model="addObj.buyUnitMeas" class="addObj-info" clearable disabled size="small"></el-input> </el-form-item> </el-col> <el-col :span="6"> @@ -98,14 +98,14 @@ <el-col :span="6"> <el-form-item class="addObj-form-item" label="妫�楠岀被鍒�:" prop="orderType"> <el-select v-model="addObj.orderType" :disabled="active>1 || orderType===1" clearable size="small" style="width: 100%"> - <el-option v-for="(a, ai) in checkType" :key="ai" :label="a.label" :value="a.value"></el-option> + <el-option v-for="(a, ai) in dict.type.check_type" :key="ai" :label="a.label" :value="a.value"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="6"> <el-form-item class="addObj-form-item" label="瑙勬牸鍨嬪彿:" placeholder="璇峰~鍐�" prop="partDetail"> <el-tooltip :content="addObj.partDetail" :disabled="!addObj.partDetail"> - <el-input v-model="addObj.partDetail" :disabled="active > 1" class="addObj-info" size="small"></el-input> + <el-input v-model="addObj.partDetail" :disabled="active > 1" clearable class="addObj-info" size="small"></el-input> </el-tooltip> </el-form-item> </el-col> @@ -114,7 +114,7 @@ <el-col :span="6"> <el-form-item class="addObj-form-item" label="绱ф�ョ▼搴�:" placeholder="璇烽�夋嫨" prop="type"> <el-select v-model="addObj.type" :disabled="active>1" class="addObj-info" clearable size="small" style="width: 100%"> - <el-option v-for="(a, ai) in types" :key="ai" :label="a.label" :value="a.value"></el-option> + <el-option v-for="(a, ai) in dict.type.urgency_level" :key="ai" :label="a.label" :value="a.value"></el-option> </el-select> </el-form-item> </el-col> @@ -142,11 +142,10 @@ </el-form> </div> <div> - <div style="display: flex;flex-direction: row;justify-content: space-between;padding: 5px 0;"> - <div v-if="active==1" style="display: flex;background: transparent;"> - <div class="search_thing"> - <div class="search_label">鏍峰搧鍨嬪彿锛�</div> - <div class="search_input"> + <div style="display: flex;justify-content: space-between;"> + <div v-if="active==1"> + <el-form :inline="true" :model="addObj1" label-width="90px"> + <el-form-item label="鏍峰搧鍨嬪彿:" style="margin-bottom: 6px"> <el-select v-model="model" :placeholder="active>1 ? '' : '璇疯緭鍏�'" allow-create clearable default-first-option filterable size="small" @@ -154,29 +153,26 @@ <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> - </div> - </div> - <div class="search_thing"> - <div class="search_label">妫�楠屾爣鍑嗭細</div> - <div class="search_input"> + </el-form-item> + <el-form-item label="妫�楠屾爣鍑�:"> <el-select v-model="standardMethodListId" :loading="methodLoad" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable size="small" @change="changeStandardMethodListId" @focus="methodFocus"> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> - </div> - </div> + </el-form-item> + </el-form> </div> - <div class="search_thing"> - <el-button v-show="active==1" :disabled="sampleList.length === 2" size="medium" type="primary" @click="handleSplitCountNum">鎷嗗垎</el-button> + <div style="margin-top: 3px"> + <el-button v-show="active==1" :disabled="sampleList.length === 2" size="small" type="primary" @click="handleSplitCountNum">鎷嗗垎</el-button> </div> </div> <el-table ref="sampleTable" :data="sampleList" - border class="el-table sampleTable" + class="el-table sampleTable" highlight-current-row - max-height="400px" style="margin-top: 10px;" + max-height="400px" tooltip-effect="dark" @selection-change="selectSample" @row-click="rowClick"> <el-table-column v-if="active==1" :selectable="selectable" type="selection" width="65"></el-table-column> @@ -247,7 +243,7 @@ </el-table-column> </el-table> <el-table ref="productTable" v-loading="getProductLoad" :data="productList" - :row-class-name="tableRowClassName" border + :row-class-name="tableRowClassName" class="el-table" max-height="400px" style="margin-bottom: 10px;" @@ -392,7 +388,7 @@ width="32%"> <span>{{ dialogMessage }}</span> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="$parent.playOrder(0)">纭� 瀹�</el-button> + <el-button type="primary" @click="goBack()">纭� 瀹�</el-button> </span> </el-dialog> <el-dialog @@ -436,26 +432,23 @@ <script> import ValueTable from "@/components/Table/value-table.vue"; +import { + addInsOrder, + addRawMaterOrderTemplate, delRawMaterOrderTemplate, + getInsOrder, + getUserNow, + notificationRawOrder, selectRawMaterOrderTemplateById, selectStandardMethodEnum, selectStandardProductList, + selectStandardTreeListByPartNo +} from "@/api/business/rawMaterialOrder"; export default { name: "CustomsInspection", + dicts: ['check_type', 'urgency_level'], components: { ValueTable, }, props: { - active: { - type: Number, - default: () => 0 - }, - customsInspection: { - type: Object, - default: () => {} - }, currentId: { - type: Number, - default: () => 0 - }, - orderType: { type: Number, default: () => 0 }, @@ -466,6 +459,9 @@ }, data() { return { + customsInspection: {}, + orderType: '', + active: 0, editTable:[], // 鍖洪棿鐗规畩鍊煎~鍐� template: null, saveLoad: false, // 淇濆瓨鎸夐挳loading @@ -513,7 +509,7 @@ { required: true, message: '璇峰~鍐欐娊妫�鏁伴噺', trigger: 'blur' } ], partDetail: [ - { required: true, message: '璇峰~鍐欓浂浠舵弿杩�', trigger: 'blur' } + { required: true, message: '璇峰~鍐欒鏍煎瀷鍙�', trigger: 'blur' } ], orderType: [ { required: true, message: '璇烽�夋嫨妫�楠岀被鍒�', trigger: 'change' } @@ -556,6 +552,7 @@ sampleId: null, // total: 0, totalArr: [], + addObj1: {}, model: null, standardMethodListId: null, inspectionItem:null, @@ -612,7 +609,6 @@ watch: { sampleList() { this.addObj.method = null - // this.productList = [] }, productList: { deep: true, @@ -641,11 +637,13 @@ } }, mounted() { - this.getUserNow() // 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 - this.selectCheckType() // 鏌ヨ妫�楠岀被鍨� + this.active = this.$route.query.active + this.orderType = this.$route.query.orderType + this.customsInspection = this.$route.query.customsInspection + // this.getUserNowList() // 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 this.selectStandardMethods() // 鑾峰彇妫�楠屾爣鍑嗕笅鎷夋鏁版嵁 - this.selectEnumByCategoryForType() // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋 this.getInfo() // 鑾峰彇鏁版嵁 + }, methods: { save1 () { @@ -704,7 +702,7 @@ } // 鏌ョ湅 // 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹� - this.$axios.post(this.$api.insOrder.getInsOrder, { + getInsOrder({ orderId: orderId }).then(res => { if (res.code === 200) { @@ -734,7 +732,7 @@ } }) } else { - this.$axios.get(this.$api.rawMaterialOrder.notificationRawOrder+'?ifsInventoryId='+this.customsInspection.id).then(res => { + notificationRawOrder({ifsInventoryId:this.customsInspection.id}).then(res => { if (res.code === 200) { if (res.data === 1) { this.dialogVisible2 = true @@ -746,7 +744,7 @@ } }) // 鎶ユ娴佺▼ - this.$axios.get(this.$api.materialInspection.selectStandardTreeListByPartNo+'?partNo='+this.customsInspection.partNo).then(res => { + selectStandardTreeListByPartNo({partNo:this.customsInspection.partNo}).then(res => { if (res.code === 200) { this.addObj.sample = res.data.label this.codeLevel = res.data.code @@ -767,19 +765,16 @@ this.selectTree = str.join(' - ') this.addListInfo(this.codeLevel, res.data) // 鍘熸潗鏂欐牱鍝佹槸鍥哄畾鐨勶紝灏遍粯璁よ祴鍊间竴鏉℃暟鎹紝鍙媶鍒� this.selectInsOrderTemplate() // 鍘熸潗鏂欐ā鏉垮垪琛ㄦ煡璇� - } else { - this.dialogVisible = true - this.dialogMessage = res.message } }).catch(err => { - console.log('err---', err) + this.dialogVisible = true + this.dialogMessage = err.message }) } }, // 鏌ヨ妯℃澘-鍙嶆樉妯℃澘 - selectInsOrderTemplateById(e) { - this.$axios.get(this.$api.materialInspection.selectRawMaterOrderTemplateById + '?id=' + e).then(res => { - if (res.code == 201) return + selectInsOrderTemplateByIdList(e) { + selectRawMaterOrderTemplateById({id: e}).then(res => { let obj = JSON.parse(res.data) this.sampleList = obj.sampleList; this.productList = obj.sampleList[0].insProduct @@ -795,7 +790,7 @@ item.insProduct = this.productList }) this.templateLoading = true; - this.$axios.post(this.$api.materialInspection.addRawMaterOrderTemplate, { + addRawMaterOrderTemplate({ partNo: this.addObj.partNo, name: this.templateName, thing: JSON.stringify({ @@ -803,12 +798,7 @@ sampleList: sampleList, selectTree:this.selectTree }) - }, { - headers: { - 'Content-Type': 'application/json' - } }).then(res => { - if (res.code == 201) return this.templateLoading = false; this.templateDia = false; this.$message.success('淇濆瓨鎴愬姛') @@ -826,12 +816,7 @@ cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - this.$axios.post(this.$api.materialInspection.delRawMaterOrderTemplate, { - id: row.id - }).then(res => { - if (res.code === 201) { - return - } + delRawMaterOrderTemplate({id: row.id}).then(res => { this.$message.success('鍒犻櫎鎴愬姛') this.selectInsOrderTemplate() }).catch(e => { @@ -841,8 +826,7 @@ }, // 鏌ヨ妯℃澘鍒楄〃 selectInsOrderTemplate() { - this.$axios.get(this.$api.materialInspection.selectRawMaterOrderTemplate+'?partNo='+this.addObj.partNo).then(res => { - if (res.code == 201) return + selectStandardTreeListByPartNo({partNo:this.addObj.partNo}).then(res => { this.templates = res.data }) }, @@ -1013,7 +997,7 @@ this.addObj.model = (trees[4] == undefined ? null : trees[4]) this.addObj.ifsInventoryId = this.customsInspection.id this.noNeedCheckLoad = true - this.$axios.post(this.$api.rawMaterialOrder.addExemptionOrder, { + addExemptionOrder({ str: JSON.stringify({ insOrder: this.addObj, list: JSON.stringify(sampleList.map(a => { @@ -1041,7 +1025,7 @@ if (res.code == 201) return this.noNeedCheckDia = false this.$message.success('宸叉彁浜�') - this.$parent.playOrder(0) + this.goBack() }).catch(e=>{ this.noNeedCheckLoad = false }) @@ -1064,7 +1048,7 @@ this.addObj.model = (trees[4] == undefined ? null : trees[4]) this.addObj.ifsInventoryId = this.customsInspection.id this.saveLoad = true - this.$axios.post(this.$api.insOrder.addInsOrder, { + addInsOrder({ str: JSON.stringify({ insOrder: this.addObj, list: JSON.stringify(sampleList.map(a => { @@ -1092,7 +1076,7 @@ if (res.code == 201) return this.$message.success('宸叉彁浜�') this.bsm3Dia = false; - this.$parent.playOrder(0) + this.goBack() }).catch(e=>{ this.saveLoad = false }) @@ -1427,16 +1411,9 @@ } }) }, - selectCheckType() { - this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "妫�楠岀被鍨�" - }).then(res => { - this.checkType = res.data - }) - }, // 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 - getUserNow() { - this.$axios.get(this.$api.user.getUserNow).then(res => { + getUserNowList() { + getUserNow().then(res => { let selects = res.data if (selects == null) return this.addObj.userId = selects.id @@ -1447,7 +1424,7 @@ }, // 鑾峰彇妫�楠屾爣鍑嗕笅鎷夋鏁版嵁 selectStandardMethods() { - this.$axios.get(this.$api.standardTree.selectStandardMethodEnum).then(res => { + selectStandardMethodEnum().then(res => { this.methods = res.data }) }, @@ -1460,7 +1437,7 @@ }, selectsStandardMethodByFLSSM() { this.methodLoad = true - this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { + selectsStandardMethodByFLSSM({ tree: this.selectTree }).then(res => { this.methodLoad = false @@ -1469,7 +1446,7 @@ let arr = this.selectTree.split('-') let arr0 = arr.slice(0, arr.length - 1) let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1) - this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { + selectsStandardMethodByFLSSM({ tree: selectTree }).then(ress => { this.methods = ress.data.standardMethodList @@ -1609,17 +1586,13 @@ this.getProductLoad = true let selectTreeList = this.selectTree.split(" - ") this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model) - this.$axios.post(this.$api.standardTree.selectStandardProductList, { + selectStandardProductList({ model: this.addObj.model?this.addObj.model:row.model, modelNum: row.modelNum, standardMethodListId: val, factory: selectTreeList.join(" - "), partNo: this.addObj.partNo, ifsInventoryId: this.customsInspection.id - }, { - headers: { - 'Content-Type': 'application/json' - } }).then(res => { this.getProductLoad = false if (res.code === 200) { @@ -1675,13 +1648,6 @@ this.selectTree = arr0.join(' - ') + '- ' + e } }, - selectEnumByCategoryForType() { - this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "绱ф�ョ▼搴�" - }).then(res => { - this.types = res.data - }) - }, // 瑕佹眰鍊煎彉鍖栨椂 requestChange(e, row) { this.sampleList.map(item => { @@ -1722,8 +1688,6 @@ p.section = sections[a] p.ask = asks[a] p.tell = tells[a] - // p.manHour = manHours[a] - // p.price = prices[a] } }) break @@ -1751,12 +1715,6 @@ if (row.tell.includes('[')) { this.$set(row, 'tellCopy', row.tell) } - // if (row.manHour.includes('[')) { - // this.$set(row, 'manHourCopy', row.manHour) - // } - // if (row.price.includes('[')) { - // this.$set(row, 'priceCopy', row.price) - // } let arr = this.productList.filter(m=>m.state==1&&row.sectionCopy&&row.sectionCopy.includes(m.sectionCopy)&&m.ask&&m.sectionCopy.indexOf('[')==-1) if (row.bsm === '1' && row.sectionCopy !== '' && row.sectionCopy !== null && row.sectionCopy !== undefined && row.state === 1&&arr.length==0) { if (row.sectionCopy.indexOf('[') > -1) { @@ -1773,14 +1731,10 @@ let section = arr[0].section let arr0 = JSON.parse(row.section) let arr1 = JSON.parse(row.ask) - // let arr2 = JSON.parse(row.manHour) - // let arr3 = JSON.parse(row.price) let arr4 = JSON.parse(row.tell) let index = arr0.indexOf(section) row.section = section row.ask = arr1[index] - // row.manHour = arr2[index] - // row.price = arr3[index] row.tell = arr4[index] } catch(e) {} } @@ -1827,12 +1781,6 @@ if (p.tell.includes('[')) { this.$set(p, 'tellCopy', p.tell) } - // if (p.manHour.includes('[')) { - // this.$set(p, 'manHourCopy', p.manHour) - // } - // if (p.price.includes('[')) { - // this.$set(p, 'priceCopy', p.price) - // } if (p.bsm === '1' && p.sectionCopy !== '' && p.sectionCopy !== null && p.sectionCopy !== undefined && p.state === 1) { if (p.sectionCopy.indexOf('[') > -1) { p.bsmRow = this.HaveJson(p) @@ -1901,131 +1849,10 @@ </script> <style scoped> -.addObj-form-item { - width: 100%; -} -.ins_order_add { - width: 100%; - height: 100%; - overflow-y: auto; - overflow-x: hidden; -} - -.ins_order_add::-webkit-scrollbar { - width: 0; -} - -.title { - height: 60px; - line-height: 60px; -} - -.search { - width: calc(100% - 40px); - background-color: #fff; - padding: 5px 40px 5px 0; -} - -.search_thing { +.header { display: flex; - align-items: center; - height: 50px; -} - -.search_label { - width: 120px; - font-size: 14px; - text-align: right; -} - -.search_input { - width: calc(100% - 120px); -} - -.node_i { - color: orange; - font-size: 18px; -} - -.el-select-dropdown__item { - display: flex; - align-items: center; justify-content: space-between; -} - -.pairing { - text-align: center; - line-height: 36px; - margin: 3px 0; - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 4px; -} - -.askRts { - width: 100px; - font-size: 12px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 2px solid rgba(0, 0, 0, 0.3); - text-align: center; - background-color: rgba(0, 0, 0, 0.1); - outline: none; - border-radius: 2px; - line-height: 24px; - margin-top: 5px; -} -.circulateTable { - display: flex; - flex-direction: row; - justify-content: space-between; -} -.opticalProject { - width: 38%; -} -.temperatureList { - width: 60%; -} -.temperatureListTitle { - display: flex; - flex-direction: row; - justify-content: space-between; - line-height: 30px; -} ->>> .el-form-item__content { - text-align: left; - width: 65%; -} -.ins_order_add .el-input-group__append, -.el-input-group__prepend { - padding: 0 10px; -} - -.ins_order_add .el-tree-node__content { - height: 32px; - font-size: 14px; - border-radius: 2px; -} - -.ins_order_add .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content { - color: #3A7BFA; -} - -.ins_order_add .has-gutter .el-table__cell .cell { - line-height: 30px; - background-color: #fafafa; -} - -.ins_order_add .has-gutter .el-table__cell { - background-color: #fafafa !important; -} - -.ins_order_add .el-table__row .cell { - font-size: 12px; -} - -.ins_order_add .el-table .warning-row .cell { - color: #3A7BFA; + margin-bottom: 10px; } .tab { list-style-type: none; -- Gitblit v1.9.3