From aa4fd8fa90d045e925136859ec5615d02391c6f7 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期五, 07 六月 2024 02:56:34 +0800
Subject: [PATCH] 实现在线编制; 实现熔接损耗项目
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 181 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 172 insertions(+), 9 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 9b56e5b..827a5b0 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -231,7 +231,7 @@
<el-input clearable v-model="insOrder.appointed" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
</el-form-item>
<el-form-item label="褰撳墠鏍峰搧浣嶆暟:">
- <el-tag v-if="currentSample.index">{{ `NO.${currentSample.index}` }}</el-tag>
+ <el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag>
</el-form-item>
</el-form>
</div>
@@ -304,10 +304,10 @@
<span :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
</template>
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧缂栧彿'">
- <div style="display: flex;flex-wrap: nowrap;align-items: center;">
- <i class="el-icon-caret-left table_caret" @click="caretSample(-1)"></i>
- <div :style="`font-family:${n.v.ff} !important;`">{{currentSample.sampleCode}}</div>
- <i class="el-icon-caret-right table_caret" @click="caretSample(1)"></i>
+ <div style="display: flex;flex-wrap: nowrap;align-items: center;width: 100%" :title="currentSample.sampleCode">
+ <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)"></i>
+ <div :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`">{{currentSample.sampleCode}}</div>
+ <i class="el-icon-caret-right table_caret" style="width: 16px;" @click="caretSample(1)"></i>
</div>
</template>
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧鍨嬪彿'">
@@ -320,6 +320,19 @@
</tbody>
</table>
</div>
+ <el-upload :action="action"
+ :data="{
+ orderId:id
+ }"
+ v-show="state==1"
+ :on-success="handleSuccessUp" :show-file-list="false"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload"
+ :on-error="onError" ref='upload'>
+ <el-button size="small" type="primary" :loading="upLoading">闄勪欢涓婁紶</el-button></el-upload>
+ <ValueTable class="value-table" ref="fileList" :url="$api.insOrderPlan.getFileList"
+ :componentData="componentData0"
+ :delUrl="$api.insOrderPlan.delfile"
+ :key="upIndex" style="height: 100%;margin-top: 16px;"/>
</div>
<el-drawer title="鍏夌氦鍒囨崲" :visible.sync="fiberOpticVisible" :size="500">
<el-table class="el-table" ref="fiberOpticTable" :data="fiberOptic" height="100%" tooltip-effect="dark" border
@@ -422,6 +435,7 @@
<script>
import ValueTable from '../../tool/value-table.vue'
+ import file from '../../../util/file'
export default {
props: ['sonLaboratory', 'orderId', 'state'],
components: {
@@ -457,6 +471,53 @@
insState: {
select: []
},
+ },
+ currentId: '',
+ selectField: {},
+ requiredAdd: [],
+ requiredUp: []
+ },
+ componentData0: {
+ entity: {
+ insOrderId:''
+ },
+ isIndex: true,
+ showSelect: false,
+ select: false,
+ selectMethod: '',
+ sort: false,
+ init:false,
+ do: [
+ {
+ id: 'delete',
+ font: '鍒犻櫎',
+ type: 'text',
+ method: 'doDiy',
+ disabFun: (row, index) => {
+ return this.state!=1
+ }
+ }, {
+ id: 'handleDown',
+ font: '涓嬭浇',
+ type: 'text',
+ method: 'handleDown'
+ },
+ ],
+ isPage: false,
+ linkEvent: {},
+ tagField: {
+ type:{
+ select:[
+ {
+ value: 1,
+ label: '鍥剧墖'
+ },
+ {
+ value: 2,
+ label: '鏂囦欢'
+ }
+ ]
+ }
},
currentId: '',
selectField: {},
@@ -499,8 +560,19 @@
currentFiberOptic:null,//褰撳墠鍏夌氦
currentBushing:null,//褰撳墠濂楃
tableLoading:false,
+ upLoading:false
}
},
+ computed: {
+ headers() {
+ return {
+ 'token': sessionStorage.getItem('token')
+ }
+ },
+ action() {
+ return this.javaApi + this.$api.insOrderPlan.uploadFile
+ }
+ },
created() {
this.componentData.entity.sonLaboratory = this.sonLaboratory;
this.id = this.orderId;
@@ -521,6 +593,8 @@
laboratory: this.sonLaboratory
}).then(async res => {
this.insOrder = res.data.insOrder;
+ this.componentData0.entity.insOrderId = val;
+ this.$refs.fileList.selectList()
this.urgentList.forEach(m => {
if (m.value == this.insOrder.type) {
this.insOrder.typeName = m.label
@@ -1414,20 +1488,67 @@
}
this.addVerifyDia = false
this.submitLoading = true;
- this.$axios.post(this.$api.insOrderPlan.submitPlan, {
+ this.$axios.post(this.$api.insOrderPlan.checkSubmitPlan, {
orderId: this.orderId,
laboratory: this.sonLaboratory,
- verifyUser: this.verifyUser
}).then(res => {
if (res.code === 200) {
- this.$message.success("鎿嶄綔鎴愬姛")
- this.$emit('goback')
+ console.log(res.data)
+ if(!res.data||res.data.length==0){
+ this.$axios.post(this.$api.insOrderPlan.submitPlan, {
+ orderId: this.orderId,
+ laboratory: this.sonLaboratory,
+ verifyUser: this.verifyUser
+ }).then(res => {
+ if (res.code === 200) {
+ this.$message.success("鎿嶄綔鎴愬姛")
+ this.$emit('goback')
+ }
+ this.submitLoading = false;
+ }).catch(error => {
+ console.error(error)
+ this.submitLoading = false;
+ })
+ }else{
+ let newData = []
+ const h = this.$createElement
+ for (let i in res.data) {
+ const lastChar = res.data[i].slice(-1);
+ if(lastChar=='-'){
+ res.data[i] = res.data[i].slice(0, -1);
+ }
+ newData.push(h('p', {style: 'font-size: 12px;'}, (Number(i)+1)+'銆�'+res.data[i]))
+ }
+ newData.push(h('p', { style: 'font-size: 16px;color:#000;margin-top:12px' },'浠ヤ笂椤圭洰涓嶅悎鏍硷紝纭畾鎻愪氦锛�'))
+ this.$confirm('鎻愮ず',{
+ title:'鎻愮ず',
+ message: h('div', null, newData),
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: ""
+ }).then(() => {
+ this.$axios.post(this.$api.insOrderPlan.submitPlan, {
+ orderId: this.orderId,
+ laboratory: this.sonLaboratory,
+ verifyUser: this.verifyUser
+ }).then(res => {
+ if (res.code === 200) {
+ this.$message.success("鎿嶄綔鎴愬姛")
+ this.$emit('goback')
+ }
+ }).catch(error => {
+ console.error(error)
+ })
+ }).catch(() => {})
+ }
+
}
this.submitLoading = false;
}).catch(error => {
console.error(error)
this.submitLoading = false;
})
+ return
},
saveInsContext() {
this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
@@ -1515,6 +1636,48 @@
}
})
this.getTableLists()
+ },
+ handleSuccessUp(response, ) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.$refs.fileList.selectList()
+ }
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ this.upLoading = true;
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ handleDown(row){
+ this.$axios.post(this.$api.insOrderPlan.downFile, {
+ id: row.id,
+ }).then(res => {
+ if (res.code === 200) {
+ let url = '';
+ if(res.data.type==1){
+ url = this.javaApi+'/img/'+res.data.url
+ file.downloadIamge(url,row.fileName)
+ }else{
+ url = this.javaApi+'/word/'+res.data.url
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = row.fileName;
+ link.click();
+ }
+ }
+ }).catch(error => {
+
+ })
}
}
}
--
Gitblit v1.9.3