From f294efb8c01ad8b0704a92d51c14dbd55d898874 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:46 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)
---
src/views/business/materialOrder/customsInspectionOrder.vue | 133 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 123 insertions(+), 10 deletions(-)
diff --git a/src/views/business/materialOrder/customsInspectionOrder.vue b/src/views/business/materialOrder/customsInspectionOrder.vue
index 19f35a8..dfc8f5f 100644
--- a/src/views/business/materialOrder/customsInspectionOrder.vue
+++ b/src/views/business/materialOrder/customsInspectionOrder.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
- <div>
+ <div v-show="!cableConfigShow&&!auxiliaryShow">
<div class="header">
<div>
<span>閲囪喘璁㈠崟淇℃伅</span>
@@ -24,6 +24,8 @@
<el-button v-show="active==1" size="small" @click="templateDia=true">
<span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
</el-button>
+ <el-button v-if="active==1&&addObj.sample!=undefined&&(addObj.sample.indexOf('鐢电紗')>-1 ||addObj.sample.indexOf('缁煎悎')>-1)" size="small" type="primary" @click="openCableConfig">鐢电紗閰嶇疆</el-button>
+ <el-button v-if="active==1&&addObj.sample!=undefined&&addObj.sample.indexOf('鐢电紗')>-1" size="small" type="primary" @click="openAuxiliaryCore">杈呭姪绾胯姱閰嶇疆</el-button>
<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">
@@ -32,7 +34,7 @@
</div>
</div>
</div>
- <div class="search">
+ <div class="search" v-show="!cableConfigShow&&!auxiliaryShow">
<el-form ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="90px">
<el-row>
<el-col :span="6">
@@ -145,7 +147,7 @@
</el-row>
</el-form>
</div>
- <div>
+ <div v-show="!cableConfigShow&&!auxiliaryShow">
<div style="display: flex;justify-content: space-between;background-color: #F5F7FB;margin-bottom: 6px">
<div v-if="active==1">
<el-form :inline="true" :model="addObj1" label-width="90px">
@@ -325,7 +327,7 @@
<el-table-column :filter-method="filterHandler" :filters="filters" label="瀛愬疄楠屽" min-width="130" prop="sonLaboratory"
show-overflow-tooltip></el-table-column>
</el-table>
- </div>
+ </div >
<!--鐗规畩鍊煎鐞嗘-->
<el-dialog :before-close="beforeClose" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
:visible.sync="bsm1DiaAll"
@@ -433,6 +435,10 @@
<el-button :loading="noNeedCheckLoad" type="primary" @click="handleNoNeedCheck">纭� 瀹�</el-button>
</span>
</el-dialog>
+ <!--鐢电紗閰嶇疆-->
+ <cableConfig v-if="cableConfigShow" ref="cableConfigShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd="goBackAdd"/>
+ <!--杈呭姪绾胯姱閰嶇疆-->
+ <auxiliary-wire-core v-if="auxiliaryShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd2="goBackAdd2"></auxiliary-wire-core>
</div>
</template>
@@ -444,22 +450,30 @@
delRawMaterOrderTemplate,
getInsOrder,
getUserNow,
- notificationRawOrder, selectRawMaterOrderTemplate,
+ notificationRawOrder,
+ selectRawMaterOrderTemplate,
selectRawMaterOrderTemplateById,
selectsStandardMethodByFLSSM,
selectStandardMethodEnum,
selectStandardProductList,
selectStandardTreeListByPartNo
} from "@/api/business/rawMaterialOrder";
-
+import {dateFormat} from "@/utils/date";
+import AuxiliaryWireCore from "../productOrder/components/auxiliaryWireCore.vue";
+import cableConfig from "../productOrder/components/cable-config.vue";
export default {
name: "CustomsInspectionOrder",
dicts: ['check_type', 'urgency_level'],
- components: {},
+ components: {cableConfig, AuxiliaryWireCore},
props: {
},
data() {
return {
+ cableConfigShow: false,
+ auxiliaryShow: false,
+ isSpecial: false,
+ sampleSelectionList: [],//鏍峰搧琛ㄦ牸閫変腑鏁版嵁
+ isOutsourcing: 'f',//鏄惁澶栬喘鎴愬搧
customsInspection: {},
orderType: '',
active: 0,
@@ -614,6 +628,17 @@
// this.addObj.method = null
// this.productList = []
// },
+ isOutsourcing:{
+ deep: true,
+ handler(newVal){
+ if(newVal && newVal==='t'){
+ this.addObj.appointed = dateFormat(new Date(),'yyyy-MM-dd')
+ this.addObj.testQuantity = this.customsInspection.qtyArrived
+ this.addObj.orderType = '杩涘巶妫�楠�'
+ this.addObj.typeSource = 0
+ }
+ }
+ },
productList: {
deep: true,
handler(val) {
@@ -643,6 +668,7 @@
created() {
this.active = this.$route.query.active
this.orderType = this.$route.query.orderType
+ this.isOutsourcing = this.$route.query.isOutsourcing
this.currentId = this.$route.query.currentId
this.isReport = this.$route.query.isReport
this.customsInspection = this.$route.query.customsInspection
@@ -651,6 +677,7 @@
activated() {
this.active = this.$route.query.active
this.orderType = this.$route.query.orderType
+ this.isOutsourcing = this.$route.query.isOutsourcing
this.currentId = this.$route.query.currentId
this.isReport = this.$route.query.isReport
this.customsInspection = this.$route.query.customsInspection
@@ -660,6 +687,82 @@
// this.getInfo() // 鑾峰彇鏁版嵁
// },
methods: {
+ goBackAdd () {
+ this.cableConfigShow = false
+ },
+ goBackAdd2 () {
+ this.auxiliaryShow = false
+ },
+ // 缂栬緫瑕佹眰鍊艰〃鏍�
+ editSpecial () {
+ this.isSpecial = true
+ this.$nextTick(() => {
+ this.$refs.productTable.doLayout();
+ });
+ },
+ areObjectsValuesEqual (objects, property) {
+ if (!objects || objects.length === 0) return false;
+ const firstValue = objects[0][property];
+ return objects.every(obj => obj[property] === firstValue);
+ },
+ // 杈呭姪绾胯姱閰嶇疆
+ openAuxiliaryCore () {
+ if (this.active == 1) {
+ if (this.sampleIds.length === 0) {
+ this.$message.error("鏈�夋嫨鏍峰搧")
+ } else if (this.sampleIds.length === 1) {
+ if (!this.sampleSelectionList[0].standardMethodListId) {
+ this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+ return
+ }
+ this.auxiliaryShow = true
+ } else {
+ // 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
+ if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+ this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+ } else {
+ if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
+ this.$message.error("璇烽�夋嫨鐩稿悓鐨勬楠屾爣鍑�")
+ return
+ }
+ this.auxiliaryShow = true
+ }
+ }
+ } else {
+ if (this.sampleId === null) {
+ this.$message.error('鏈�変腑鏍峰搧')
+ }
+ }
+ },
+ //鎵撳紑鐢电紗閰嶇疆寮规
+ openCableConfig() {
+ if (this.active == 1) {
+ if (this.sampleIds.length === 0) {
+ this.$message.error("鏈�夋嫨鏍峰搧")
+ } else if (this.sampleIds.length === 1) {
+ if (!this.sampleSelectionList[0].standardMethodListId) {
+ this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+ return
+ }
+ this.cableConfigShow = true
+ } else {
+ // 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
+ if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+ this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+ } else {
+ if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
+ this.$message.error("璇烽�夋嫨鐩稿悓鐨勬楠屾爣鍑�")
+ return
+ }
+ this.cableConfigShow = true
+ }
+ }
+ } else {
+ if (this.sampleId === null) {
+ this.$message.error('鏈�変腑鏍峰搧')
+ }
+ }
+ },
save1 () {
if (this.bsm1DiaList.length > 0) {
this.bsm1DiaList.forEach(item => {
@@ -747,7 +850,7 @@
})
}
})
- } else {
+ } else{
notificationRawOrder({ifsInventoryId:this.customsInspection.id}).then(res => {
if (res.code === 200) {
if (res.data === 1) {
@@ -771,7 +874,9 @@
this.$set(this.addObj, 'receiverDate', this.customsInspection.receiverDate)
this.$set(this.addObj, 'orderNo', this.customsInspection.orderNo)
this.$set(this.addObj, 'declareUser', this.customsInspection.declareUser)
- this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
+ if(this.isOutsourcing==='f'){
+ this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
+ }
this.$set(this.addObj, 'buyUnitMeas', this.customsInspection.buyUnitMeas)
this.$set(this.addObj, 'updateBatchNo', this.customsInspection.updateBatchNo)
this.$set(this.addObj, 'partDetail', this.customsInspection.partDesc)
@@ -1442,6 +1547,9 @@
})
},
getProNum() {
+ this.sampleSelectionList.forEach((m, i) => {
+ this.$set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
+ })
this.$refs.sampleTable.doLayout()
},
methodFocus() {
@@ -1511,6 +1619,7 @@
val.forEach(a => {
this.sampleIds.push(a.id)
})
+ this.sampleSelectionList = val
},
// 閫変腑琛ㄦ牸琛岀殑鍥炶皟
rowClick(row, column, event) {
@@ -1524,7 +1633,11 @@
this.sampleId = row.id
if (this.active !== 1) {
this.sampleIds = []
- this.sampleIds.push(row.id)
+ this.sampleSelectionList.forEach(ele=>{
+ if(ele.id == row.id){
+ this.sampleIds.push(row.id)
+ }
+ })
}
// this.productList = row.insProduct
if (this.productList !== null) {
--
Gitblit v1.9.3