From 547205132170b818e34406258595b42291c3f2f8 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 26 二月 2025 16:26:51 +0800 Subject: [PATCH] 检验委托单 --- /dev/null | 89 ---- src/api/cnas/process/demand/demand.js | 104 +++-- src/views/CNAS/process/demand/index.vue | 878 ++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 784 insertions(+), 287 deletions(-) diff --git a/src/api/cnas/process/demand/demand.js b/src/api/cnas/process/demand/demand.js index 5ab8327..8d007c1 100644 --- a/src/api/cnas/process/demand/demand.js +++ b/src/api/cnas/process/demand/demand.js @@ -6,55 +6,67 @@ import request from "@/utils/request"; // 濮旀墭鍗曟楠屽垎椤垫煡璇� -export const getInspectionOrder = (params) => { - return request({ - url: "/inspectionOrder/pageInspectionOrder", - method: "get", - params: params - }) +export function pageInspectionOrder(query) { + return request({ + url: '/inspectionOrder/pageInspectionOrder', + method: 'get', + params: query + }) } - +// 濮旀墭鍗曟煡璇㈡垚鍝佽鍗� +export function getInsOrderOnInspection(query) { + return request({ + url: '/inspectionOrder/getInsOrderOnInspection', + method: 'get', + params: query + }) +} +// 濮旀墭鍗曟楠屾柊澧� +export function addInspectionOrder(query) { + return request({ + url: '/inspectionOrder/addInspectionOrder', + method: 'post', + data: query + }) +} +// 濮旀墭鍗曟楠屼慨鏀� +export function updateInspectionOrder(query) { + return request({ + url: '/inspectionOrder/updateInspectionOrder', + method: 'post', + data: query + }) +} // 鏂板鏃舵牴鎹垚鍝佽鍗曟煡璇㈠鎵樺崟璇︽儏 -export const getInspectionOrderByInsOderId = (params) => { - return request({ - url: "/inspectionOrder/getInspectionOrderByInsOderId", - method: "get", - params: params - }) +export function getInspectionOrderByInsOderId(query) { + return request({ + url: '/inspectionOrder/getInspectionOrderByInsOderId', + method: 'get', + params: query + }) } - -// 鏌ヨ鍙柊澧炵殑妫�楠屽崟 -export const getInsOrderOnInspection = (data) => { - return request({ - url: "/inspectionOrder/getInsOrderOnInspection", - method: "post", - data: data - }) +// 濮旀墭鍗曟楠屾煡鐪嬭鎯� +export function getInspectionOrderOne(query) { + return request({ + url: '/inspectionOrder/getInspectionOrderOne', + method: 'get', + params: query + }) } - -// 鏌ョ湅濮旀墭鍗曡鎯� -export const getInspectionOrderOne = (params) => { - return request({ - url: "/inspectionOrder/getInspectionOrderOne", - method: "get", - params: params - }) +// 濮旀墭鍗曟楠屽垹闄� +export function delInspectionOrder(query) { + return request({ + url: '/inspectionOrder/delInspectionOrder', + method: 'get', + params: query + }) } - -// 鏂板妫�楠屽崟 -export const addInspectionOrder = (data) => { - return request({ - url: "/inspectionOrder/addInspectionOrder", - method: "post", - data: data - }) +// 濮旀墭鍗曟楠屽垹闄� +export function exportInspectionOrder(query) { + return request({ + url: '/inspectionOrder/exportInspectionOrder', + method: 'get', + params: query, + responseType: 'blob' + }) } - -// 缂栬緫妫�楠屽崟 -export const editInspectionOrder = (data) => { - return request({ - url: "/inspectionOrder/editInspectionOrder", - method: "post", - data: data - }) -} \ No newline at end of file diff --git a/src/views/CNAS/process/demand/AddContracts.vue b/src/views/CNAS/process/demand/AddContracts.vue deleted file mode 100644 index 22fd026..0000000 --- a/src/views/CNAS/process/demand/AddContracts.vue +++ /dev/null @@ -1,465 +0,0 @@ -<template> - <el-dialog :title="title" :visible.sync="visible" width="1200px"> - <div id="dialogBody"> - <div style="max-height: 75vh;overflow-y: auto;"> - <div id="dialogBody"> - <table border="1" cellpadding="10" class="tables heads"> - <tr> - <td rowspan="2"> - <img alt="" :src="ZTTLogo" style="width: 80%;"> - </td> - <td> - <p>璁板綍鍚嶇О锛氭楠屽鎵樺崟</p> - </td> - <td> - <p>淇濆瓨鏈熼檺锛�6骞�</p> - </td> - </tr> - <tr> - <td> - <p>璁板綍缂栧彿锛� ZTT/QR-16-04-a</p> - </td> - <td> - <p>褰掓。閮ㄩ棬锛氱患鍚堝</p> - </td> - </tr> - </table> - <h4 class="table_h4"> - 妫� 楠� 濮� 鎵� 鍗� - </h4> - <p - v-if="operationType !== 'view'" - style="margin-left: 560px;display: flex;align-items: center"> - <span style="width: 100px">濮旀墭缂栧彿锛�</span> - <el-input clearable size="small"></el-input> - </p> - <p v-else style="margin-top: 16px;margin-left: 600px;"> - 濮旀墭缂栧彿锛歿{ currentInfo.entrustCode }} - </p> - <table border="1" cellpadding="10" class="tables"> - <tr> - <td colspan="2"> - <p>璇曟牱鍚嶇О</p> - </td> - <td > - <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleName" clearable size="small"></el-input> - <span v-else>{{ currentInfo.sampleName }}</span> - </td> - <td> - <p>濮旀墭鏃堕棿</p> - </td> - <td> - <el-date-picker - v-if="operationType !== 'view'" - v-model="currentInfo.commissionDate" - clearable - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd"> - </el-date-picker> - <span v-else>{{ currentInfo.commissionDate }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>鍨� 鍙�</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.modelNo" clearable size="small"></el-input> - <span v-else>{{ currentInfo.modelNo }}</span> - </td> - <td> - <p>濮旀墭鍗曚綅</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUnit" clearable size="small"></el-input> - <span v-else>{{ currentInfo.commissionUnit }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>鐢熶骇鍗曚綅</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.production" clearable size="small"></el-input> - <span v-else>{{ currentInfo.production }}</span> - </td> - <td> - <p>濮旀墭浜�</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input> - <span v-else>{{ currentInfo.commissionUser }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>鏍峰搧鏁伴噺</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.quantity" clearable size="small"></el-input> - <span v-else>{{ currentInfo.quantity }}</span> - </td> - <td> - <p>鏍峰搧鐘舵��</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleStatus" clearable size="small"></el-input> - <span v-else>{{ insStateList.find(m=>m.value==currentInfo.sampleStatus)?insStateList.find(m=>m.value==currentInfo.sampleStatus).label:'/' }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>鏄惁鐣欐牱</p> - </td> - <td> - <el-radio-group - v-if="operationType !== 'view'" - v-model="currentInfo.isLeave" - > - <el-radio :label="1">鏄�</el-radio> - <el-radio :label="0">鍚�</el-radio> - </el-radio-group> - <div v-else> - <span v-if="currentInfo.isLeave==1">鏄�</span> - <span v-else>鍚�</span> - </div> - </td> - <td> - <p>鏍峰搧澶勭悊鏂瑰紡</p> - </td> - <td v-if="operationType !== 'view'"> - <el-radio-group v-model="currentInfo.processing"> - <el-radio :label="0">濮旀墭鍗曚綅鍙栧洖</el-radio> - <el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio> - </el-radio-group> - </td> - <td v-else> - <span v-if="currentInfo.processing==0">濮旀墭鍗曚綅鍙栧洖</span> - <span v-else>瀹為獙瀹ゅ鐞�</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>绾﹀畾瀹屾垚鏃堕棿(鎶ュ憡鏃ユ湡)</p> - </td> - <td> - <el-date-picker - v-if="operationType !== 'view'" - v-model="currentInfo.appointed" - clearable - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd"> - </el-date-picker> - <span v-else> - {{ currentInfo.appointed }} - </span> - </td> - <td> - <p>鎶ュ憡鍙戦�佹柟寮�</p> - </td> - <td > - <el-radio-group - v-if="operationType !== 'view'" - v-model="currentInfo.send" - > - <el-radio :label="1">鑷彇</el-radio> - <el-radio :label="0">鍏朵粬</el-radio> - </el-radio-group> - <div v-else> - <span v-if="currentInfo.send==1">鑷彇</span> - <span v-else>鍏朵粬</span> - </div> - </td> - </tr> - <el-button class="add_btn" size="small" type="primary" @click="addOrderDetailList">娣诲姞</el-button> - <tr> - <td> - <p>搴忓彿</p> - </td> - <td> - <p>鏍峰搧缂栧彿</p> - </td> - <td> - <p>璇曢獙椤圭洰</p> - </td> - <td> - <p>妫�楠屼緷鎹�</p> - </td> - <td> - <p>澶囨敞</p> - </td> - </tr> - <tr v-for="(item,index) in currentInfo.orderDetailList" :key="index" > - <td>{{ index+1 }}</td> - <td> - <el-input v-if="operationType !== 'view'" v-model="item.sampleNumber" clearable size="small"></el-input> - <span v-else>{{ item.sampleNumber }}</span> - </td> - <td> - <el-input v-if="operationType !== 'view'"v-model="item.testItem" clearable size="small"></el-input> - <span v-else>{{ item.testItem }}</span> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="item.testStandard" clearable size="small"></el-input> - <span v-else>{{ item.testStandard }}</span> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="item.remark" clearable size="small"></el-input> - <span v-else>{{ item.remark }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>鍒ゅ畾瑙勫垯</p> - </td> - <td v-if="operationType !== 'view'" colspan="3"> - <el-radio-group v-model="currentInfo.criterionRule"> - <el-radio :label="0">涓嶈�冭檻涓嶇‘瀹氬害</el-radio> - <el-radio :label="1">鑰冭檻涓嶇‘瀹氬害</el-radio> - </el-radio-group> - <span v-if="currentInfo.criterionRule === 1"> - <el-input v-model="currentInfo.criterionRuleRemark" clearable size="small" style="width: 60px"></el-input> - % - </span> - </td> - <td v-else colspan="3"> - <span v-if="currentInfo.criterionRule===0">涓嶈�冭檻涓嶇‘瀹氬害</span> - <span v-if="currentInfo.criterionRule===1">鑰冭檻涓嶇‘瀹氬害</span> - <span v-if="currentInfo.criterionRule===1">{{ currentInfo.criterionRuleRemark + '%' }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>濮旀墭浜虹鍚�</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input> - <span v-else>{{currentInfo.commissionUser}}</span> - </td> - <td> - <p>濮旀墭鏃ユ湡</p> - </td> - <td> - <el-date-picker - v-if="operationType !== 'view'" - v-model="currentInfo.commissionDate" - clearable - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd"> - </el-date-picker> - <span v-else>{{ currentInfo.commissionDate }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>濮旀墭浜鸿仈绯荤數璇�</p> - </td> - <td colspan="3"> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionPhone" clearable size="small"></el-input> - <span v-else>{{ currentInfo.commissionPhone }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>缁煎悎瀹ょ鍚�</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.generalOfficeUser" clearable size="small"></el-input> - <span v-else>{{currentInfo.generalOfficeUser}}</span> - </td> - <td> - <p>鎺ユ敹鏃ユ湡</p> - </td> - <td> - <el-date-picker - v-if="operationType !== 'view'" - v-model="currentInfo.receiptData" - clearable - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd"> - </el-date-picker> - <span v-else>{{ currentInfo.receiptData }}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <p>棰嗘牱鍛樼鍚�</p> - </td> - <td> - <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleTakerUser" clearable size="small"></el-input> - <span v-else>{{ currentInfo.sampleTakerUser }}</span> - </td> - <td> - <p>棰嗘牱鏃ユ湡</p> - </td> - <td v-if="operationType !== 'view'"> - <el-date-picker - v-model="currentInfo.sampleData" - clearable - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd"> - </el-date-picker> - </td> - <td v-else>{{ currentInfo.sampleData }}</td> - </tr> - <tr> - <td colspan="2" rowspan="3"> - <p>妫�娴嬫満鏋勪俊鎭�</p> - </td> - <td colspan="3"> - <p>姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</p> - </td> - </tr> - <tr> - <td colspan="3"> - <p>鍦板潃锛氭睙鑻忕渷鍗楅�氬競缁忔祹鎶�鏈紑鍙戝尯鏂板紑鍗楄矾 19 鍙�</p> - </td> - </tr> - <tr> - <td colspan="3"> - <p>鐢佃瘽锛�0513-89059043</p> - </td> - </tr> - </table> - <p style="margin-top: 10px;margin-left: 20px;">娉細鏈楠屽鎵樺崟涓�寮忎簩浠斤紝涓�浠界患鍚堝褰掓。锛屼竴浠藉鎵樺崟浣嶇暀瀛樸��</p> - </div> - </div> - </div> - <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer"> - <el-button @click="detailDialogVisible = false">鍙� 娑�</el-button> - <el-button :loading="buttonLoading" type="primary" @click="handleSubmit"> - 纭� 瀹� - </el-button> - </span> - </el-dialog> -</template> -<script> -import ZTTLogo from "@/assets/logo/ZTTlogo.png" -import { getInspectionOrderByInsOderId, getInspectionOrderOne, addInspectionOrder, editInspectionOrder } from "@/api/cnas/process/demand/demand.js" - -export default { - name: 'AddContracts', - props: { - operationType: { - type: String, - default: '' - }, - }, - data() { - return { - title: '', - ZTTLogo, - visible: false, - currentInfo:{ - orderDetailList: [] - }, - buttonLoading: false - } - }, - methods: { - open(row) { - this.visible = true - if(operationType == 'add') { - this.goAddOrder(row) - } else { - - } - }, - // 鎵撳紑寮圭獥鐨勬椂鍊欙紝鏌ヨ闇�瑕佹柊澧炵殑濮旀墭鍗曡鎯� - async goAddOrder(row) { - this.title = '鏂板妫�楠屽鎵樺崟'; - const { code, data } = await getInspectionOrderByInsOderId({ - insOrderId: row.id - }) - if(code == 200) { - this.currentInfo = res.data - this.detailDialogVisible = true - } - }, - async goUpdateOrder(row) { - this.title = '缂栬緫妫�楠屽鎵樺崟'; - const { code, data } = await getInspectionOrderOne({ - insOrderId: row.inspectionOrderId - }) - if(code == 200) { - this.currentInfo = res.data - this.detailDialogVisible = true - } - }, - addOrderDetailList() { - if (this.currentInfo.orderDetailList == null) { - this.currentInfo.orderDetailList = [] - } - this.currentInfo.orderDetailList.push({ - sampleNumber: '', - testItem: '', - testStandard: '', - standardMethodList: '', - remark: '', - }) - }, - - async handleSubmit() { - this.operationType == 'add' ? await addInspectionOrder(this.currentInfo) : await editInspectionOrder(this.currentInfo) - } - } -} -</script> -<style lang="scss" scoped> -.tables { - table-layout: fixed; - width: 100%; - margin-top: 10px; - border-collapse: collapse; /* 鍏抽敭灞炴�э細鍚堝苟杈规 */ - td { - height: 40px; - width: 100px; - text-align: center; - font-size: 14px; - word-wrap: break-word; - white-space: normal; - p { - margin: unset - } - } -} -.heads { - td { - border: 1px dashed black; /* 鍗曞厓鏍肩殑铏氱嚎 */ - padding: 8px; - text-align: left; - } -} -.table_h4 { - display: flex; - align-items: center; - flex-direction: column; - justify-content: center; - font-size: 28px; - font-weight: bold; - margin: 10px 0 10px 0; -} -.add_btn { - margin: 10px 0 10px 10px; -} -</style> \ No newline at end of file diff --git a/src/views/CNAS/process/demand/Edit.vue b/src/views/CNAS/process/demand/Edit.vue deleted file mode 100644 index 46f3efa..0000000 --- a/src/views/CNAS/process/demand/Edit.vue +++ /dev/null @@ -1,89 +0,0 @@ -<template> - <div> - <el-dialog title="鏂板妫�楠屼换鍔″崟" :visible.sync="visible"> - <el-form :model="search" :inline="true"> - <el-form-item label="濮旀墭缂栧彿锛�"> - <el-input placeholder="璇疯緭鍏ュ鎵樼紪鍙�"></el-input> - </el-form-item> - <el-form-item> - <el-button type="primary">鏌� 璇�</el-button> - <el-button>閲� 缃�</el-button> - </el-form-item> - </el-form> - <lims-table - :column="column" - :tableData="tableData" - :page="page" - /> - </el-dialog> - <AddContracts ref="addContractsRef" :operationType="operationType" /> - </div> -</template> - -<script> - import limsTable from "@/components/Table/lims-table.vue"; - import AddContracts from "./AddContracts.vue"; - import { getInsOrderOnInspection } from "@/api/cnas/process/demand/demand.js" - - export default { - name: 'EditDemand', - components: { - limsTable, - AddContracts - }, - data() { - return { - visible: false, - search: {}, - operationType: '', - column: [ - { label: '搴忓彿', minWidth: '100px' }, - { label: '濮旀墭缂栧彿', minWidth: '100px' }, - { label: '鏍峰搧鍚嶇О', minWidth: '100px' }, - { - dataType: "action", - fixed: "right", - label: "鎿嶄綔", - operation: [ - { - name: "鏂板濮旀墭鍗�", - type: "text", - clickFun: (row) => { - this.operationType = 'add' - this.$refs.addContractsRef.open(row) - } - } - ], - }, - ], - tableData: [{}], - page: { - total: 0, - size: 10, - current: 1, - }, - } - }, - // 鎵撳紑寮圭獥 - methods: { - open(type) { - this.visible = true - this.operationType = type - this.getTableData() - }, - openAddContracts(row) { - this.operationType = 'edit' - this.$refs.addContractsRef.open(row) - }, - async getTableData() { - // 鏌ヨ褰撳墠寮圭獥琛ㄦ暟鎹� - const { code, data } = await getInsOrderOnInspection({ - ...this.search, ...this.page - }) - if (code === 200) { - this.tableData = data - } - } - } - } -</script> \ No newline at end of file diff --git a/src/views/CNAS/process/demand/index.vue b/src/views/CNAS/process/demand/index.vue index 137aba5..9667ffa 100644 --- a/src/views/CNAS/process/demand/index.vue +++ b/src/views/CNAS/process/demand/index.vue @@ -1,163 +1,737 @@ -<style lang="scss" scoped> -.standard_method { - padding: 20px; -} -.search { - background-color: #fff; - height: 80px; - display: flex; - align-items: center; -} - -.search_thing { -// width: 350px; - display: flex; - align-items: center; -} - -.search_label { - width: 110px; - font-size: 14px; - text-align: right; -} - -.search_input { - width: calc(100% - 110px); -} - -.table { - margin-top: 10px; - background-color: #fff; - width: calc(100% - 40px); - height: calc(100% - 60px - 80px - 10px - 40px); - padding: 20px; -} -</style> - <template> - <div class="standard_method"> - <el-form :model="model" :inline="true" label-width="auto"> - <el-form-item label="璇曟牱鍚嶇О锛�"> - <el-input size="small" - placeholder="璇疯緭鍏�" - clearable - @change="refreshTable()" - /> - </el-form-item> - <el-form-item label="濮旀墭鍗曚綅锛�"> - <el-input size="small" - placeholder="璇疯緭鍏�" - clearable - @change="refreshTable()" - /> - </el-form-item> - <el-form-item label="鐢熶骇鍗曚綅锛�"> - <el-input size="small" - placeholder="璇疯緭鍏�" - clearable - @change="refreshTable()" - /> - </el-form-item> - <el-form-item label="濮旀墭浜猴細"> - <el-input size="small" - placeholder="璇疯緭鍏�" - clearable - @change="refreshTable()" - /> - </el-form-item> - <el-form-item> - <el-button size="small"> - 閲� 缃� - </el-button> - <el-button size="small" type="primary"> - 鏌� 璇� - </el-button> - </el-form-item> - </el-form> - <div style="margin-bottom: 10px"> - <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog('add')"> - 鏂� 澧� - </el-button> - </div> - <lims-table - :column="column" - :tableData="tableData" - :height="'calc(100vh - 250px)'" - :page="page" - /> - <Edit ref="editRef" /> + <div class="app-container"> + <div style="display: flex;justify-content: space-between;"> + <el-form :model="entitySearch" ref="entitySearch" size="small" :inline="true"> + <el-form-item label="璇曟牱鍚嶇О" prop="sampleName"> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entitySearch.sampleName" + @keyup.enter.native="refreshTable"></el-input> + </el-form-item> + <el-form-item label="濮旀墭鍗曚綅" prop="commissionUnit"> + <el-input v-model="entitySearch.commissionUnit" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable()"></el-input> + </el-form-item> + <el-form-item label="鐢熶骇鍗曚綅" prop="production"> + <el-input v-model="entitySearch.production" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable()"></el-input> + </el-form-item> + <el-form-item label="濮旀墭浜�" prop="commissionUser"> + <el-input v-model="entitySearch.commissionUser" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable()"></el-input> + </el-form-item> + <el-form-item> + <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button> + <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button> + </el-form-item> + </el-form> </div> + <div style="text-align: right; margin-bottom: 20px"> + <el-button size="medium" type="primary" @click="goAdd">鏂板</el-button> + </div> + <div class="table"> + <el-table v-loading="tableListLoading" :data="tableList" height="530" style="width: 100%"> + <el-table-column align="center" label="搴忓彿" type="index" width="60"></el-table-column> + <el-table-column label="璇曟牱鍚嶇О" prop="sampleName" show-overflow-tooltip width="120"></el-table-column> + <el-table-column label="濮旀墭缂栧彿" prop="entrustCode" show-overflow-tooltip width="120"></el-table-column> + <el-table-column label="濮旀墭鏃堕棿" prop="commissionDate" width="120"></el-table-column> + <el-table-column label="鍨嬪彿" prop="modelNo"></el-table-column> + <el-table-column label="濮旀墭鍗曚綅" prop="commissionUnit" show-overflow-tooltip width="120"></el-table-column> + <el-table-column label="鐢熶骇鍗曚綅" prop="production" show-overflow-tooltip width="120"></el-table-column> + <el-table-column label="濮旀墭浜�" prop="commissionUser"></el-table-column> + <el-table-column label="鏍峰搧鏁伴噺" prop="quantity"></el-table-column> + <el-table-column label="鏍峰搧鐘舵��" prop="sampleStatus"></el-table-column> + <el-table-column label="鏄惁鐣欐牱" prop="isLeave"> + <template slot-scope="scope"> + <span v-if="scope.row.isLeave === 1">鏄�</span> + <span v-if="scope.row.isLeave === 0">鍚�</span> + </template> + </el-table-column> + <el-table-column label="鏍峰搧澶勭悊鏂瑰紡" prop="processing"> + <template slot-scope="scope"> + <span v-if="scope.row.processing === 1">瀹為獙瀹ゅ鐞�</span> + <span v-if="scope.row.processing === 0">濮旀墭鍗曚綅鍙栧洖</span> + </template> + </el-table-column> + <el-table-column align="center" label="鎿嶄綔" width="240" fixed="right"> + <template slot-scope="scope"> + <el-button size="mini" type="text" @click="goUpdate(scope.row)">缂栬緫</el-button> + <el-button size="mini" type="text" @click="handleLook(scope.row)">鏌ョ湅</el-button> + <el-button size="mini" style="color:#F56C6C" type="text" @click="deleteOrder(scope.row)">鍒犻櫎</el-button> + <el-button size="mini" type="text" @click="openDownloadDia(scope.row)">涓嬭浇</el-button> + <el-upload ref='upload' + :action="action" + :data="{inspectionOrderId: scope.row.inspectionOrderId}" :headers="uploadHeader" + :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" accept='image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx,.xlsx' + name="file" style="background: transparent;display: inline;margin-left: 4px"> + <span style="color: #409EFF">涓婁紶</span> + </el-upload> + </template> + </el-table-column> + </el-table> + <el-pagination :current-page="1" :page-size="pages.size" :page-sizes="[10, 20, 30, 50, 100]" + :total="total1" layout="->,total, sizes, prev, pager, next" + style="margin-top: 10px" background + @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> + </el-pagination> + </div> + <el-dialog + :close-on-click-modal="false" :close-on-press-escape="false" + :visible.sync="orderRowsVisible" title="鏂板妫�楠屼换鍔″崟" width="1000px"> + <div style="display: flex; align-items: center;margin-bottom: 10px"> + <span style="width: 80px">濮旀墭缂栧彿锛�</span> + <el-input v-model="entity.entrustCode" clearable size="small" style="width: 300px;margin-right: 10px"></el-input> + <el-button size="small" type="primary" @click="searchTableData">鏌ヨ</el-button> + <el-button size="small" @click="refreshTableData">閲� 缃�</el-button> + </div> + <el-table v-loading="tableLoading" :data="tableData" height="550" style="width: 100%"> + <el-table-column align="center" label="搴忓彿" type="index" width="60"></el-table-column> + <el-table-column label="濮旀墭缂栧彿" prop="entrustCode"></el-table-column> + <el-table-column label="鏍峰搧鍚嶇О" prop="sample"></el-table-column> + <el-table-column align="center" label="鎿嶄綔"> + <template slot-scope="scope"> + <el-button align="center" size="mini" type="text" @click="goAddOrder(scope.row)">鏂板濮旀墭鍗�</el-button> + </template> + </el-table-column> + </el-table> + <el-pagination :current-page="1" :page-size="tableSearch.size" :page-sizes="[10, 20, 30, 50, 100]" + :total="total" layout="->,total, sizes, prev, pager, next" + style="margin-top: 10px" background + @size-change="handleSizeChange" @current-change="handleCurrentChange"> + </el-pagination> + </el-dialog> + <el-dialog + :class="{downPdf:title=='涓嬭浇'}" :close-on-click-modal="false" + :close-on-press-escape="false" + :modal="title!='涓嬭浇'" :title="title" :visible.sync="detailDialogVisible" top="20px" width="1200px"> + <div style="max-height: 75vh;overflow-y: auto;"> + <div id="dialogBody"> + <table border="1" cellpadding="10" class="tables heads" style="border: 1px dashed black;"> + <tr> + <td rowspan="2"> + <img alt="" src="@/assets/logo/ZTTlogo.png" style="width: 80%;"> + </td> + <td> + <p>璁板綍鍚嶇О锛氭楠屽鎵樺崟</p> + </td> + <td> + <p>淇濆瓨鏈熼檺锛�6骞�</p> + </td> + </tr> + <tr> + <td> + <p>璁板綍缂栧彿锛� ZTT/QR-16-04-a</p> + </td> + <td> + <p>褰掓。閮ㄩ棬锛氱患鍚堝</p> + </td> + </tr> + </table> + <h4 style="display: flex;align-items: center;flex-direction: column;justify-content: center;"> + <span style="font-size: 28px;">妫� 楠� 濮� 鎵� 鍗�</span> + </h4> + <p v-if="operationType !== 'view'" style="margin-left: 560px;display: flex;align-items: center"> + <span style="width: 100px">濮旀墭缂栧彿锛�</span> + <el-input v-model="currentInfo.entrustCode" clearable size="small"></el-input> + </p> + <p v-if="operationType === 'view'" style="margin-top: 16px;margin-left: 600px;">濮旀墭缂栧彿锛歿{ currentInfo.entrustCode }}</p> + <table border="1" cellpadding="10" class="tables"> + <tr> + <td colspan="2"> + <p>璇曟牱鍚嶇О</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleName" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.sampleName }}</td> + <td> + <p>濮旀墭鏃堕棿</p> + </td> + <td v-if="operationType !== 'view'"> + <el-date-picker + v-model="currentInfo.commissionDate" + clearable + format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + size="small" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + <td v-if="operationType === 'view'">{{ currentInfo.commissionDate }}</td> + </tr> + <tr> + <td colspan="2"> + <p>鍨� 鍙�</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.modelNo" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.modelNo }}</td> + <td> + <p>濮旀墭鍗曚綅</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUnit" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.commissionUnit }}</td> + </tr> + <tr> + <td colspan="2"> + <p>鐢熶骇鍗曚綅</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.production" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.production }}</td> + <td> + <p>濮旀墭浜�</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.commissionUser }}</td> + </tr> + <tr> + <td colspan="2"> + <p>鏍峰搧鏁伴噺</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.quantity" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.quantity }}</td> + <td> + <p>鏍峰搧鐘舵��</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleStatus" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ insStateList.find(m=>m.value==currentInfo.sampleStatus)?insStateList.find(m=>m.value==currentInfo.sampleStatus).label:'/' }}</td> + </tr> + <tr> + <td colspan="2"> + <p>鏄惁鐣欐牱</p> + </td> + <td v-if="operationType !== 'view'"> + <el-radio-group v-model="currentInfo.isLeave" v-removeAriaHidden> + <el-radio :label="1">鏄�</el-radio> + <el-radio :label="0">鍚�</el-radio> + </el-radio-group> + </td> + <td v-if="operationType === 'view'"> + <span v-if="currentInfo.isLeave==1">鏄�</span> + <span v-else>鍚�</span> + </td> + <td> + <p>鏍峰搧澶勭悊鏂瑰紡</p> + </td> + <td v-if="operationType !== 'view'"> + <el-radio-group v-model="currentInfo.processing" v-removeAriaHidden> + <el-radio :label="0">濮旀墭鍗曚綅鍙栧洖</el-radio> + <el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio> + </el-radio-group> + </td> + <td v-if="operationType === 'view'"> + <span v-if="currentInfo.processing==0">濮旀墭鍗曚綅鍙栧洖</span> + <span v-else>瀹為獙瀹ゅ鐞�</span> + </td> + </tr> + <tr> + <td colspan="2"> + <p>绾﹀畾瀹屾垚鏃堕棿(鎶ュ憡鏃ユ湡)</p> + </td> + <td v-if="operationType !== 'view'"> + <el-date-picker + v-model="currentInfo.appointed" + clearable + format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + size="small" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + <td v-if="operationType === 'view'">{{ currentInfo.appointed }}</td> + <td> + <p>鎶ュ憡鍙戦�佹柟寮�</p> + </td> + <td v-if="operationType !== 'view'"> + <el-radio-group v-model="currentInfo.send" v-removeAriaHidden> + <el-radio :label="1">鑷彇</el-radio> + <el-radio :label="0">鍏朵粬</el-radio> + </el-radio-group> + </td> + <td v-if="operationType === 'view'"> + <span v-if="currentInfo.send==1">鑷彇</span> + <span v-else>鍏朵粬</span> + </td> + </tr> + <el-button size="small" type="primary" @click="addOrderDetailList" v-if="operationType !== 'view'">娣诲姞</el-button> + <tr> + <td> + <p>搴忓彿</p> + </td> + <td> + <p>鏍峰搧缂栧彿</p> + </td> + <td> + <p>璇曢獙椤圭洰</p> + </td> + <td> + <p>妫�楠屼緷鎹�</p> + </td> + <td> + <p>澶囨敞</p> + </td> + </tr> + <tr v-for="(item,index) in currentInfo.orderDetailList" :key="index" > + <td>{{ index+1 }}</td> + <td v-if="operationType !== 'view'"><el-input v-model="item.sampleNumber" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ item.sampleNumber }}</td> + <td v-if="operationType !== 'view'"><el-input v-model="item.testItem" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ item.testItem }}</td> + <td v-if="operationType !== 'view'"><el-input v-model="item.testStandard" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ item.testStandard }}</td> + <td v-if="operationType !== 'view'"><el-input v-model="item.remark" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ item.remark }}</td> + </tr> + <tr> + <td colspan="2"> + <p>鍒ゅ畾瑙勫垯</p> + </td> + <td v-if="operationType !== 'view'" colspan="3"> + <el-radio-group v-model="currentInfo.criterionRule" v-removeAriaHidden> + <el-radio :label="0">涓嶈�冭檻涓嶇‘瀹氬害</el-radio> + <el-radio :label="1">鑰冭檻涓嶇‘瀹氬害</el-radio> + </el-radio-group> + <span v-if="currentInfo.criterionRule === 1"><el-input v-model="currentInfo.criterionRuleRemark" clearable size="small" style="width: 60px"></el-input>%</span> + </td> + <td v-if="operationType === 'view'" colspan="3"> + <span v-if="currentInfo.criterionRule===0">涓嶈�冭檻涓嶇‘瀹氬害</span> + <span v-if="currentInfo.criterionRule===1">鑰冭檻涓嶇‘瀹氬害</span> + <span v-if="currentInfo.criterionRule===1">{{ currentInfo.criterionRuleRemark + '%' }}</span> + </td> + </tr> + <tr> + <td colspan="2"> + <p>濮旀墭浜虹鍚�</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'"> + {{currentInfo.commissionUser}} + </td> + <td> + <p>濮旀墭鏃ユ湡</p> + </td> + <td v-if="operationType !== 'view'"> + <el-date-picker + v-model="currentInfo.commissionDate" + clearable + format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + size="small" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + <td v-if="operationType === 'view'">{{ currentInfo.commissionDate }}</td> + </tr> + <tr> + <td colspan="2"> + <p>濮旀墭浜鸿仈绯荤數璇�</p> + </td> + <td v-if="operationType !== 'view'" colspan="3"><el-input v-model="currentInfo.commissionPhone" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'" colspan="3">{{ currentInfo.commissionPhone }}</td> + </tr> + <tr> + <td colspan="2"> + <p>缁煎悎瀹ょ鍚�</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.generalOfficeUser" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{currentInfo.generalOfficeUser}}</td> + <td> + <p>鎺ユ敹鏃ユ湡</p> + </td> + <td v-if="operationType !== 'view'"> + <el-date-picker + v-model="currentInfo.receiptData" + clearable + format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + size="small" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + <td v-if="operationType === 'view'">{{ currentInfo.receiptData }}</td> + </tr> + <tr> + <td colspan="2"> + <p>棰嗘牱鍛樼鍚�</p> + </td> + <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleTakerUser" clearable size="small"></el-input></td> + <td v-if="operationType === 'view'">{{ currentInfo.sampleTakerUser }}</td> + <td> + <p>棰嗘牱鏃ユ湡</p> + </td> + <td v-if="operationType !== 'view'"> + <el-date-picker + v-model="currentInfo.sampleData" + clearable + format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + size="small" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </td> + <td v-if="operationType === 'view'">{{ currentInfo.sampleData }}</td> + </tr> + <tr> + <td colspan="2" rowspan="3"> + <p>妫�娴嬫満鏋勪俊鎭�</p> + </td> + <td colspan="3"> + <p>姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</p> + </td> + </tr> + <tr> + <td colspan="3"> + <p>鍦板潃锛氭睙鑻忕渷鍗楅�氬競缁忔祹鎶�鏈紑鍙戝尯鏂板紑鍗楄矾 19 鍙�</p> + </td> + </tr> + <tr> + <td colspan="3"> + <p>鐢佃瘽锛�0513-89059043</p> + </td> + </tr> + </table> + <p style="margin-top: 10px;margin-left: 20px;">娉細鏈楠屽鎵樺崟涓�寮忎簩浠斤紝涓�浠界患鍚堝褰掓。锛屼竴浠藉鎵樺崟浣嶇暀瀛樸��</p> + </div> + </div> + <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer"> + <el-button @click="detailDialogVisible = false">鍙� 娑�</el-button> + <el-button v-if="operationType === 'add'" :loading="buttonLoading" type="primary" @click="handleAdd">纭� 瀹�</el-button> + <el-button v-if="operationType === 'edit'" :loading="buttonLoading" type="primary" @click="handleEdit">纭� 瀹�</el-button> + </span> + </el-dialog> + <el-dialog :visible.sync="downloadDialog" title="涓嬭浇" width="600px"> + <span> + <el-button :loading="outLoading" plain type="primary" @click="orderReportDown">涓嬭浇濮旀墭鍗�</el-button> + <el-button :loading="outLoading" plain type="primary" @click="orderFormDown">涓嬭浇濮旀墭鎶ュ憡</el-button> + </span> + <span slot="footer" class="dialog-footer"> + <el-button @click="downloadDialog = false">鍙� 娑�</el-button> + </span> + </el-dialog> + </div> </template> <script> +import { + addInspectionOrder, delInspectionOrder, exportInspectionOrder, + getInsOrderOnInspection, getInspectionOrderByInsOderId, getInspectionOrderOne, + pageInspectionOrder, + updateInspectionOrder +} from "@/api/cnas/process/demand/demand"; import limsTable from "@/components/Table/lims-table.vue"; -import Edit from './Edit.vue' -import { getInspectionOrder } from "@/api/cnas/process/demand/demand.js" +import {selectUserCondition} from "@/api/business/inspectionTask"; export default { - name: 'Demand', - components: { - limsTable, - Edit - }, - data() { - return { - queryParams: { - code: '' - }, - model: {}, - column: [ - { label: '搴忓彿', minWidth: '100px' }, - { label: '璇曟牱鍚嶇О', minWidth: '100px' }, - { label: '濮旀墭缂栧彿' }, - { label: '濮旀墭鏃堕棿' }, - { label: '鍨嬪彿' }, - { label: '濮旀墭鍗曚綅' }, - { label: '鐢熶骇鍗曚綅' }, - { label: '濮旀墭浜�' }, - { label: '鏍峰搧鏁伴噺' }, - { label: '鏍峰搧鐘舵��' }, - { label: '鏄惁鐣欐牱' }, - { label: '鏍峰搧澶勭悊鏂瑰紡' }, - { - dataType: "action", - fixed: "right", - label: "鎿嶄綔", - operation: [ - { - name: "缂� 杈�", - type: "text", - clickFun: (row) => { - this.$refs.editRef.openAddContracts(row) - } - } - ], - }, - ], - tableData: [], // 琛ㄦ牸鏁版嵁 - page: { - total: 0, - size: 10, - current: 1, - }, - } - }, - mounted() { - this.refreshTable() - }, - methods: { - /** - * @desc 鍒锋柊琛ㄦ牸 - */ - async refreshTable() { - await getInspectionOrder({ ...this.page }) + name: "a7-Inspection-Order-Form", + components: {limsTable}, + data() { + return { + title:'妫�楠屽鎵樺崟', + detailDialogVisible:false, + addLoading:false, + outLoading:false, + currentInfo:{ + orderDetailList: [] + }, + personList:[], + insStateList:[ + { + label: '寰呭鏍�', + value: 0 + }, { + label: '寰呮楠�', + value: 1 }, - /** - * @desc 鎵撳紑妯℃�佹 - */ - openDialog(type) { - this.$refs.editRef.open(type) - } + { + label: '宸叉楠�', + value: 4 + }, + { + label: '閫�鍥�', + value: 2 + }, + { + label: '鎾ら攢', + value: 3 + }, + ], + operationType: '', + orderRowsVisible: false, + tableList: [], + tableListLoading: false, + pages: { + current: 1, + size: 20, + }, + tableData: [], + tableLoading: false, + tableSearch: { + current: 1, + size: 20, + }, + total: 0, + total1: 0, + entity: { + entrustCode: '' + }, + entitySearch: { + sampleName: '', + commissionUnit: '', + production: '', + commissionUser: '', + }, + buttonLoading: false, + downloadDialog: false, + download: {}, + }; + }, + mounted() { + // this.getPower() + this.getAuthorizedPerson() + this.refreshTable() + }, + computed: { + action() { + return this.javaApi + '/inspectionOrder/uploadInspectionOrderFile' } + }, + methods: { + addOrderDetailList () { + if (this.currentInfo.orderDetailList == null) { + this.currentInfo.orderDetailList = [] + } + this.currentInfo.orderDetailList.push({ + sampleNumber: '', + testItem: '', + testStandard: '', + standardMethodList: '', + remark: '', + }) + }, + // 鏌ヨ鍒楄〃 + refreshTable() { + this.tableListLoading = true + pageInspectionOrder({ + ...this.pages, + ...this.entitySearch + }).then(res => { + this.tableListLoading = false + this.tableList = res.data.records + this.total1 = res.data.total + }).catch(err => { + this.tableListLoading = false + }) + }, + // 閲嶇疆 + refresh() { + this.entitySearch = { + sampleName: '', + commissionUnit: '', + production: '', + commissionUser: '', + } + this.pages = { + current: 1, + size: 20, + } + this.refreshTable() + }, + // 鎵撳紑鏂板寮规 + goAdd () { + this.operationType = 'add' + this.title = '鏂板妫�楠屽鎵樺崟'; + this.orderRowsVisible = true + this.searchTableData() + }, + // 鏌ヨ鍙柊澧炵殑妫�楠屽崟 + searchTableData () { + this.tableLoading = true + getInsOrderOnInspection({ + ...this.tableSearch, + ...this.entity + }).then(res => { + this.tableLoading = false + this.tableData = res.data.records + this.total = res.data.total + }).catch(err => { + this.tableLoading = false + }) + }, + // 閲嶇疆妫�楠屽崟鍒楄〃 + refreshTableData () { + this.entity = { + entrustCode: '' + } + this.tableSearch = { + current: 1, + size: 20, + } + this.searchTableData() + }, + // 妫�楠屽崟鍒楄〃鍒嗛〉 + handleSizeChange(val) { + this.tableSearch.size = val + this.searchTableData(); + }, + handleCurrentChange(val) { + this.tableSearch.current = val + this.searchTableData(); + }, + // 鍒楄〃鍒嗛〉 + handleSizeChange1(val) { + this.pages.size = val + this.refreshTable(); + }, + handleCurrentChange1(val) { + this.pages.current = val + this.refreshTable(); + }, + // 鎻愪氦鏂板 + handleAdd () { + this.buttonLoading = true + addInspectionOrder(this.currentInfo).then(res => { + this.buttonLoading = false + this.$message.success('鏂板鎴愬姛') + this.detailDialogVisible = false + this.orderRowsVisible = false + this.refreshTable() + }).catch(err => { + this.buttonLoading = false + }) + }, + // 鎻愪氦淇敼 + handleEdit () { + this.buttonLoading = true + updateInspectionOrder(this.currentInfo).then(res => { + this.buttonLoading = false + if (res.code === 201) return + this.$message.success('鏂板鎴愬姛') + this.detailDialogVisible = false + this.orderRowsVisible = false + this.refreshTable() + }).catch(err => { + this.buttonLoading = false + }) + }, + // 鏌ヨ闇�瑕佹柊澧炵殑濮旀墭鍗曡鎯� + goAddOrder (row) { + getInspectionOrderByInsOderId({insOrderId: row.id}).then(res => { + this.currentInfo = res.data + this.title = '鏂板妫�楠屽鎵樺崟'; + this.detailDialogVisible = true + }).catch(err => { + console.log('err----', err) + }) + }, + // 鎵撳紑缂栬緫寮规 + goUpdate (row) { + this.operationType = 'edit' + getInspectionOrderOne({inspectionOrderId: row.inspectionOrderId}).then(res => { + this.currentInfo = res.data + this.title = '缂栬緫妫�楠屽鎵樺崟'; + this.detailDialogVisible = true + }).catch(err => { + console.log('err----', err) + }) + }, + // 鏌ョ湅 + handleLook(row){ + this.operationType = 'view' + getInspectionOrderOne({inspectionOrderId: row.inspectionOrderId}).then(res => { + this.currentInfo = res.data + this.title = '鏌ョ湅妫�楠屽鎵樺崟'; + this.detailDialogVisible = true + }).catch(err => { + console.log('err----', err) + }) + }, + // 鍒犻櫎 + deleteOrder (row) { + this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delInspectionOrder({inspectionOrderId: row.inspectionOrderId}).then(res => { + this.$message.success('鍒犻櫎鎴愬姛锛�'); + this.refreshTable(); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + // 鎵撳紑涓嬭浇寮规 + openDownloadDia (row) { + this.downloadDialog = true + this.download = row + }, + // 濮旀墭鍗曚笅杞� + orderFormDown () { + let url = this.download.fileUrl; + const link = document.createElement('a'); + link.href = this.javaApi + url; + link.target = '_blank'; + document.body.appendChild(link); + link.click(); + }, + // 濮旀墭鎶ュ憡涓嬭浇 + orderReportDown () { + this.outLoading = true; + exportInspectionOrder({inspectionOrderId: this.download.inspectionOrderId}).then(res => { + this.outLoading = false; + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, '妫�楠屽鎵樺崟.docx') + this.$message.success('瀵煎嚭鎴愬姛'); + + }).catch(err => { + this.outLoading = false; + }) + }, + // 涓婁紶 + handleSuccessUp(response, ) { + if (response.code == 200) { + this.$message.success('涓婁紶鎴愬姛'); + this.refreshTable() + } + }, + beforeUpload(file) { + if (file.size > 1024 * 1024 * 10) { + this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M'); + this.$refs.upload.clearFiles() + return false; + } else { + return true; + } + }, + onError(err, file, fileList) { + this.$message.error('涓婁紶澶辫触') + this.$refs.upload.clearFiles() + }, + // 浜哄憳鍒楄〃 + getAuthorizedPerson() { + selectUserCondition().then(res => { + let data = [] + res.data.forEach(a => { + data.push({ + label: a.name, + value: a.id + }) + }) + this.personList = data + }) + }, + + }, } -</script> \ No newline at end of file +</script> + +<style scoped> +</style> -- Gitblit v1.9.3