From 8edfe5a740151978422bdba16b6b68b20f0706c7 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 24 三月 2025 13:32:29 +0800
Subject: [PATCH] 设备校准计划-新增设备赋值优化
---
src/views/business/materialOrder/customsInspection.vue | 528 ++++++++++++++++++++--------------------------------------
1 files changed, 186 insertions(+), 342 deletions(-)
diff --git a/src/views/business/materialOrder/customsInspection.vue b/src/views/business/materialOrder/customsInspection.vue
index 8b85f92..86ba8bd 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">
@@ -97,15 +97,15 @@
</el-col>
<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-select v-model="addObj.orderType" :disabled="active>1 || orderType==1" clearable size="small" style="width: 100%">
+ <el-option v-for="a in dict.type.check_type" :key="a.value" :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 in dict.type.urgency_level" :key="a.value" :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;background-color: #F5F7FB;margin-bottom: 6px">
+ <div v-if="active==1">
+ <el-form :inline="true" :model="addObj1" label-width="90px">
+ <el-form-item label="鏍峰搧鍨嬪彿:" style="margin-bottom: 6px;margin-top: 6px">
<el-select v-model="model" :placeholder="active>1 ? '' : '璇疯緭鍏�'"
allow-create clearable default-first-option filterable
size="small"
@@ -154,29 +153,27 @@
<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="妫�楠屾爣鍑�:" style="margin-bottom: 6px;margin-top: 6px">
<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-bottom: 6px;margin-top: 6px">
+ <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;"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ 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>
@@ -239,7 +236,7 @@
</el-table-column>
<el-table-column align="center" label="寰呮椤规暟閲�" prop="quantity" width="105">
<template slot-scope="scope">
- <el-select v-model="scope.row.quantity" :disabled="active>1|| scope.$index !== 0 || sampleList.length > 1" clearable
+ <el-select v-model="scope.row.quantity" disabled clearable
size="small">
<el-option v-for="item in quantityList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
@@ -247,10 +244,11 @@
</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;"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
tooltip-effect="dark"
@select="selectOne"
@selection-change="selectProduct"
@@ -358,6 +356,7 @@
</span>
</el-dialog>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
:show-close="false" :visible.sync="bsm3Dia"
title="鍖洪棿鍊煎~鍐�" width="800px">
<el-table :data="editTable" height="80vh" style="width: 100%">
@@ -392,7 +391,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="dialogVisible= false,closeOpenPage()">纭� 瀹�</el-button>
</span>
</el-dialog>
<el-dialog
@@ -435,37 +434,34 @@
</template>
<script>
-import ValueTable from "@/components/Table/value-table.vue";
+import {
+ addExemptionOrder,
+ addInsOrder,
+ addRawMaterOrderTemplate,
+ delRawMaterOrderTemplate,
+ getInsOrder,
+ getUserNow,
+ notificationRawOrder, selectRawMaterOrderTemplate,
+ selectRawMaterOrderTemplateById,
+ selectsStandardMethodByFLSSM,
+ selectStandardMethodEnum,
+ selectStandardProductList,
+ selectStandardTreeListByPartNo
+} from "@/api/business/rawMaterialOrder";
export default {
name: "CustomsInspection",
- components: {
- ValueTable,
- },
+ dicts: ['check_type', 'urgency_level'],
+ components: {},
props: {
- active: {
- type: Number,
- default: () => 0
- },
- customsInspection: {
- type: Object,
- default: () => {}
- },
- currentId: {
- type: Number,
- default: () => 0
- },
- orderType: {
- type: Number,
- default: () => 0
- },
- isReport: {
- type: Number,
- default: () => null
- }
},
data() {
return {
+ customsInspection: {},
+ orderType: '',
+ active: 0,
+ currentId: 0,
+ isReport: '',
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,
@@ -640,13 +636,25 @@
this.standardMethodListId = null
}
},
- mounted() {
- this.getUserNow() // 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅
- this.selectCheckType() // 鏌ヨ妫�楠岀被鍨�
- this.selectStandardMethods() // 鑾峰彇妫�楠屾爣鍑嗕笅鎷夋鏁版嵁
- this.selectEnumByCategoryForType() // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋
- this.getInfo() // 鑾峰彇鏁版嵁
+ created() {
+ this.active = this.$route.query.active
+ this.orderType = this.$route.query.orderType
+ this.currentId = this.$route.query.currentId
+ this.isReport = this.$route.query.isReport
+ this.customsInspection = this.$route.query.customsInspection
+ this.getInfo();
},
+ activated() {
+ this.active = this.$route.query.active
+ this.orderType = this.$route.query.orderType
+ this.currentId = this.$route.query.currentId
+ this.isReport = this.$route.query.isReport
+ this.customsInspection = this.$route.query.customsInspection
+ this.getInfo();
+ },
+ // getInfo() {
+ // this.getInfo() // 鑾峰彇鏁版嵁
+ // },
methods: {
save1 () {
if (this.bsm1DiaList.length > 0) {
@@ -687,7 +695,9 @@
},
// 鑾峰彇鏁版嵁
getInfo () {
- if (this.active === 2) {
+ this.getUserNowList() // 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅
+ this.selectStandardMethods() // 鑾峰彇妫�楠屾爣鍑嗕笅鎷夋鏁版嵁
+ if (this.active == 2) {
let orderId = ''
if (!this.customsInspection.enterOrderId && this.customsInspection.quarterOrderId) {
this.isShowTab = false
@@ -700,11 +710,11 @@
orderId = this.dataIndex === 0 ? this.customsInspection.enterOrderId : this.customsInspection.quarterOrderId
} else if (!this.customsInspection.enterOrderId && !this.customsInspection.quarterOrderId) {
this.isShowTab = false
- orderId = this.isReport === 1 ? this.customsInspection.insOrderId : this.customsInspection.id
+ orderId = this.isReport == 1 ? this.customsInspection.insOrderId : this.customsInspection.id
}
// 鏌ョ湅
// 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
- this.$axios.post(this.$api.insOrder.getInsOrder, {
+ getInsOrder({
orderId: orderId
}).then(res => {
if (res.code === 200) {
@@ -734,11 +744,13 @@
}
})
} 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
- this.dialogMessage2 = '褰撳墠鎵规鐨勬牱鍝佸凡妫�楠岃繃, 鍙互鍏嶆'
+ if (this.orderType != 1) {
+ this.dialogVisible2 = true
+ this.dialogMessage2 = '褰撳墠鎵规鐨勬牱鍝佸凡妫�楠岃繃, 鍙互鍏嶆'
+ }
} else if (res.data === 2) {
this.dialogVisible2 = true
this.dialogMessage2 = '褰撳墠鎵规鐨勬牱鍝佸凡瓒�20鍚�, 闇�瑕佸绾у娆℃楠�'
@@ -746,21 +758,21 @@
}
})
// 鎶ユ娴佺▼
- this.$axios.get(this.$api.materialInspection.selectStandardTreeListByPartNo+'?partNo='+this.customsInspection.partNo).then(res => {
- if (res.code === 200) {
+ selectStandardTreeListByPartNo({partNo:this.customsInspection.partNo}).then(res => {
+ if (res.data !== null) {
this.addObj.sample = res.data.label
this.codeLevel = res.data.code
- this.addObj.qtyArrived = this.customsInspection.qtyArrived
- this.addObj.partNo = this.customsInspection.partNo
- this.addObj.partDetail = this.customsInspection.partDesc
- this.addObj.receiverDate = this.customsInspection.receiverDate
- this.addObj.orderNo = this.customsInspection.orderNo
- this.addObj.declareUser = this.customsInspection.declareUser
- this.addObj.testQuantity = this.customsInspection.testQuantity
- this.addObj.buyUnitMeas = this.customsInspection.buyUnitMeas
- this.addObj.updateBatchNo = this.customsInspection.updateBatchNo
- if (this.orderType === 1) {
- this.addObj.orderType = 'Quarterly inspection'
+ this.$set(this.addObj, 'qtyArrived', this.customsInspection.qtyArrived)
+ this.$set(this.addObj, 'partNo', this.customsInspection.partNo)
+ 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)
+ this.$set(this.addObj, 'buyUnitMeas', this.customsInspection.buyUnitMeas)
+ this.$set(this.addObj, 'updateBatchNo', this.customsInspection.updateBatchNo)
+ this.$set(this.addObj, 'partDetail', this.customsInspection.partDesc)
+ if (this.orderType == 1) {
+ this.$set(this.addObj, 'orderType', 'Quarterly inspection')
}
const str = res.data.treeName.split('-')
this.selectTreeTem = str.join(' - ')
@@ -772,14 +784,13 @@
this.dialogMessage = res.message
}
}).catch(err => {
- console.log('err---', err)
+
})
}
},
// 鏌ヨ妯℃澘-鍙嶆樉妯℃澘
- 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 +806,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 +814,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 +832,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 +842,7 @@
},
// 鏌ヨ妯℃澘鍒楄〃
selectInsOrderTemplate() {
- this.$axios.get(this.$api.materialInspection.selectRawMaterOrderTemplate+'?partNo='+this.addObj.partNo).then(res => {
- if (res.code == 201) return
+ selectRawMaterOrderTemplate({partNo:this.addObj.partNo}).then(res => {
this.templates = res.data
})
},
@@ -911,10 +911,6 @@
if (valid) {
if (!this.sampleList.every(m => m.standardMethodListId)) {
this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�')
- return
- }
- if (!this.sampleList.every(m => m.quantity)) {
- this.$message.error('璇烽�夋嫨寰呮椤规暟閲�')
return
}
const sampleList = this.HaveJson(this.sampleList)
@@ -996,7 +992,6 @@
item.insProduct = this.productList
})
this.getTotal(sampleList)
- const pairing = []
let trees = this.selectTree.split(" - ")
if (trees.length < 3) {
this.$message.error('鏈�夋嫨瀵硅薄')
@@ -1013,41 +1008,36 @@
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, {
- str: JSON.stringify({
- insOrder: this.addObj,
- list: JSON.stringify(sampleList.map(a => {
- if (a.modelNum) {
- // 鏍规嵁x鍙峰垽鏂瀷鍙峰弬鏁颁笌鏍峰搧鍨嬪彿鐨勬嫾鎺ヤ綅缃�
- // 渚嬪脳4锛屽氨涓�500ML脳4锛�4脳锛屽氨涓�4脳500ML
- const index = a.modelNum.indexOf('脳')
- if (index === 0) {
- a.model = a.model + a.modelNum
- } else if (index === -1) {
- a.model = a.model + '-' + a.modelNum
- } else {
- a.model = a.modelNum + a.model
- }
+ addExemptionOrder({
+ insOrder: this.addObj,
+ sampleList: sampleList.map(a => {
+ if (a.modelNum) {
+ // 鏍规嵁x鍙峰垽鏂瀷鍙峰弬鏁颁笌鏍峰搧鍨嬪彿鐨勬嫾鎺ヤ綅缃�
+ // 渚嬪脳4锛屽氨涓�500ML脳4锛�4脳锛屽氨涓�4脳500ML
+ const index = a.modelNum.indexOf('脳')
+ if (index === 0) {
+ a.model = a.model + a.modelNum
+ } else if (index === -1) {
+ a.model = a.model + '-' + a.modelNum
} else {
- a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
+ a.model = a.modelNum + a.model
}
- a.insProduct = a.insProduct.filter(b=>b.state === 1)
- return a
- })),
- pairing: JSON.stringify(pairing)
- })
+ } else {
+ a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
+ }
+ a.insProduct = a.insProduct.filter(b=>b.state === 1)
+ return a
+ }),
}).then(res => {
this.noNeedCheckLoad = false
- if (res.code == 201) return
this.noNeedCheckDia = false
this.$message.success('宸叉彁浜�')
- this.$parent.playOrder(0)
+ this.closeOpenPage()
}).catch(e=>{
this.noNeedCheckLoad = false
})
},
saveMethod(sampleList){
- const pairing = []
let trees = this.selectTree.split(" - ")
if (trees.length < 3) {
this.$message.error('鏈�夋嫨瀵硅薄')
@@ -1064,35 +1054,39 @@
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, {
- str: JSON.stringify({
- insOrder: this.addObj,
- list: JSON.stringify(sampleList.map(a => {
- if (a.modelNum) {
- // 鏍规嵁x鍙峰垽鏂瀷鍙峰弬鏁颁笌鏍峰搧鍨嬪彿鐨勬嫾鎺ヤ綅缃�
- // 渚嬪脳4锛屽氨涓�500ML脳4锛�4脳锛屽氨涓�4脳500ML
- const index = a.modelNum.indexOf('脳')
- if (index === 0) {
- a.model = a.model + a.modelNum
- } else if (index === -1) {
- a.model = a.model + '-' + a.modelNum
- } else {
- a.model = a.modelNum + a.model
- }
+ if (this.addObj.createTime) {
+ delete this.addObj.createTime
+ }
+ addInsOrder({
+ insOrder: this.addObj,
+ sampleList: sampleList.map(a => {
+ if (a.insProduct.length > 0) {
+ a.insProduct.forEach(c => {
+ delete c.id
+ })
+ }
+ if (a.modelNum) {
+ // 鏍规嵁x鍙峰垽鏂瀷鍙峰弬鏁颁笌鏍峰搧鍨嬪彿鐨勬嫾鎺ヤ綅缃�
+ // 渚嬪脳4锛屽氨涓�500ML脳4锛�4脳锛屽氨涓�4脳500ML
+ const index = a.modelNum.indexOf('脳')
+ if (index === 0) {
+ a.model = a.model + a.modelNum
+ } else if (index === -1) {
+ a.model = a.model + '-' + a.modelNum
} else {
- a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
+ a.model = a.modelNum + a.model
}
- a.insProduct = a.insProduct.filter(b=>b.state === 1)
- return a
- })),
- pairing: JSON.stringify(pairing)
- })
+ } else {
+ a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
+ }
+ a.insProduct = a.insProduct.filter(b=>b.state === 1)
+ return a
+ }),
}).then(res => {
this.saveLoad = false
- if (res.code == 201) return
this.$message.success('宸叉彁浜�')
this.bsm3Dia = false;
- this.$parent.playOrder(0)
+ this.closeOpenPage()
}).catch(e=>{
this.saveLoad = false
})
@@ -1427,16 +1421,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 +1434,7 @@
},
// 鑾峰彇妫�楠屾爣鍑嗕笅鎷夋鏁版嵁
selectStandardMethods() {
- this.$axios.get(this.$api.standardTree.selectStandardMethodEnum).then(res => {
+ selectStandardMethodEnum().then(res => {
this.methods = res.data
})
},
@@ -1460,7 +1447,7 @@
},
selectsStandardMethodByFLSSM() {
this.methodLoad = true
- this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
+ selectsStandardMethodByFLSSM({
tree: this.selectTree
}).then(res => {
this.methodLoad = false
@@ -1469,7 +1456,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,32 +1596,26 @@
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) {
- res.data.forEach(a => {
- a.state = 0
+ res.data.forEach(a => {
+ a.state = 0
+ })
+ this.productList = this.HaveJson(res.data)
+ this.productList0 = JSON.parse(JSON.stringify(this.productList))
+ this.$refs.sampleTable.setCurrentRow(row)
+ setTimeout(() => {
+ this.productList.forEach(a => {
+ if (a.state == 1) this.toggleSelection(a)
})
- this.productList = this.HaveJson(res.data)
- this.productList0 = JSON.parse(JSON.stringify(this.productList))
- this.$refs.sampleTable.setCurrentRow(row)
- setTimeout(() => {
- this.productList.forEach(a => {
- if (a.state == 1) this.toggleSelection(a)
- })
- }, 200)
- }
+ }, 200)
}).catch(err => {
console.log('err-',err)
})
@@ -1674,13 +1655,6 @@
let arr0 = arr.slice(0, arr.length - 1)
this.selectTree = arr0.join(' - ') + '- ' + e
}
- },
- selectEnumByCategoryForType() {
- this.$axios.post(this.$api.enums.selectEnumByCategory, {
- category: "绱ф�ョ▼搴�"
- }).then(res => {
- this.types = res.data
- })
},
// 瑕佹眰鍊煎彉鍖栨椂
requestChange(e, row) {
@@ -1722,8 +1696,6 @@
p.section = sections[a]
p.ask = asks[a]
p.tell = tells[a]
- // p.manHour = manHours[a]
- // p.price = prices[a]
}
})
break
@@ -1751,12 +1723,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 +1739,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 +1789,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)
@@ -1893,139 +1849,25 @@
return row[property] === value;
},
goBack () {
- const obj = { path: "/business/materialOrder" };
- this.$tab.closeOpenPage(obj);
- }
+ if (this.active == 1) {
+ this.$router.go(-1)
+ } else {
+ this.closeOpenPage()
+ }
+ },
+ closeOpenPage() {
+ this.$router.go(-1)
+ this.$tab.closeOpenPage()
+ },
}
}
</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;
@@ -2055,5 +1897,7 @@
background-color: #ffffff;
}
-
+>>>.warning-row {
+ color: #1890FF;
+}
</style>
--
Gitblit v1.9.3