From c4a1108d64e8e8b24e1b805d84d2dd482a37dd79 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 11 三月 2025 19:08:11 +0800
Subject: [PATCH] 检验下单代码迁移:下单功能
---
src/views/business/inspectionOrder/add.vue | 1770 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 1,217 insertions(+), 553 deletions(-)
diff --git a/src/views/business/inspectionOrder/add.vue b/src/views/business/inspectionOrder/add.vue
index b726824..ade64a8 100644
--- a/src/views/business/inspectionOrder/add.vue
+++ b/src/views/business/inspectionOrder/add.vue
@@ -80,7 +80,7 @@
v-show="active == 3 && addObj.companyId"
>閫氳繃</el-button
>
- <el-button size="medium" @click="$parent.playOrder(0)">
+ <el-button size="medium" @click="$router.go(-1)">
<span style="color: #3a7bfa">杩斿洖</span>
</el-button>
</el-col>
@@ -172,7 +172,7 @@
placeholder="璇疯緭鍏�"
class="search_input"
clearable
- :readonly="active > 1"
+ :disabled="active > 1"
v-model="addObj.phone"
></el-input>
</el-form-item>
@@ -248,7 +248,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="鎶ュ憡鍙戦�佹柟寮忥細" prop="send">
- <el-radio-group v-model="addObj.send">
+ <el-radio-group v-model="addObj.send" :disabled="active > 1">
<el-radio :label="1">鑷彇</el-radio>
<el-radio :label="0">鍏朵粬</el-radio>
</el-radio-group>
@@ -260,7 +260,11 @@
prop="processing"
class="processing_input"
>
- <el-radio-group v-model="addObj.processing" size="mini">
+ <el-radio-group
+ v-model="addObj.processing"
+ :disabled="active > 1"
+ size="mini"
+ >
<el-radio :label="0">濮旀墭鍗曚綅鍙栧洖</el-radio>
<el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio>
</el-radio-group>
@@ -274,7 +278,7 @@
:placeholder="active > 1 ? '' : '璇疯緭鍏�'"
clearable
v-model="addObj.engineering"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -291,7 +295,7 @@
:placeholder="active > 1 ? '' : '璇疯緭鍏�'"
clearable
v-model="addObj.engineeringEn"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -303,7 +307,7 @@
placeholder="璇疯緭鍏�"
clearable
v-model="addObj.production"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -319,13 +323,13 @@
placeholder="璇疯緭鍏�"
clearable
v-model="addObj.productionEn"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鏄惁鐣欐牱锛�" prop="isLeave">
- <el-radio-group v-model="addObj.isLeave">
+ <el-radio-group v-model="addObj.isLeave" :disabled="active > 1">
<el-radio :label="0">涓嶇暀鏍�</el-radio>
<el-radio :label="1">鐣欐牱</el-radio>
</el-radio-group>
@@ -336,6 +340,7 @@
<el-col :span="6">
<el-form-item label="鏄惁娑夊強閰嶅鏍峰搧锛�" prop="mating">
<el-radio-group
+ :disabled="active > 1"
v-model="addObj.mating"
@change="$refs.sampleTable.doLayout()"
>
@@ -355,7 +360,7 @@
:placeholder="active > 1 ? '' : '璇疯緭鍏�'"
clearable
v-model="addObj.otcCode"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -367,7 +372,7 @@
:placeholder="active > 1 ? '' : '璇疯緭鍏�'"
clearable
v-model="addObj.prepareUser"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -380,7 +385,7 @@
clearable
:placeholder="active > 1 ? '' : '璇疯緭鍏�'"
v-model="addObj.remark"
- :readonly="active > 1"
+ :disabled="active > 1"
></el-input>
</el-form-item>
</el-col>
@@ -388,58 +393,58 @@
</el-form>
</div>
</basic-container>
+ <div
+ class="search"
+ v-if="active == 1"
+ style="display: flex; background: transparent"
+ >
+ <div style="display: flex; align-items: center">
+ <div class="search_label">鏍峰搧鍨嬪彿锛�</div>
+ <div class="search_input">
+ <el-select
+ v-model="model"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ filterable
+ allow-create
+ default-first-option
+ size="small"
+ @change="changeModel"
+ >
+ <el-option
+ v-for="item in models"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <div style="display: flex; align-items: center">
+ <div class="search_label">妫�楠屾爣鍑嗭細</div>
+ <div class="search_input">
+ <el-select
+ filterable
+ v-model="standardMethodListId"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ size="small"
+ @focus="methodFocus"
+ :loading="methodLoad"
+ @change="changeStandardMethodListId"
+ >
+ <el-option
+ v-for="item in methods"
+ :key="item.id"
+ :label="item.code"
+ :value="item.id"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
<basic-container>
<div style="height: auto">
- <div
- class="search"
- v-if="active == 1"
- style="display: flex; background: transparent"
- >
- <div>
- <div class="search_label">鏍峰搧鍨嬪彿锛�</div>
- <div class="search_input">
- <el-select
- v-model="model"
- :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
- filterable
- allow-create
- default-first-option
- size="small"
- @change="changeModel"
- >
- <el-option
- v-for="item in models"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <div>
- <div class="search_label">妫�楠屾爣鍑嗭細</div>
- <div class="search_input">
- <el-select
- filterable
- v-model="standardMethodListId"
- :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
- size="small"
- @focus="methodFocus"
- :loading="methodLoad"
- @change="changeStandardMethodListId"
- >
- <el-option
- v-for="item in methods"
- :key="item.id"
- :label="item.code"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- </div>
<el-table
class="el-table sampleTable"
ref="sampleTable"
@@ -802,10 +807,767 @@
</el-table>
</div>
</basic-container>
+ <el-dialog
+ title="閫夋嫨鏍峰搧"
+ :visible.sync="selectStandardTree"
+ width="500px"
+ >
+ <div
+ class="body"
+ style="height: 60vh; overflow-y: auto; user-select: none"
+ v-if="selectStandardTree"
+ >
+ <el-row>
+ <el-col :span="24">
+ <el-input
+ placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�"
+ suffix-icon="el-icon-search"
+ v-model="search"
+ size="small"
+ style="margin-bottom: 5px"
+ clearable
+ @blur="searchFilter"
+ @clear="searchFilter"
+ @keyup.enter.native="searchFilter"
+ ></el-input>
+ </el-col>
+ </el-row>
+ <el-tree
+ :data="list"
+ ref="tree"
+ :props="{ children: 'children', label: 'label' }"
+ node-key="label"
+ :filter-node-method="filterNode"
+ @node-click="handleNodeClick"
+ highlight-current
+ @node-expand="nodeOpen"
+ @node-collapse="nodeClose"
+ :default-expanded-keys="expandedKeys"
+ @dblclick.native="activeStandardTree"
+ >
+ <div class="custom-tree-node" slot-scope="{ node, data }">
+ <el-row>
+ <el-col :span="24">
+ <span
+ ><i
+ :class="`node_i ${
+ data.children != undefined
+ ? data.code === '[1]'
+ ? 'el-icon-folder-opened'
+ : 'el-icon-folder'
+ : 'el-icon-tickets'
+ }`"
+ ></i>
+ {{ data.code }} {{ data.label }}</span
+ >
+ </el-col>
+ </el-row>
+ </div>
+ </el-tree>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectStandardTree = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="activeStandardTree">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="閫夋嫨鍗曚綅" :visible.sync="selectUserDia" width="70%">
+ <div class="body" style="height: 60vh" v-if="selectUserDia">
+ <ValueTable
+ ref="ValueTable2"
+ :url="$api.user.selectCustomPageList"
+ :componentData="componentData2"
+ />
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="selectUser">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="淇濆瓨妯℃澘" :visible.sync="templateDia" width="400px">
+ <div
+ class="body"
+ style="display: flex; align-items: center"
+ v-if="templateDia"
+ >
+ <div class="search_label" style="width: 90px">
+ <span class="required-span">* </span>妯℃澘鍚嶇О锛�
+ </div>
+ <div class="search_input">
+ <el-input size="small" clearable v-model="templateName"></el-input>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="templateDia = false">鍙� 娑�</el-button>
+ <el-button
+ type="primary"
+ @click="addTemplateDia"
+ :loading="templateLoading"
+ >纭� 瀹�</el-button
+ >
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="妫�楠屼笅鍙�"
+ :visible.sync="issuedDialogVisible"
+ width="400px"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ >
+ <div class="body" style="max-height: 60vh">
+ <el-row>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>绾﹀畾鏃堕棿锛�
+ </div>
+ <div class="search_input">
+ <el-date-picker
+ size="small"
+ v-model="distributeData.appointed"
+ :picker-options="pickerOptions"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ style="width: 100%"
+ format="yyyy-MM-dd"
+ >
+ </el-date-picker>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span" v-if="addObj.type == 2">* </span
+ >鎸囨淳浜哄憳锛�
+ </div>
+ <div class="search_input">
+ <el-select
+ multiple
+ v-model="distributeData.userId"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ @change="changeUser"
+ >
+ <el-option-group
+ v-for="(item, index) in Object.keys(personList)"
+ :key="index"
+ :label="item"
+ >
+ <el-option
+ v-for="op in personList[item]"
+ :key="op.id"
+ :label="op.name"
+ :value="op.id"
+ >
+ </el-option>
+ </el-option-group>
+ </el-select>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="22"
+ v-if="distributeData.userId.length > 0"
+ >
+ <div class="search_label">
+ <span class="required-span">* </span>璇曢獙瀹わ細
+ </div>
+ <div class="search_input">
+ <el-select
+ v-model="distributeData.sonLaboratory"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in sonLaboratoryList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>鍒涘缓濮旀墭鍗曪細
+ </div>
+ <div class="search_input">
+ <el-select
+ v-model="distributeData.isCreate"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ >
+ <el-option label="鏄�" :value="true"></el-option>
+ <el-option label="鍚�" :value="false"></el-option>
+ </el-select>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="issuedDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm2" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="涓嶉�氳繃鍘熷洜" :visible.sync="noDialogVisible" width="400px">
+ <div class="body" style="max-height: 60vh">
+ <el-row>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>涓嶉�氳繃鍘熷洜锛�
+ </div>
+ <div class="search_input">
+ <el-input
+ v-model="tell"
+ size="small"
+ placeholder="璇疯緭鍏ヤ笉閫氳繃鍘熷洜"
+ ></el-input>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="(noDialogVisible = false), (tell = '')"
+ >鍙� 娑�</el-button
+ >
+ <el-button type="primary" @click="submitTell" :loading="noLoading"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <fiberOpticConfig
+ :fiberPairing="fiberPairing"
+ :currentId="currentId"
+ @saveFiberopticConfig="saveFiberConfigEvent($event)"
+ v-if="configShow && examine == 0"
+ :active="active"
+ :inspectionItemST="inspectionItemST"
+ />
+ <fiberOpticConfigTwo
+ :currentId="currentId"
+ v-if="configShow && examine == 1"
+ :active="active"
+ />
+ <equipConfig
+ :currentId="currentId"
+ v-if="equipConfigShow"
+ :active="active"
+ />
+ <cableConfig v-if="cableConfigShow" :active="active" />
+ <!-- 鍗曢�夌壒娈婂�煎鐞嗘-->
+ <el-dialog
+ title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨"
+ :visible.sync="bsm1Dia"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ min-width="400px"
+ :show-close="false"
+ :before-close="beforeClose"
+ >
+ <div class="body" style="max-height: 60vh">
+ <el-row v-if="bsm1">
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">
+ <span class="required-span">* </span>閫夐」锛�
+ </div>
+ <div class="search_input">
+ <el-radio-group v-model="bsm1Val" @input="upBsm1">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(bsmRow.section)"
+ :key="ai"
+ :label="a"
+ style="margin-bottom: 2px; margin-top: 2px"
+ ></el-radio>
+ </el-radio-group>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">瑕佹眰鍊硷細</div>
+ <div
+ class="search_input"
+ v-show="bsm1Val !== null && bsm1Val !== ''"
+ >
+ <el-radio-group v-model="bsm1Val" @input="upBsm1">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(bsmRow.section)"
+ :key="ai"
+ :label="a"
+ >{{ JSON.parse(bsmRow.ask)[ai] }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row v-if="bsm2">
+ <el-col class="search_thing" :span="22">
+ <div class="search_label" style="width: 220px">
+ <span class="required-span">* </span>鏍峰搧鐔旀帴閰嶅鏁伴噺锛�
+ </div>
+ <div class="search_input">
+ <el-input-number
+ size="medium"
+ v-model="bsm2Val"
+ :min="1"
+ :max="bsm2Val3.length"
+ :precision="0"
+ style="width: 70%"
+ :controls="false"
+ @change="bsm2Up"
+ ></el-input-number>
+ <span>MAX锛歿{ bsm2Val3.length }}</span>
+ </div>
+ </el-col>
+ <el-col style="margin-top: 6px">
+ <el-col v-for="(a, ai) in bsm2Val2" :key="ai">
+ <el-col :span="10">
+ <el-select
+ v-model="a[0]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ <el-col
+ :span="4"
+ class="pairing"
+ style="border: 0; color: rgba(0, 0, 0, 0.2)"
+ >鈥斺��</el-col
+ >
+ <el-col :span="10">
+ <el-select
+ v-model="a[1]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ </el-col>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button type="primary" @click="save2" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <!-- 鍏ㄩ�夌壒娈婂�煎鐞嗘-->
+ <el-dialog
+ title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨"
+ :visible.sync="bsm1DiaAll"
+ min-width="400px"
+ :show-close="false"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ :before-close="beforeClose"
+ >
+ <div
+ class="body"
+ style="max-height: 60vh"
+ v-for="(item, index) in bsm1DiaList"
+ :key="index"
+ >
+ <el-row v-if="item.bsm1">
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">
+ <span class="required-span">* </span>閫夐」锛�
+ </div>
+ <div class="search_input">
+ <el-radio-group v-model="item.bsm1Val" @input="upBsmAll(item)">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(item.bsmRow.section)"
+ :key="ai"
+ :label="a"
+ style="margin-bottom: 2px; margin-top: 2px"
+ ></el-radio>
+ </el-radio-group>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">瑕佹眰鍊硷細</div>
+ <div
+ class="search_input"
+ v-show="item.bsm1Val !== null && item.bsm1Val !== ''"
+ >
+ <el-radio-group v-model="item.bsm1Val" @input="upBsmAll(item)">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(item.bsmRow.section)"
+ :key="ai"
+ :label="a"
+ >{{ JSON.parse(item.bsmRow.ask)[ai] }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row v-if="item.bsm2">
+ <el-col class="search_thing" :span="22">
+ <div class="search_label" style="width: 220px">
+ <span class="required-span">* </span>鏍峰搧鐔旀帴閰嶅鏁伴噺锛�
+ </div>
+ <div class="search_input">
+ <el-input-number
+ size="medium"
+ v-model="item.bsm2Val"
+ :min="1"
+ :max="item.bsm2Val3.length"
+ :precision="0"
+ style="width: 70%"
+ :controls="false"
+ @change="bsm2Up"
+ ></el-input-number>
+ <span>MAX锛歿{ item.bsm2Val3.length }}</span>
+ </div>
+ </el-col>
+ <el-col style="margin-top: 6px">
+ <el-col v-for="(a, ai) in item.bsm2Val2" :key="ai">
+ <el-col :span="10">
+ <el-select
+ v-model="a[0]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in item.sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ <el-col
+ :span="4"
+ class="pairing"
+ style="border: 0; color: rgba(0, 0, 0, 0.2)"
+ >鈥斺��</el-col
+ >
+ <el-col :span="10">
+ <el-select
+ v-model="a[1]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in item.sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ </el-col>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button type="primary" @click="save1" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="鐗规畩鍊煎~鍐�"
+ :visible.sync="bsm3Dia"
+ top="5vh"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ width="800px"
+ :show-close="false"
+ >
+ <el-table :data="editTable" style="width: 100%" height="500px">
+ <!-- inspectionItemList -->
+ <el-table-column prop="inspectionItemList" label="妫�楠岄」" width="180">
+ </el-table-column>
+ <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" width="180">
+ </el-table-column>
+ <el-table-column prop="model" label="鏍峰搧鍨嬪彿" width="180">
+ </el-table-column>
+ <el-table-column prop="symbolItem" label="璇嗗埆绗﹀彿"> </el-table-column>
+ <el-table-column prop="value" label="璇嗗埆绗﹀��">
+ <template slot-scope="scope">
+ <el-input
+ v-model="scope.row.value"
+ placeholder="璇疯緭鍏�"
+ @input="inputValueHandler(scope.row, scope.$index)"
+ size="small"
+ type="number"
+ ></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="bsm3Dia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="save0" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="娓╁害寰幆瑕佹眰濉啓"
+ :visible.sync="circulateShow"
+ width="900px"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :before-close="beforeCirculateShowClose"
+ :show-close="false"
+ >
+ <div class="search" style="display: flex; background: transparent">
+ <div class="search_thing">
+ <div class="search_label">淇濇俯鏃堕棿锛�</div>
+ <div class="search_input">
+ <el-input
+ v-model="circulateForm.entrustTime"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">寰幆娆℃暟锛�</div>
+ <div class="search_input">
+ <el-input
+ v-model="circulateForm.entrustNum"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">娓╁害鐐癸細</div>
+ <div class="search_input">
+ <el-input
+ @focus="() => (isFocus = true)"
+ @blur="changeTemperatureData"
+ v-model="circulateForm.entrustPoint"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ </div>
+ <div class="circulateTable">
+ <div class="opticalProject">
+ <div style="line-height: 30px">鍏夌氦椤圭洰</div>
+ <el-divider></el-divider>
+ <div>
+ <el-table
+ ref="multipleTable"
+ border
+ :header-cell-style="{ 'text-align': 'center' }"
+ :cell-style="{ 'text-align': 'center' }"
+ :data="opticalProject"
+ tooltip-effect="dark"
+ style="width: 100%"
+ @row-click="rowClickOptical"
+ @select="selectOpticalProject"
+ @select-all="selectAllOptical"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55"> </el-table-column>
+ <el-table-column
+ prop="value"
+ label="鍏夌氦椤圭洰"
+ show-overflow-tooltip
+ ></el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <div class="temperatureList">
+ <div class="temperatureListTitle">
+ <span>娓╁害鐐归泦鍚�</span>
+ <span>
+ <el-button
+ type="primary"
+ size="mini"
+ :disabled="isFocus"
+ @click="addTemperatureData"
+ >鏂板</el-button
+ >
+ <el-button size="mini" @click="deleteTemperatureData"
+ >鍒犻櫎</el-button
+ >
+ </span>
+ </div>
+ <el-divider></el-divider>
+ <el-table
+ :data="temperatureData"
+ border
+ :header-cell-style="{ 'text-align': 'center' }"
+ :cell-style="{ 'text-align': 'center' }"
+ style="width: 100%"
+ >
+ <el-table-column prop="date" label="娓╁害鐐�(鈩�)" width="120px">
+ <template slot-scope="scope">
+ <el-input
+ size="small"
+ v-model="scope.row.temperaturePoint"
+ clearable
+ placeholder="璇疯緭鍏�"
+ @change="changeTemperature"
+ ></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="name" label="瑕佹眰(dB/Km)">
+ <template slot-scope="scope">
+ <span>x</span>
+ <el-select
+ v-model="scope.row.askSymbol"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 120px"
+ @change="changeTemperature"
+ >
+ <el-option
+ v-for="item in temperatureDataList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ <el-input
+ size="small"
+ v-model="scope.row.askNum"
+ clearable
+ placeholder="璇疯緭鍏�"
+ style="width: 120px"
+ @change="changeTemperature"
+ ></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cleanSpliceData">鍙栨秷</el-button>
+ <el-button type="primary" @click="spliceData">淇濆瓨</el-button>
+ </span>
+ </el-dialog>
+ <!-- 鐢靛姏璇曢獙瀹�---娓╁崌璇曢獙/鐑惊鐜� -->
+ <el-dialog
+ :title="temperatureTitle"
+ :visible.sync="temperatureShow"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ width="260px"
+ :before-close="temperatureShowClose"
+ :show-close="false"
+ >
+ <div>
+ <div v-if="isShowInput" style="margin-bottom: 6px">
+ <span>寰幆娆℃暟:</span>
+ <!-- <el-input size="small" type="number" v-model="temperatureTestNum" style="width: 120px"></el-input> -->
+ <el-input-number
+ v-model="temperatureTestNum"
+ :min="2"
+ :max="1000000"
+ size="small"
+ label=""
+ ></el-input-number>
+ </div>
+ <el-checkbox-group
+ v-model="temperatureTest"
+ @change="handleTemperatureTestChange"
+ style="display: flex; flex-direction: column"
+ >
+ <el-checkbox
+ v-for="item in temperatureList"
+ :label="item"
+ :key="item"
+ style="margin-bottom: 6px"
+ >{{ item }}</el-checkbox
+ >
+ </el-checkbox-group>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cleanTemperatureTest">鍙栨秷</el-button>
+ <el-button type="primary" @click="spliceTemperatureTest"
+ >淇濆瓨</el-button
+ >
+ </span>
+ </el-dialog>
</div>
</template>
<script>
+import {
+ selectInsOrderTemplate,
+ hasSendUrgentOrder,
+ addInsOrder,
+ selectOrderManDay,
+ selectInsOrderTemplateById,
+ upInsOrderOfState,
+ upInsOrder,
+ getInsOrder,
+ addInsOrderTemplate,
+ delInsOrderTemplate,
+ labelPrinting,
+} from "@/api/business/inspectionOrder";
+import {
+ selectStandardTreeList2,
+ selectStandardMethodEnum,
+ selectsStandardMethodByFLSSM,
+ selectStandardProductList,
+} from "@/api/standard/standardLibrary";
+import { selectBushingBySampleId } from "@/api/business/insBushing";
+import { getLaboratoryPersonList } from "@/api/system/user";
import { mapGetters } from "vuex";
import fiberOpticConfig from "./fiberoptic-config.vue";
import fiberOpticConfigReadOnly from "./fiberoptic-config-readonly.vue";
@@ -822,24 +1584,15 @@
cableConfig,
},
computed: {
- ...mapGetters(["nickName", "company"]),
+ ...mapGetters(["nickName", "loginUserInfo"]),
},
- props: {
- examine: {
- type: Number,
- default: () => 0,
- },
- active: {
- type: Number,
- default: () => 0,
- },
- currentId: {
- type: Number,
- default: () => 0,
- },
- },
+ props: {},
data() {
return {
+ isReview: false, //鏄惁鏄煡鐪嬭鎯�
+ examine: 0,
+ active: 0,
+ currentId: 0,
pickerOptions: {
disabledDate(time) {
// 褰撳墠鏃堕棿鍔犱笂涓夊ぉ鐨勬椂闂存埑
@@ -1133,18 +1886,20 @@
this.standardMethodListId = null;
},
},
+ created() {
+ this.active = this.$route.query.active;
+ this.currentId = this.$route.query.currentId;
+ this.examine = this.$route.query.examine;
+ this.isReview = this.$route.query.isReview;
+ },
mounted() {
- if (this.addObj.custom == "" || this.addObj.custom == null) {
- this.addObj.custom = this.nickName; //璁剧疆鍒跺崟浜轰负褰撳墠鐧诲綍浜�
- }
- this.addObj.company = this.company;
+ //鏌ヨ瀛楀吀
this.selectDictForType();
this.selectDictForOrderType();
this.selectDictForUnit();
this.selectDictForSampleForm();
-
if (this.active != 3) {
- this.getUserNow();
+ this.init();
}
this.selectStandardTreeList();
this.getAuthorizedPerson();
@@ -1152,25 +1907,29 @@
if (this.active != 1) {
// 鏌ョ湅/瀹℃牳娴佺▼
// 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
- this.$axios
- .post(this.$api.insOrder.getInsOrder, {
- orderId: this.currentId,
- })
+ getInsOrder({
+ orderId: this.currentId,
+ })
.then((res) => {
- this.addObj = {
- ...res.data.insOrder,
- };
- this.addObj.type = String(this.addObj.type);
- this.sampleList = this.HaveJson(res.data.sampleProduct);
- this.getProNum();
- this.addObj.sampleNum = this.sampleList.length;
- this.$nextTick(() => {
- this.$refs.sampleTable.doLayout();
- if (this.addObj.sampleNum > 0) {
- this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true);
- this.rowClick(this.sampleList[0]);
- }
- });
+ if (res.code === 200) {
+ this.addObj = {
+ ...res.data.insOrder,
+ };
+ this.addObj.type = String(this.addObj.type);
+ this.sampleList = this.HaveJson(res.data.sampleProduct);
+ this.getProNum();
+ this.addObj.sampleNum = this.sampleList.length;
+ this.$nextTick(() => {
+ this.$refs.sampleTable.doLayout();
+ if (this.addObj.sampleNum > 0) {
+ this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true);
+ this.rowClick(this.sampleList[0]);
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
}
},
@@ -1194,16 +1953,13 @@
let flag = true;
//濡傛灉鏄被鍨嬫槸绱ф�ワ紝鍒ゆ柇褰撳墠瀹㈡埛褰撳ぉ鐨勭揣鎬ラ搴︽槸鍚︾敤瀹�
if (type == 2) {
- await this.$axios
- .post(this.$api.insOrder.hasSendUrgentOrder, {})
+ await hasSendUrgentOrder()
.then((res) => {
flag = res.data;
return flag;
- // if (!res.data) {
- // this.addObj.type = "1";
- // this.$message.error("褰撳ぉ绱ф�ラ搴﹀凡鐢ㄥ畬");
- // throw "褰撳ぉ绱ф�ラ搴﹀凡鐢ㄥ畬";
- // }
+ })
+ .catch((error) => {
+ console.error(error);
});
}
return flag;
@@ -1613,9 +2369,15 @@
}
},
getAuthorizedPerson() {
- this.$axios.get(this.$api.user.getLaboratoryPersonList).then((res) => {
- this.personList = res.data;
- });
+ getLaboratoryPersonList()
+ .then((res) => {
+ if (res.code === 200) {
+ this.personList = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
},
selectDictForType() {
getDicts("urgency_level")
@@ -2559,6 +3321,7 @@
let sampleList = this.HaveJson(sampleList0);
sampleList.forEach((a) => {
a.insProduct.forEach((b) => {
+ b.id = null;
delete b.bsmRow;
});
});
@@ -2577,141 +3340,76 @@
console.log(this.sampleList);
console.log(this.fiberPairing);
this.saveLoad = true;
- this.$axios
- .post(this.$api.insOrder.addInsOrder, {
- str: JSON.stringify({
- insOrder: this.addObj,
- list: JSON.stringify(
- sampleList.map((a) => {
- if (this.PROJECT === "瑁呭鐢电紗") {
- if (a.modelNum) {
- 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;
- }
- } else {
- a.model =
- a.model +
- (a.modelNum == null ||
- a.modelNum == "" ||
- a.modelNum == "null"
- ? ""
- : "-" + a.modelNum);
- }
- } 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;
- })
- ),
- pairing: JSON.stringify(this.bsm2Val2),
- fiberPairing: JSON.stringify(this.fiberPairing),
- }),
- })
+ addInsOrder({
+ insOrder: this.addObj,
+ list: sampleList.map((a) => {
+ 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;
+ }),
+ pairing: this.bsm2Val2,
+ fiberPairing: this.fiberPairing,
+ })
.then((res) => {
+ if (res.code === 200) {
+ this.$message.success("宸叉彁浜�");
+ this.bsm3Dia = false;
+ this.$router.go(-1);
+ }
this.saveLoad = false;
- if (res.code == 201) return;
- this.$message.success("宸叉彁浜�");
- this.bsm3Dia = false;
- this.$parent.playOrder(0);
})
- .catch((e) => {
+ .catch((error) => {
this.saveLoad = false;
+ console.error(error);
});
},
upInsOrderOfState(state) {
if (state == 1) {
//this.saveLoad = true
this.issuedDialogVisible = true;
- this.$axios
- .post(this.$api.insOrder.selectOrderManDay, {
- id: this.currentId,
+ selectOrderManDay({
+ id: this.currentId,
+ })
+ .then((res) => {
+ if (res.code === 200) {
+ this.distributeData.orderId = this.currentId;
+ this.distributeData.appointed = res.data;
+ console.log("绾﹀畾鏃堕棿", this.distributeData.appointed);
+ }
})
- .then((ress) => {
- this.distributeData.orderId = this.currentId;
- this.distributeData.appointed = ress.data;
- console.log("绾﹀畾鏃堕棿", this.distributeData.appointed);
+ .catch((error) => {
+ console.error(error);
});
setTimeout(() => {
this.issuedDialogVisible = true;
}, 1000);
- // this.$axios.post(this.$api.insOrder.upInsOrderOfState, {
- // state,
- // id: this.currentId,
- // companyId:this.addObj.companyId,
- // laboratory:this.addObj.laboratory,
- // company: this.addObj.company
- // }, {
- // headers: {
- // 'Content-Type': 'application/json'
- // }
- // }).then(res => {
- // this.saveLoad = false
- // if (res.code == 201) return
- // this.$message.success('鎻愪氦鎴愬姛')
-
- // this.$parent.multipleSelection = [{id: this.currentId}]
- // this.$parent.print()
- // 濡傛灉绱ф�ョ▼搴︿负绱ф�ワ紝闇�瑕佺洿鎺ヤ笅鍙戜汉鍛�
- // if (this.addObj.type == 2) {
- // this.issuedDialogVisible = true;
- // this.$axios.post(this.$api.insOrder.selectOrderManDay, {
- // id: this.currentId
- // }).then(ress => {
- // this.distributeData.orderId = this.currentId
- // this.distributeData.appointed = ress.data
- // })
- // } else {
- // this.$parent.playOrder(0)
- // }
-
- // this.$axios.post(this.$api.insOrder.selectOrderManDay, {
- // id: this.currentId
- // }).then(ress => {
- // this.distributeData.orderId = this.currentId
- // this.distributeData.appointed = ress.data
- // })
- // setTimeout(() => {
- // this.issuedDialogVisible = true;
- // }, 1000)
- // })
} else {
// 涓嶉�氳繃
this.noDialogVisible = true;
}
},
getLabelPrinting(currentId) {
- this.$axios
- .post(this.$api.insOrder.labelPrinting, {
- ids: currentId,
- })
+ labelPrinting({
+ ids: currentId,
+ })
.then((res) => {
- //瀹℃牳閫氳繃锛岄粯璁ゅ彧鎵撳嵃绗竴涓牱鍝佹爣绛�
- let firstSample = res.data[0];
- let arr1 = [];
- firstSample.insProduct.forEach((b) => {
- arr1.push(b.inspectionItem);
- });
- firstSample.item = [...new Set(arr1)].join(",");
- // arr.forEach((a) => {
- // let arr1 = [];
- // a.insProduct.forEach((b) => {
- // arr1.push(b.inspectionItem);
- // });
- // a.item = [...new Set(arr1)].join(",");
- // });
- this.beginPrint(firstSample);
+ if (res.code === 200) {
+ //瀹℃牳閫氳繃锛岄粯璁ゅ彧鎵撳嵃绗竴涓牱鍝佹爣绛�
+ let firstSample = res.data[0];
+ let arr1 = [];
+ firstSample.insProduct.forEach((b) => {
+ arr1.push(b.inspectionItem);
+ });
+ firstSample.item = [...new Set(arr1)].join(",");
+ this.beginPrint(firstSample);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
//寮�濮嬫爣绛炬墦鍗�
@@ -2807,92 +3505,74 @@
return;
}
// let flag = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrderOfState,
- {
- state: 1,
- id: this.currentId,
- companyId: this.addObj.companyId,
- laboratory: this.addObj.laboratory,
- company: this.addObj.company,
- isCreate: this.distributeData.isCreate,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ upInsOrderOfState({
+ state: 1,
+ id: this.currentId,
+ companyId: this.addObj.companyId,
+ laboratory: this.addObj.laboratory,
+ company: this.addObj.company,
+ isCreate: this.distributeData.isCreate,
+ })
.then((res) => {
- // flag = false;
-
- // if (flag) {
- // this.$message.error("濮旀墭缂栧彿鐢熸垚澶辫触");
- // return;
- // }
- this.upLoad = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrder,
- {
- orderId: this.distributeData.orderId,
- appointed: this.distributeData.appointed,
- userIdList: this.distributeData.userId,
- sonLaboratory: this.distributeData.sonLaboratory,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
- .then((res) => {
- if (res.code === 201) {
- this.upLoad = false;
- return;
- }
- this.$message.success("鎻愪氦鎴愬姛");
- this.upLoad = false;
- this.issuedDialogVisible = false;
- this.$parent.playOrder(0);
- //瀹℃牳閫氳繃鍚庯紝鑷姩鎵撳嵃浜岀淮鐮�
- //TODO: 鐢靛姏璇曢獙瀹ゆ殏鏃朵笉鐢ㄦ爣绛炬墦鍗�
- if (
- this.sonLaboratoryList.filter((f) => f.value === "鐢靛姏璇曢獙瀹�")
- .length === 0
- ) {
- this.$nextTick(() => {
- this.getLabelPrinting(this.currentId);
- });
- }
+ if (res.code === 200) {
+ this.upLoad = true;
+ upInsOrder({
+ orderId: this.distributeData.orderId,
+ appointed: this.distributeData.appointed,
+ userIdList: this.distributeData.userId,
+ sonLaboratory: this.distributeData.sonLaboratory,
})
- .catch((e) => {
- this.$message.error("鎻愪氦澶辫触");
- this.upLoad = false;
- });
+ .then((res) => {
+ if (res.code === 201) {
+ this.upLoad = false;
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.issuedDialogVisible = false;
+ this.upLoad = false;
+ this.$router.go(-1);
+ //瀹℃牳閫氳繃鍚庯紝鑷姩鎵撳嵃浜岀淮鐮�
+ //TODO: 鐢靛姏璇曢獙瀹ゆ殏鏃朵笉鐢ㄦ爣绛炬墦鍗�
+ if (
+ this.sonLaboratoryList.filter((f) => f.value === "鐢靛姏璇曢獙瀹�")
+ .length === 0
+ ) {
+ this.$nextTick(() => {
+ this.getLabelPrinting(this.currentId);
+ });
+ }
+ })
+ .catch((error) => {
+ this.$message.error("鎻愪氦澶辫触");
+ this.upLoad = false;
+ console.error(error);
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
- getUserNow() {
- this.$axios.get(this.$api.user.getUserNow).then((res) => {
- let selects = res.data;
- if (selects == null) return;
- this.addObj.userId = selects.id;
- this.addObj.company = selects.company;
- this.addObj.custom = selects.name;
- this.addObj.code = selects.code;
- this.addObj.phone = selects.phone;
- this.addObj.companyId = selects.departId;
- this.addObj.production = "/";
- this.addObj.productionEn = "/";
- if (this.active == 1) {
- this.selectInsOrderTemplate();
- }
- });
+ init() {
+ if (this.addObj.custom == "" || this.addObj.custom == null) {
+ this.addObj.custom = this.loginUserInfo.nickName; //璁剧疆鍒跺崟浜轰负褰撳墠鐧诲綍浜�
+ } else {
+ this.addObj.custom = this.loginUserInfo.nickName;
+ }
+ this.addObj.company = this.loginUserInfo.companyName;
+ this.addObj.companyId = this.loginUserInfo.company;
+ this.addObj.userId = this.loginUserInfo.userId;
+ // this.addObj.code = this.loginUserInfo.code;
+ this.addObj.phone = this.loginUserInfo.phoneNumber;
+ this.addObj.production = "/";
+ this.addObj.productionEn = "/";
+ if (this.active == 1) {
+ this.selectInsOrderTemplate();
+ }
},
getProNum() {
this.sampleSelectionList.forEach((m, i) => {
- Vue.set(
+ this.$set(
this.sampleSelectionList[i],
"proNum",
m.insProduct.filter((a) => a.state == 1).length
@@ -2950,13 +3630,17 @@
}
},
selectStandardTreeList() {
- this.$axios
- .get(this.$api.standardTree.selectStandardTreeList2)
+ selectStandardTreeList2()
.then((res) => {
- this.list = res.data;
- this.list.forEach((a) => {
- this.expandedKeys.push(a.label);
- });
+ if (res.code === 200) {
+ this.list = res.data;
+ this.list.forEach((a) => {
+ this.expandedKeys.push(a.label);
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
filterNode(value, data) {
@@ -3001,33 +3685,50 @@
},
selectsStandardMethodByFLSSM() {
this.methodLoad = true;
- this.$axios
- .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
- tree: this.selectTree,
- })
+ selectsStandardMethodByFLSSM({
+ tree: this.selectTree,
+ })
.then((res) => {
- this.methodLoad = false;
- try {
- if (
- res.data.standardMethodList.length == 0 &&
- this.selectTree.split("-").length == 5
- ) {
- 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, {
+ if (res.code === 200) {
+ this.methodLoad = false;
+ try {
+ if (
+ res.data.standardMethodList.length == 0 &&
+ this.selectTree.split("-").length == 5
+ ) {
+ let arr = this.selectTree.split("-");
+ let arr0 = arr.slice(0, arr.length - 1);
+ let selectTree = arr0
+ .join("-")
+ .substring(0, arr0.join("-").length - 1);
+ template()
+ .then((res) => {
+ if (res.status === 200) {
+ console.log(res);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+ selectsStandardMethodByFLSSM({
tree: selectTree,
})
- .then((ress) => {
- this.methods = ress.data.standardMethodList;
- });
- } else {
- this.methods = res.data.standardMethodList;
- }
- } catch (e) {}
+ .then((res) => {
+ if (res.code === 200) {
+ this.methods = ress.data.standardMethodList;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+ } else {
+ this.methods = res.data.standardMethodList;
+ }
+ } catch (e) {}
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
addStandardTree(currentValue, oldValue) {
@@ -3339,12 +4040,14 @@
console.log("upProductSelect", this.sampleList);
},
searchProject() {
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "鍏夌氦椤圭洰",
- })
+ getDicts("fiber_type")
.then((res) => {
- this.opticalProject = res.data;
+ if (res.code === 200) {
+ this.opticalProject = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
permute(nums) {
@@ -3381,15 +4084,14 @@
return "warning-row";
},
selectInsOrderTemplate() {
- this.$axios
- .get(
- this.$api.insOrder.selectInsOrderTemplate +
- "?company=" +
- this.addObj.company
- )
+ selectInsOrderTemplate({ company: this.addObj.company })
.then((res) => {
- if (res.code == 201) return;
- this.templates = res.data;
+ if (res.code === 200) {
+ this.templates = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
// 鍒犻櫎妯℃澘--璋冪敤鎺ュ彛
@@ -3400,19 +4102,18 @@
type: "warning",
})
.then(() => {
- this.$axios
- .post(this.$api.insOrder.delInsOrderTemplate, {
- id: row.id,
- })
+ delInsOrderTemplate({
+ id: row.id,
+ })
.then((res) => {
- if (res.code === 201) {
- return;
+ if (res.code === 200) {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.selectInsOrderTemplate();
}
- this.$message.success("鍒犻櫎鎴愬姛");
- this.selectInsOrderTemplate();
})
- .catch((e) => {
+ .catch((error) => {
this.$message.error("鍒犻櫎澶辫触");
+ console.error(error);
});
})
.catch(() => {});
@@ -3421,30 +4122,25 @@
addTemplateDia() {
if (this.templateName) {
this.templateLoading = true;
- this.$axios
- .post(
- this.$api.insOrder.addInsOrderTemplate,
- {
- name: this.templateName,
- thing: JSON.stringify({
- addObj: this.addObj,
- sampleList: this.sampleList,
- selectTree: this.selectTree,
- }),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ addInsOrderTemplate({
+ name: this.templateName,
+ thing: JSON.stringify({
+ addObj: this.addObj,
+ sampleList: this.sampleList,
+ selectTree: this.selectTree,
+ }),
+ })
.then((res) => {
- if (res.code == 201) return;
- this.templateLoading = false;
- this.templateDia = false;
- this.$message.success("淇濆瓨鎴愬姛");
- this.selectInsOrderTemplate();
- this.templateName = "";
+ if (res.code === 200) {
+ this.templateLoading = false;
+ this.templateDia = false;
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.selectInsOrderTemplate();
+ this.templateName = "";
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
} else {
this.$message.error("璇峰~鍐欐ā鏉垮悕绉�");
@@ -3452,26 +4148,27 @@
},
// 鏌ヨ妯℃澘
selectInsOrderTemplateById(e) {
- this.$axios
- .post(this.$api.insOrder.selectInsOrderTemplateById + "?id=" + e)
+ selectInsOrderTemplateById({ id: e })
.then((res) => {
- if (res.code == 201) return;
- // let obj = JSON.parse(res.data)
- let obj = res.data;
- console.log(obj);
- //鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛
- let user = JSON.parse(localStorage.getItem("user"));
- obj.addObj.custom = user.name;
- obj.addObj.userId = user.userId;
- this.addObj = obj.addObj;
- this.sampleList = obj.sampleList;
- this.selectTree = obj.selectTree;
- //榛樿閫変腑绗竴涓牱鍝�
- this.$nextTick(() => {
- if (this.sampleList.length > 0) {
- this.rowClick(this.sampleList[0]);
- }
- });
+ if (res.code === 200) {
+ let obj = res.data;
+ console.log(obj);
+ //鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛
+ obj.addObj.custom = this.loginUserInfo.nickName;
+ obj.addObj.userId = this.loginUserInfo.userId;
+ this.addObj = obj.addObj;
+ this.sampleList = obj.sampleList;
+ this.selectTree = obj.selectTree;
+ //榛樿閫変腑绗竴涓牱鍝�
+ this.$nextTick(() => {
+ if (this.sampleList.length > 0) {
+ this.rowClick(this.sampleList[0]);
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
delSampleAndProduct() {
@@ -3533,43 +4230,39 @@
let selectTreeList = this.selectTree.split(" - ");
this.addObj.model &&
(selectTreeList[selectTreeList.length - 1] = this.addObj.model);
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model:
- (this.addObj.model ? this.addObj.model : row.model) +
- "-" +
- row.modelNum,
- standardMethodListId: val,
- factory: selectTreeList.join(" - "),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model:
+ (this.addObj.model ? this.addObj.model : row.model) +
+ "-" +
+ row.modelNum,
+ standardMethodListId: val,
+ factory: selectTreeList.join(" - "),
+ })
.then((res) => {
- res.data.forEach((a) => {
- a.state = 0;
- });
- row.insProduct = this.HaveJson(res.data);
- this.productList = row.insProduct;
- 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)
- this.$nextTick(() => {
- this.methodCount++;
- this.getProductLoad = false;
- if (this.sampleSelectionList.length == this.methodCount) {
- this.standardLoading = false;
- }
- });
+ if (res.code === 200) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ row.insProduct = this.HaveJson(res.data);
+ this.productList = row.insProduct;
+ 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)
+ this.$nextTick(() => {
+ this.methodCount++;
+ this.getProductLoad = false;
+ if (this.sampleSelectionList.length == this.methodCount) {
+ this.standardLoading = false;
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
this.searchProject();
this.searchTemList();
@@ -3590,60 +4283,56 @@
let selectTreeList = this.selectTree.split(" - ");
this.addObj.model &&
(selectTreeList[selectTreeList.length - 1] = this.addObj.model);
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model:
- (this.addObj.model ? this.addObj.model : row.model) +
- "-" +
- row.modelNum,
- standardMethodListId: val,
- factory: selectTreeList.join(" - "),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model:
+ (this.addObj.model ? this.addObj.model : row.model) +
+ "-" +
+ row.modelNum,
+ standardMethodListId: val,
+ factory: selectTreeList.join(" - "),
+ })
.then((res) => {
- res.data.forEach((a) => {
- a.state = 0;
- });
- row.insProduct = this.HaveJson(res.data);
- this.productList = row.insProduct;
- 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)
- this.$nextTick(() => {
- this.methodCount++;
- this.getProductLoad = false;
- if (this.sampleSelectionList.length == this.methodCount) {
- this.standardLoading = false;
- }
- });
+ if (res.code === 200) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ row.insProduct = this.HaveJson(res.data);
+ this.productList = row.insProduct;
+ 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)
+ this.$nextTick(() => {
+ this.methodCount++;
+ this.getProductLoad = false;
+ if (this.sampleSelectionList.length == this.methodCount) {
+ this.standardLoading = false;
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
this.searchProject();
this.searchTemList();
},
searchTemList() {
this.temperatureList = [];
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "鐢靛姏娓╁害寰幆妫�楠�",
- })
+ getDicts("temperature_cycling_type")
.then((res) => {
- if (res.data.length > 0) {
+ if (res.code === 200) {
this.temperatureEngList = res.data;
res.data.forEach((item) => {
- this.temperatureList.push(item.label);
+ this.temperatureList.push(item.dictLabel);
});
}
+ })
+ .catch((error) => {
+ console.error(error);
});
},
changeModel() {
@@ -3733,10 +4422,14 @@
// })
},
selectStandardMethods() {
- this.$axios
- .get(this.$api.standardTree.selectStandardMethodEnum)
+ selectStandardMethodEnum()
.then((res) => {
- this.methods = res.data;
+ if (res.code === 200) {
+ this.methods = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectable() {
@@ -3918,42 +4611,39 @@
return;
}
this.noLoading = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrderOfState,
- {
- state: 2,
- id: this.currentId,
- tell: this.tell,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ upInsOrderOfState({
+ state: 2,
+ id: this.currentId,
+ tell: this.tell,
+ })
.then((res) => {
- this.noLoading = false;
- this.tell = "";
- if (res.code == 201) return;
- this.$message.success("鎻愪氦鎴愬姛");
- this.issuedDialogVisible = false;
- this.$parent.playOrder(0);
+ if (res.code === 200) {
+ this.noLoading = false;
+ this.tell = "";
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.issuedDialogVisible = false;
+ this.$router.go(-1);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectEnumByCategoryForSonLaboratory() {
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "瀛愬疄楠屽",
- })
+ getDicts("sys_sub_lab")
.then((res) => {
- this.factory = [];
- res.data.forEach((a) => {
- this.filters.push({
- text: a.label,
- value: a.value,
+ if (res.code === 200) {
+ this.factory = [];
+ res.data.forEach((a) => {
+ this.filters.push({
+ text: a.dictLabel,
+ value: a.dictValue,
+ });
});
- });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
filterHandler(value, row, column) {
@@ -3973,24 +4663,28 @@
return;
}
this.sampleIds = [this.sampleId];
- this.$axios
- .post(this.$api.insBushing.selectBushingBySampleId, {
- sampleId: this.sampleId,
- })
+ selectBushingBySampleId({
+ sampleId: this.sampleId,
+ })
.then((res) => {
- if (res.data.length === 0) {
- this.$message.error("璇ユ牱鍝佹病鏈夐厤缃厜绾�");
- return;
- }
- for (var i in this.sampleList) {
- if ((this.sampleList[i].id = this.sampleId)) {
- this.sampleList[i].bushing = res.data;
- break;
+ if (res.code === 200) {
+ if (res.data.length === 0) {
+ this.$message.error("璇ユ牱鍝佹病鏈夐厤缃厜绾�");
+ return;
}
+ for (var i in this.sampleList) {
+ if ((this.sampleList[i].id = this.sampleId)) {
+ this.sampleList[i].bushing = res.data;
+ break;
+ }
+ }
+ this.$nextTick(() => {
+ this.configShow = true;
+ });
}
- this.$nextTick(() => {
- this.configShow = true;
- });
+ })
+ .catch((error) => {
+ console.error(error);
});
}
},
@@ -4006,21 +4700,6 @@
this.$message.error("鏈�変腑鏍峰搧");
return;
}
- // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, {
- // sampleId: this.sampleId
- // }).then(res => {
- // if (res.data.length === 0) {
- // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�')
- // return
- // }
- // for (var i in this.sampleList) {
- // if (this.sampleList[i].id = this.sampleId) {
- // this.sampleList[i].bushing = res.data
- // break
- // }
- // }
- // this.configShow = true
- // })
}
},
openCableConfig() {
@@ -4035,21 +4714,6 @@
this.$message.error("鏈�変腑鏍峰搧");
return;
}
- // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, {
- // sampleId: this.sampleId
- // }).then(res => {
- // if (res.data.length === 0) {
- // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�')
- // return
- // }
- // for (var i in this.sampleList) {
- // if (this.sampleList[i].id = this.sampleId) {
- // this.sampleList[i].bushing = res.data
- // break
- // }
- // }
- // this.configShow = true
- // })
}
},
upBsm1(val) {
--
Gitblit v1.9.3