From b0d4df5f39525ae7fe252e8ee65d85fd71dca721 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 07 五月 2026 14:53:32 +0800
Subject: [PATCH] 手动下单:检验中订单撤销报错问题修复
---
src/views/business/productOrder/components/addOrder.vue | 133 ++++++++++++++++++++++++++++++++++---------
1 files changed, 104 insertions(+), 29 deletions(-)
diff --git a/src/views/business/productOrder/components/addOrder.vue b/src/views/business/productOrder/components/addOrder.vue
index 6863580..0993355 100644
--- a/src/views/business/productOrder/components/addOrder.vue
+++ b/src/views/business/productOrder/components/addOrder.vue
@@ -74,6 +74,40 @@
</el-row>
<el-row>
<el-col :span="6">
+ <el-form-item label="IFS鍩�:" prop="contract">
+ <el-select v-model="addObj.contract" clearable placeholder="璇烽�夋嫨" size="small">
+ <el-option label="ZTNS" value="ZTNS"/>
+ <el-option label="KJNS" value="KJNS"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鎵规鍙�:" prop="updateBatchNo">
+ <el-input v-model="addObj.updateBatchNo" clearable placeholder="璇疯緭鍏ユ壒娆″彿" size="small">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="闆朵欢鍙�" prop="partNo">
+ <el-input v-model="addObj.partNo" clearable placeholder="璇疯緭鍏ラ浂浠跺彿" size="small">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="闆朵欢鎻忚堪:" prop="partDesc">
+ <el-input v-model="addObj.partDesc" clearable placeholder="璇疯緭鍏ラ浂浠舵弿杩�" size="small">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="渚涘簲鍟嗗悕绉�:" prop="supplierName">
+ <el-input v-model="addObj.supplierName" clearable placeholder="璇疯緭鍏ヤ緵搴斿晢鍚嶇О" size="small">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
<el-form-item label="鑱旂郴鏂瑰紡:" prop="phone">
<el-input v-model="addObj.phone" :disabled="active>1&&tabIndex!=4" clearable placeholder="閫夋嫨濮旀墭瀹㈡埛" size="small"></el-input>
</el-form-item>
@@ -93,14 +127,15 @@
</el-input>
</el-form-item>
</el-col>
+
+ </el-row>
+ <el-row>
<el-col :span="6">
<el-form-item label="鏍峰搧鏁伴噺:" prop="sampleNum" style="margin-right: 0">
<el-input-number v-model="addObj.sampleNum" :disabled="active>1" :max="100" :min="1" :precision="0"
size="small" @change="addStandardTree"></el-input-number>
</el-form-item>
</el-col>
- </el-row>
- <el-row>
<el-col :span="6">
<el-form-item label="鏍峰搧鐘舵��:" prop="sampleStatus">
<el-select v-model="addObj.sampleStatus" :disabled="active>1&&tabIndex!=4" size="small">
@@ -120,6 +155,8 @@
</el-select>
</el-form-item>
</el-col>
+ </el-row>
+ <el-row>
<el-col :span="6">
<el-form-item label="鎶ュ憡鍙戦�佹柟寮�:" prop="send">
<el-radio-group v-model="addObj.send" :disabled="active>1&&tabIndex!=4" size="mini">
@@ -128,8 +165,6 @@
</el-radio-group>
</el-form-item>
</el-col>
- </el-row>
- <el-row>
<el-col :span="6">
<el-form-item label="鏍峰搧澶勭悊鏂瑰紡:" prop="processing">
<el-radio-group v-model="addObj.processing" :disabled="active>1&&tabIndex!=4" size="mini" style="display: flex; flex-direction: column;">
@@ -150,6 +185,8 @@
size="small"></el-input>
</el-form-item>
</el-col>
+ </el-row>
+ <el-row>
<el-col :span="6">
<el-form-item label="鏄惁鐣欐牱:" prop="isLeave">
<el-radio-group v-model="addObj.isLeave" border :disabled="active>1&&tabIndex!=4" size="mini">
@@ -158,8 +195,6 @@
</el-radio-group>
</el-form-item>
</el-col>
- </el-row>
- <el-row>
<el-col :span="6">
<el-form-item label="濮旀墭浜�:" prop="prepareUser">
<el-input v-model="addObj.prepareUser" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable size="small"></el-input>
@@ -176,14 +211,14 @@
size="small" style="width: 100%" type="textarea"></el-input>
</el-form-item>
</el-col>
+ </el-row>
+ <el-row>
<el-col :span="6">
<el-form-item label="澶囨敞鑻辨枃:" prop="remarkEn">
<el-input v-model="addObj.remarkEn" :autosize="{ minRows: 2, maxRows: 2}" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable
size="small" type="textarea"></el-input>
</el-form-item>
</el-col>
- </el-row>
- <el-row>
<el-col :span="6">
<el-form-item label="鏍峰搧鍚嶇О:" prop="sampleView">
<el-input v-model="addObj.sampleView" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable
@@ -384,7 +419,7 @@
<el-table-column v-if="isSpecial&&active==1" label="鎿嶄綔" width="100">
<template slot-scope="scope">
<el-button v-if="!scope.row.repetitionTag" size="small" type="text" @click="addProductList(productList,scope.row,scope.$index)">鎻掑叆琛�</el-button>
- <el-button v-if="!!scope.row.repetitionTag&&scope.row.delete" size="small" type="text" @click="deleteProductList(scope.$index,productList)">鍒犻櫎</el-button>
+ <el-button style="color:#ff4949" v-if="!!scope.row.repetitionTag&&scope.row.delete" size="small" type="text" @click="deleteProductList(scope.$index,productList)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -394,7 +429,7 @@
<div v-if="selectUserDia" class="body">
<lims-table :tableData="tableData1" :column="column1"
:isSelection="true" :handleSelectionChange="selectMethod"
- @pagination="pagination1" height="400px" key="tableData1"
+ @pagination="pagination1" :height="400" key="tableData1"
:page="page1" :tableLoading="tableLoading1"></lims-table>
</div>
<span slot="footer" class="dialog-footer">
@@ -601,6 +636,7 @@
import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary";
import limsTable from "@/components/Table/lims-table.vue";
import {selectCustomPageList} from "@/api/system/customer";
+import { bigEval } from "@/utils/bigEval";
import {mapGetters} from "vuex";
import {addQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling";
@@ -626,6 +662,11 @@
templates: [],
addObj: {
entrustCode: null,
+ contract:null,
+ updateBatchNo: null,
+ partDesc: null,
+ partNo: null,
+ supplierName: null,
custom: null,
company: null,
userId: null,
@@ -661,6 +702,9 @@
sampleViewEn: '', // 鏍峰搧鍚嶇О鑻辨枃锛堟姤鍛婂睍绀哄瓧娈碉級
},
addObjRules: { // 琛ㄥ崟鏍¢獙瑙勫垯
+ contract: [
+ { required: true, message: '璇烽�夋嫨IFS鍩�', trigger: 'change' }
+ ],
orderType: [
{ required: true, message: '璇烽�夋嫨妫�楠岀被鍒�', trigger: 'change' }
],
@@ -924,7 +968,6 @@
return m.id === a.id&&!m.repetitionTag
}
})
-
if(obj){
a.state = obj.state
a.section = obj.section
@@ -1033,6 +1076,37 @@
return symbolItem
}
},
+ /**
+ * 鑾峰彇灏忔暟鐨勬渶澶т綅鏁�
+ * @param number 鍨嬪彿鍙傛暟
+ * @param ask 瑕佹眰鍊�
+ * @param calcNum 璁$畻鍊�
+ */
+ getDecimalPlaces(number, ask, calcNum) {
+ console.log("璁$畻灏忔暟鐐�-->", number, ask, calcNum);
+ let count1 = 0;
+ let count2 = 0;
+ const reg = /(\d+\.)(\d+)/g;
+ let matches = [];
+ if (ask) {
+ matches = ask.match(reg);
+ }
+ if (
+ matches &&
+ matches.length > 0 &&
+ matches[0].toString().indexOf(".") > -1
+ ) {
+ count1 = matches[0].toString().split(".")[1].length;
+ }
+ if (number.toString().indexOf(".") > -1) {
+ count2 = number.toString().split(".")[1].length;
+ }
+ if (calcNum.toString().indexOf(".") > -1) {
+ const pointLength2 = calcNum.toString().split(".")[1].length;
+ count2 = count2 > pointLength2 ? count2 : pointLength2;
+ }
+ return count1 > count2 ? count1 : count2;
+ },
handleAsk(ask,symbolItem, value) {
try{
let code = [">", "<", "=", "锛�", "锛�", "鈮�", "鈮�", "卤"];
@@ -1045,7 +1119,13 @@
let index = code.findIndex(b => m.includes(b))
if (index > -1) {
let arr = m.split(code[index]).filter(b => !!b)
- let num = eval(this.replaceAll(arr[0], symbolItem, value))
+ let calcNum = this.$Big(
+ bigEval(this.replaceAll(arr[0], symbolItem, value))
+ );
+ let num = calcNum.toFixed(
+ this.getDecimalPlaces(value, ask, calcNum)
+ );
+ // let num = eval(this.replaceAll(arr[0], symbolItem, value))
m = code[index] + '' + num
arr1.push(m)
}
@@ -1074,7 +1154,13 @@
let index = code.findIndex(b => ask.includes(b))
if (index > -1) {
let arr = ask.split(code[index]).filter(b => !!b)
- let num = eval(this.replaceAll(arr[0], symbolItem, value))
+ let calcNum = this.$Big(
+ bigEval(this.replaceAll(arr[0], symbolItem, value))
+ );
+ let num = calcNum.toFixed(
+ this.getDecimalPlaces(value, ask, calcNum)
+ );
+ // let num = eval(this.replaceAll(arr[0], symbolItem, value))
return code[index] + '' + num
}
}
@@ -1306,7 +1392,7 @@
})
}else{
// 甯歌鎻愪氦
- addInsOrder({insOrder: this.addObj, sampleList: sampleList}).then(res => {
+ addInsOrder({insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList}).then(res => {
this.saveLoad = false
this.$message.success('宸叉彁浜�')
this.bsm3Dia = false;
@@ -1608,10 +1694,10 @@
this.$set(row, 'sectionCopy', row.section)
}
}
- if (row.ask.includes('[')) {
+ if (row.ask && row.ask.includes('[')) {
this.$set(row, 'askCopy', row.ask)
}
- if (row.tell.includes('[')) {
+ if (row.tell && row.tell.includes('[')) {
this.$set(row, 'tellCopy', row.tell)
}
let arr = this.productList.filter(m=>m.state==1&&row.sectionCopy&&row.sectionCopy.includes(m.sectionCopy)&&m.ask&&m.sectionCopy.indexOf('[')==-1)
@@ -1941,18 +2027,12 @@
this.$set(p, 'sectionCopy', p.section)
}
}
- if (p.ask.includes('[')) {
+ if (p.ask && p.ask.includes('[')) {
this.$set(p, 'askCopy', p.ask)
}
- if (p.tell.includes('[')) {
+ if (p.tell && 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)
@@ -1985,11 +2065,6 @@
return item
})
}
- this.productList.forEach(item => {
- if (item.id == row.id) {
- item.state = row.state;
- }
- })
this.changeProductList0()
this.currentMethod.insProduct = this.productList0
this.getProNum()
--
Gitblit v1.9.3