From 8635253d498ea4fefd6ea465704569ff34fed3f8 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期五, 08 九月 2023 14:41:13 +0800
Subject: [PATCH] modified: src/api/basicData/index.js modified: src/views/experiment/inspectionApplication/index.vue modified: src/views/experiment/nonConformingFeedback/index.vue modified: src/views/experiment/reportAuditing/index.vue modified: src/views/standardLibrary/index.vue
---
src/views/inspectionManagement/commissionInspection/addCommision.vue | 190 ++++++++++++++++++++++++++++++++++++++++------
1 files changed, 163 insertions(+), 27 deletions(-)
diff --git a/src/views/inspectionManagement/commissionInspection/addCommision.vue b/src/views/inspectionManagement/commissionInspection/addCommision.vue
index 8fe270d..10a9d5c 100644
--- a/src/views/inspectionManagement/commissionInspection/addCommision.vue
+++ b/src/views/inspectionManagement/commissionInspection/addCommision.vue
@@ -2,6 +2,79 @@
<div class="add_commision">
<div class="content-main">
<div class="firstBox">
+ <div class="printCommision" >
+ <table height="30px" id="printCommision">
+ <tr>
+ <td colspan="8">
+ <img :src="imgSrc" style="position: absolute;left: 50px;top:26px">
+ <h1 style="display: inline;">濮旀墭妫�楠岀敵璇峰崟</h1>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">濮旀墭缂栧彿</td>
+ <td colspan="2">{{infoForm.commisioncode}}</td>
+ <td colspan="2">濮旀墭鍗曚綅</td>
+ <td colspan="2">{{infoForm.department}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">鑱旂郴浜�</td>
+ <td colspan="2">{{infoForm.contacter}}</td>
+ <td colspan="2">鑱旂郴鐢佃瘽</td>
+ <td colspan="2">{{infoForm.tel}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">鑱旂郴鍦板潃</td>
+ <td colspan="2">{{infoForm.address}}</td>
+ <td colspan="2">瀹屾垚鏈熼檺</td>
+ <td colspan="2">{{infoForm.deadline}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">閫佹牱鏃堕棿</td>
+ <td colspan="2">{{infoForm.time}}</td>
+ <td colspan="2">閫佹牱浜�</td>
+ <td colspan="2">{{infoForm.sender}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">閫佹牱浜虹數璇�</td>
+ <td colspan="2">{{infoForm.sendertel}}</td>
+ <td colspan="2">鎶ュ憡鏁伴噺</td>
+ <td colspan="2">{{infoForm.num}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">閫佹牱鏂瑰紡</td>
+ <td colspan="6">
+ <ul>
+ <li>
+ <i :class="`${infoForm.way == 1 ? 'el-icon-success' : 'el-icon-circle-check'}`"></i> 閫佹牱
+ </li>
+ <li>
+ <i :class="`${infoForm.way == 2 ? 'el-icon-success' : 'el-icon-circle-check'}`"></i> 涓婇棬
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tbody colspan="8" v-for="(item,index) in sampleNameList" :key="index">
+ <tr>
+ <td colspan="2">鏍峰搧</td>
+ <td colspan="2">{{item}}</td>
+ <td colspan="2">璇勫畾鏍囧噯</td>
+ <td colspan="2">{{standardList[index]}}</td>
+ </tr>
+ <tr>
+ <td colspan="2">璇曢獙椤圭洰</td>
+ <td colspan="6">
+ <p style="text-align:left;margin-left:20px" v-for="(data,index) in testProjectList[index]" :key="index">
+ {{index+1 + "銆�" + data}}
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ <tr>
+ <td colspan="2">澶囨敞</td>
+ <td colspan="6">{{infoForm.other}}</td>
+ </tr>
+ </table>
+ </div>
<div class="title">濮旀墭淇℃伅</div>
<div class="tableBox">
<div class="tableBox-header">
@@ -22,7 +95,8 @@
<el-table-column type="index" label="搴忓彿" min-width="10%" />
<el-table-column prop="sampleNumber" label="鏍峰搧缂栧彿" min-width="8%" />
<el-table-column prop="sampleName" label="鏍峰搧鍚嶇О" min-width="10%" />
- <el-table-column prop="specificationsModels" label="瑙勬牸鍨嬪彿" min-width="10%" />
+ <el-table-column prop="speName" label="瑙勬牸鍨嬪彿" min-width="10%">
+ </el-table-column>
<el-table-column prop="unit" label="鍗曚綅" min-width="8%" />
<el-table-column prop="samplesNumber" label="鏁伴噺" min-width="8%" />
<!-- <el-table-column prop="addway" label="娣诲姞鏂瑰紡" min-width="8%">
@@ -86,14 +160,14 @@
</el-col>
<el-col :span="5">
<el-form-item label="瀹屾垚鏈熼檺锛�">
- <el-date-picker v-model="infoForm.deadline" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;"
+ <el-date-picker value-format="yyyy-MM-dd" v-model="infoForm.deadline" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;"
size="small">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="閫佹牱鏃堕棿锛�">
- <el-date-picker v-model="infoForm.time" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;">
+ <el-date-picker value-format="yyyy-MM-dd" v-model="infoForm.time" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;">
</el-date-picker>
</el-form-item>
</el-col>
@@ -121,7 +195,7 @@
</el-col>
<el-col :span="5">
<el-form-item label="鎶ュ憡鏁帮細">
- <el-input style="width: 200px;" v-model="infoForm.num" placeholder="璇疯緭鍏ユ姤鍛婃暟" autocomplete="off"
+ <el-input type="number" min="0" style="width: 200px;" v-model="infoForm.num" placeholder="璇疯緭鍏ユ姤鍛婃暟" autocomplete="off"
size="small" />
</el-form-item>
</el-col>
@@ -137,7 +211,7 @@
<el-button type="primary" size="small" @click="submitInspection"
style="background-color: rgb(1, 102, 226);">鎻愪氦</el-button>
<!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false -->
- <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">鎵撳嵃濮旀墭鍗�</el-button>
+ <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); " @click="printCommision">鎵撳嵃濮旀墭鍗�</el-button>
</div>
</el-form>
</div>
@@ -157,7 +231,7 @@
<el-form-item label="鏍峰搧鍚嶇О锛�">
<el-select v-model="addPointerForm.sampleName" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О"
@change="upMaterialName">
- <el-option v-for="options in sampleoptions" :value="options.key" :label="options.value"></el-option>
+ <el-option v-for="(options,index) in sampleoptions" :key="index" :value="options.key" :label="options.value"></el-option>
</el-select>
</el-form-item>
</el-col>
@@ -221,6 +295,7 @@
</template>
<script>
+ import PrintJS from 'print-js'
import {
getSampleName,
getModelSpecification,
@@ -228,11 +303,16 @@
addInspection,
isIfViewUUID,
getProductList,
- getContractsSampleInfo
+ getContractsSampleInfo,
+ getSpecificationsName
} from '@/api/inspection/commisioninspection'
export default {
data() {
return {
+ sampleNameList:[],
+ standardList:[],
+ testProjectList:[],
+ imgSrc: require("@/assets/404_images/logo.png"),
currentPage: 0,
searchData: '',
infoForm: {
@@ -260,19 +340,7 @@
experiment: [],
addway: ''
},
- experList: [{
- key: '1',
- label: '澶栬妫�鏌�'
- }, {
- key: '2',
- label: '鍔ㄤ綔鐢靛帇璇曢獙'
- }, {
- key: '3',
- label: '鐢甸樆绠℃硠婕忕數娴佽瘯楠�'
- }, {
- key: '4',
- label: '缁濈紭閮ㄥ垎浜ゆ祦鑰愬帇璇曢獙'
- }],
+ experList: [],
sampleoptions: [],
samplecodeoptions: [],
model_spe_options: [],
@@ -321,6 +389,20 @@
this.getSampleName()
},
methods: {
+ printCommision(){
+ console.log(this.infoForm);
+ PrintJS({
+ printable: "printCommision",
+ type: "html",
+ css: [
+ "https://unpkg.com/element-ui/lib/theme-chalk/fonts/element-icons.ttf",
+ "https://unpkg.com/element-ui/lib/theme-chalk/fonts/element-icons.woff",
+ "https://unpkg.com/element-ui/lib/theme-chalk/icon.css"
+ ],
+ targetStyles: ["*"],
+ ignoreElements: ["no-ignore"],
+ });
+ },
getlink(viewId) {
if (viewId == null) {
this.$message.error('褰撳墠閾炬帴涓嶅湪鏈夋晥鏈熷唴,绯荤粺鑷姩鍏抽棴')
@@ -338,9 +420,10 @@
}
})
},
- async getContractsSampleInfo(viewId){
- let res=await getContractsSampleInfo({viewId})
- console.log(res.data);
+ async getContractsSampleInfo(viewId) {
+ let res = await getContractsSampleInfo({
+ viewId
+ })
},
async getSampleName() {
const res = await getSampleName()
@@ -365,13 +448,23 @@
})
},
addInspection() {
+ let sName = this.addPointerForm.sampleName;
+ this.sampleoptions.forEach(a=>{
+ if(a.key == sName) this.sampleNameList.push(a.value);
+ })
+ this.standardList.push(this.addPointerForm.addway);
+ this.testProjectList.push(this.addPointerForm.experiment);
let exper = this.addPointerForm.experiment[0]
- this.addPointerForm.addway = 1
for (let i = 1; i < this.addPointerForm.experiment.length; i++) {
exper += ',' + this.addPointerForm.experiment[i]
}
this.addPointerForm.experiment = exper
let tmp = this.addPointerForm
+ this.sampleoptions.forEach(a => {
+ if (a.key == tmp.sampleName) tmp.sampleName = a.value
+ })
+ tmp.speName = tmp.addway + '-' + tmp.speName
+ tmp.addway = 1
this.detectionInfo.push(tmp)
this.dialogueFormVisible = false
this.addPointerForm = {
@@ -382,8 +475,10 @@
samplesNumber: '',
remarks: '',
experiment: [],
- addway: ''
+ addway: '',
+ speName: ''
}
+ console.log(this.sampleNameList);
},
async submitInspection() {
let sampledeliveryway
@@ -404,7 +499,8 @@
reportNumber: parseInt(this.infoForm.num),
sampleDeliveryMode: sampledeliveryway,
sampleDeliveryPhone: this.infoForm.sendertel,
- sampleSender: this.infoForm.sender
+ sampleSender: this.infoForm.sender,
+ speName: this.infoForm.speName
})
this.infoForm.commisioncode = res.data
if (res.data) {
@@ -442,11 +538,17 @@
return item.name
})
})
+ this.model_sta_options.forEach(a => {
+ if (a.key == val) {
+ this.addPointerForm.speName = a.value
+ }
+ })
},
getContractsSampleInfo() {
getContractsSampleInfo({
viewId: this.viewId
}).then(res => {
+ if (res.data == null) return
this.infoForm = {
commisioncode: res.data.entrustCoding,
deadline: res.data.completionDeadline,
@@ -464,12 +566,46 @@
}
this.detectionInfo = res.data.linkDetectionList
})
- }
+ },
}
}
</script>
<style lang="scss" scoped>
+ .printCommision{
+ display: none;
+ width: 90%;
+ height:100px;
+ table {
+ width: 100%;
+ border-collapse: collapse;
+ font-size: 18px;
+ }
+
+ table,
+ tr,
+ th,
+ td {
+ border: 2px solid black;
+ text-align: center;
+ font-family: '寰蒋闆呴粦';
+ ul{
+ list-style: none;
+ width: 500px;
+ }
+ ul li{
+ display: inline;
+ width:100px;
+ margin: 0 25px;
+ }
+ }
+
+ tr,
+ td,
+ th {
+ padding: 20px 10px;
+ }
+ }
.content-main {
padding: 20px 40px;
background-color: #f0f2f5;
--
Gitblit v1.9.3