From a133429e9c1dbe107e34646cdf859eafe166ab34 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 01 八月 2024 16:39:21 +0800
Subject: [PATCH] 班次时间设置修改、多样品切换数据携带等bug更新
---
static/js/worker.js | 2
src/components/view/b1-report-preparation.vue | 17 ++++++--
static/js/worker0.js | 4 +-
src/components/do/b1-inspect-order-plan/Inspection.vue | 31 +++++++++++++--
src/components/view/b3-classes.vue | 38 +++++++++++++++----
5 files changed, 71 insertions(+), 21 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index a87fd58..284db80 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1959,6 +1959,12 @@
})
this.getTableLists0(list)
this.getReportModel(this.currentSample.id)
+ this.worker.postMessage(JSON.stringify({
+ type: 'saveData',
+ tableList:this.tableList,
+ param:this.param,
+ currentTable:this.currentTable
+ }));
}else{
this.tableLists = []
this.tableList = []
@@ -2393,14 +2399,14 @@
try {
let comValue = JSON.parse(a.insProductResult.comValue)
for (var i = 0; i < comValue.length; i++) {
- this.param[a.id].comValue[i].v.v = comValue[i].v
+ this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct)
}
} catch (e) {}
try {
let insValue = JSON.parse(a.insProductResult.insValue)
for (let i = 0; i < insValue.length; i++) {
if(this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r)){
- this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = insValue[i].v
+ this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = this.toFixed(insValue[i].v,this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.ct)
this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).u = insValue[i].u
// this.param[a.id].insValue[i].v.v = insValue[i].v
// this.param[a.id].insValue[i].u = insValue[i].u
@@ -2469,7 +2475,7 @@
}
} catch (e) {}
try {
- this.param[a.id].resValue.v.v = a.lastValue
+ this.param[a.id].resValue.v.v = this.toFixed(a.lastValue,this.param[a.id].resValue.v.ct)
this.param[a.id].insResult.v.v = a.insResult
} catch (e) {}
})
@@ -2675,6 +2681,15 @@
},
getValue(v){
let str = v.v?v.v:(v.v===0?v.v:(v.ct&&v.ct.s?v.ct.s.length>0&&v.ct.s[0].v.replace(new RegExp('\n', 'g'), '<br/>').replace(new RegExp('@', 'g'), '<br/>'):''))
+ if(v.ct&&v.ct.fa&&v.ct.fa.includes('.')&&str){
+ let num = 0
+ let str0 = v.ct.fa.split('.')[1]
+ num = str0.length
+ str = Number(str).toFixed(num)
+ }
+ if(v.v&&typeof v.v == 'string'&&v.v.includes('@')){
+ str = v.v.replace(new RegExp('@', 'g'), '<br/>')
+ }
return str
},
getInspectionValueType(id) {
@@ -3052,6 +3067,12 @@
}
})
this.getTableLists()
+ this.worker.postMessage(JSON.stringify({
+ type: 'saveData',
+ tableList:this.tableList,
+ param:this.param,
+ currentTable:this.currentTable
+ }));
},
caretBushing(num){
let index = this.currentKey0 + num
@@ -3183,12 +3204,12 @@
* @returns 鏍煎紡鍖栧悗鐨勫瓧绗︿覆鎴栧師濮嬫暟鍊硷紙鑻ラ厤缃笉绗﹀悎瑕佹眰锛�
*/
toFixed(v,ct){
- if(v&&ct&&ct.fa&&ct.fa.includes('##')){
+ if(v&&ct&&ct.fa){
if(ct.fa.includes('.')){
let num = ct.fa.slice(4).length
return Number(v).toFixed(num)
}else{
- return Number(v).toFixed(0)
+ return v
}
}else{
return v
diff --git a/src/components/view/b1-report-preparation.vue b/src/components/view/b1-report-preparation.vue
index 93f9d91..64633d0 100644
--- a/src/components/view/b1-report-preparation.vue
+++ b/src/components/view/b1-report-preparation.vue
@@ -86,7 +86,7 @@
</div>
<div class="btns">
<el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">鎵归噺涓嬭浇</el-button>
- <!-- <el-upload
+ <el-upload
class="upload-demo"
:action="action"
:headers="headers"
@@ -97,8 +97,8 @@
:on-success="handleSuccess"
ref="upload"
:on-error="onError">
- <el-button size="small" type="primary">鎵归噺涓婁紶</el-button>
- </el-upload> -->
+ <el-button size="small" type="primary" :loading="inLoading">鎵归噺涓婁紶</el-button>
+ </el-upload>
</div>
</div>
<!-- <input id="input" type="file" accept=".doc,.docx"></input> -->
@@ -320,7 +320,8 @@
currentInfo: null,
option:null,
mutiList:[],
- outLoading:false
+ outLoading:false,
+ inLoading:false
}
},
computed: {
@@ -396,12 +397,18 @@
if (!isZip) {
this.$message.error('涓婁紶鏂囦欢鍙兘鏄� ZIP 鏍煎紡!');
}
+ if(isZip){
+ this.inLoading = true;
+ }
return isZip;
},
handleSuccess(response,){
+ this.inLoading = false;
if (response.code == 200) {
this.$message.success('瀵煎叆鎴愬姛')
- }
+ }else{
+ this.$message.error(response.message)
+ }
},
onError(err, file, fileList,type) {
this.$message.error('涓婁紶澶辫触')
diff --git a/src/components/view/b3-classes.vue b/src/components/view/b3-classes.vue
index 3a2811d..eca7f12 100644
--- a/src/components/view/b3-classes.vue
+++ b/src/components/view/b3-classes.vue
@@ -265,9 +265,9 @@
</div>
<div style="width: calc(100% - 260px);">
<span class="form_label">鏃堕棿锛�</span>
- <span v-if="!item.isEdit"> {{item.time === null ? '' : item.time[0] + '~' + item.time[1]}} </span>
+ <span v-if="!item.isEdit"> {{item.startTime&&item.endTime ? item.startTime + '~' + item.endTime:''}} </span>
<span class="form_input" v-if="item.isEdit">
- <el-time-picker
+ <!-- <el-time-picker
style="width: 200px;"
is-range
size="small"
@@ -278,7 +278,28 @@
start-placeholder="寮�濮嬫椂闂�"
end-placeholder="缁撴潫鏃堕棿"
placeholder="閫夋嫨鏃堕棿鑼冨洿">
- </el-time-picker>
+ </el-time-picker> -->
+ <el-time-select
+ placeholder="璧峰鏃堕棿"
+ v-model="item.startTime"
+ size="small"
+ :picker-options="{
+ start: '00:00',
+ step: '00:15',
+ end: '24:00'
+ }" style="width: 120px;">
+ </el-time-select>
+ <el-time-select
+ style="width: 120px;"
+ placeholder="缁撴潫鏃堕棿"
+ v-model="item.endTime"
+ size="small"
+ :picker-options="{
+ start: '00:00',
+ step: '00:15',
+ end: '24:00'
+ }">
+ </el-time-select>
</span>
</div>
<span>
@@ -695,9 +716,9 @@
if (res.data.length > 0) {
res.data.forEach(item => {
item.isEdit = false
- item.time = []
- item.time.push(item.startTime)
- item.time.push(item.endTime)
+ // item.time = []
+ // item.time.push(item.startTime)
+ // item.time.push(item.endTime)
const index = this.timeTypeList.findIndex(val => val.value === item.shift)
if (index > -1) {
item.type = this.timeTypeList[index].label
@@ -727,6 +748,7 @@
}
}
delete item.orderBy
+ delete item.time
const isEmpty = this.isObjectEmpty(item)
if (isEmpty) {
this.$message.error('璇峰~鍐欏畬鏁�')
@@ -735,8 +757,8 @@
let newObj = {}
let url = ''
newObj.shift = item.shift
- newObj.startTime = item.time[0]
- newObj.endTime = item.time[1]
+ newObj.startTime = item.startTime
+ newObj.endTime = item.endTime
url = this.$api.performanceShift.shiftAdd
if (item.id) {
// 鏈塱d涓轰慨鏀�
diff --git a/static/js/worker.js b/static/js/worker.js
index ba752fe..3d0c8d4 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -348,7 +348,7 @@
let num = 0
let str = a[b].v.ct.fa.split('.')[1]
num = str.length
- a[b].v.v = comResult?Number(comResult).toFixed(num):0
+ a[b].v.v = comResult?Number(comResult).toFixed(num):comResult
}else{
let val = parseFloat(Number(comResult).toFixed(3))
a[b].v.v = isNaN(val) ? comResult : val
diff --git a/static/js/worker0.js b/static/js/worker0.js
index e2481ba..ffff123 100644
--- a/static/js/worker0.js
+++ b/static/js/worker0.js
@@ -46,7 +46,7 @@
if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
let str = n.v.ct.fa.split('.')[1]
num = str.length
- n.v.v = dataAcquisitionInfo[str]?dataAcquisitionInfo[str].toFixed(num):0
+ n.v.v = dataAcquisitionInfo[str]?dataAcquisitionInfo[str].toFixed(num):dataAcquisitionInfo[str]
}else{
n.v.v = dataAcquisitionInfo[str]
}
@@ -66,7 +66,7 @@
if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
let str = n.v.ct.fa.split('.')[1]
num = str.length
- n.v.v = dataAcquisitionInfo[str]?Number(dataAcquisitionInfo[str]).toFixed(num):0
+ n.v.v = dataAcquisitionInfo[str]?Number(dataAcquisitionInfo[str]).toFixed(num):dataAcquisitionInfo[str]
}else{
n.v.v = dataAcquisitionInfo[str]
}
--
Gitblit v1.9.3