From 41066e88fa1ff31c3f692d559afeee2d9afc0cd1 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期一, 06 十一月 2023 09:18:09 +0800 Subject: [PATCH] s --- src/views/quality/rawMaterial/rawMaterial-form.vue | 81 +++++++++++++++++++++++++-- public/index.html | 2 src/main.js | 3 + src/views/common/rawMaterial-part.vue | 14 ++++ package.json | 1 src/views/quality/rawMaterial/index.vue | 63 ++++++++++++++++++-- src/views/common/ztt-table.vue | 3 7 files changed, 152 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 3a4434b..6fea7ba 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@chenfengyuan/vue-qrcode": "^1.0.1", "@riophae/vue-treeselect": "0.4.0", + "@smallwei/avue": "^2.10.18", "avue-plugin-ueditor": "^0.1.4", "axios": "^0.18.0", "babel-polyfill": "^6.26.0", diff --git a/public/index.html b/public/index.html index 69894b1..a626a6a 100644 --- a/public/index.html +++ b/public/index.html @@ -35,7 +35,7 @@ <body> <script src="https://cdn.staticfile.org/FileSaver.js/2014-11-29/FileSaver.min.js"></script> -<script src="https://cdn.staticfile.org/xlsx/0.18.2/xlsx.full.min.js"></script> + <script src="https://cdn.staticfile.org/xlsx/0.18.2/xlsx.full.min.js"></script> <noscript> <strong >寰堟姳姝夛紝濡傛灉娌℃湁 JavaScript 鏀寔锛岀綉绔欏皢涓嶈兘姝e父宸ヤ綔銆傝鍚敤娴忚鍣ㄧ殑 diff --git a/src/main.js b/src/main.js index 87e5bd1..d4a9587 100644 --- a/src/main.js +++ b/src/main.js @@ -24,6 +24,9 @@ import 'quill/dist/quill.bubble.css' import diadrag from '@/directive/diadrag' import thinclick from '@/directive/thinclick' +import Avue from '@smallwei/avue'; +import '@smallwei/avue/lib/index.css'; +Vue.use(Avue); // 鎻掍欢 json 灞曠ず Vue.use(router) diff --git a/src/views/common/rawMaterial-part.vue b/src/views/common/rawMaterial-part.vue index 7d4a24f..9a29d28 100644 --- a/src/views/common/rawMaterial-part.vue +++ b/src/views/common/rawMaterial-part.vue @@ -112,6 +112,14 @@ searchInfoType: 'text' }, { + minWidth: '120', + prop: 'projectName', + label: '椤圭洰鍚嶇О', + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, + { minWidth: '100', prop: 'name', label: '鍘熸潗鏂欏悕绉�', @@ -178,6 +186,7 @@ mounted() { }, + // props:['currentRow'], methods: { getData() { if (this.$refs.rawPartTable !== undefined) { @@ -185,6 +194,8 @@ } }, saveSelectRow() { + // console.log(this.multipleSelection); + console.log(); if (this.multiSelect) { this.$emit('handleSelectionChange', this.multipleSelection) } else { @@ -196,9 +207,12 @@ ) } this.innerVisible = false + this.$parent.costPlannedAmountChange(this.currentRow) }, handleCurrentChange(row) { + console.log(row); this.currentRow = row + console.log(this.currentRow); }, handleSelectionChange(val) { // 澶氳閫変腑 diff --git a/src/views/common/ztt-table.vue b/src/views/common/ztt-table.vue index f0f12a8..5750421 100644 --- a/src/views/common/ztt-table.vue +++ b/src/views/common/ztt-table.vue @@ -959,7 +959,6 @@ arr.push(this.paramArr[i]) } } - this.dataListLoading = false return this.doCallback(this.ajaxFun, arr, selectedId) }, doCallback(fn, args, selectedId) { @@ -1000,6 +999,7 @@ this.clickTable(selectObj) } } + this.$emit('change',resultData); }) .catch((error) => { this.dataListLoading = false @@ -1532,6 +1532,7 @@ } } } + console.log(this.columnList); this.tableKey = Math.random() // this.$forceUpdate(); const currPathColumnOrder = this.currPath + '_column' diff --git a/src/views/quality/rawMaterial/index.vue b/src/views/quality/rawMaterial/index.vue index 63567c2..3e33e70 100644 --- a/src/views/quality/rawMaterial/index.vue +++ b/src/views/quality/rawMaterial/index.vue @@ -19,6 +19,8 @@ <basic-container> <ttable :table="table" + :resultData="resultData" + @change ="costPlannedAmountChange" @handleSelectionChange="handleSelectionChange" :prelang="prelang" :options="options" @@ -35,8 +37,8 @@ ></RawMaterialForm> </div> </template> - <script> +import ExportMaterial from './ExportMaterial.vue' import ttable from '@/views/common/ztt-table.vue' import { getRawInspectList,delObj } from '@/api/quality/rawMaterial' import RawMaterialForm from './rawMaterial-form' @@ -45,6 +47,7 @@ export default { data() { return { + resultData:[], addOrUpdateVisible: false, type: [1], prelang: 'rawMaterial', @@ -68,6 +71,7 @@ currentPage: 1, pageSize: 20, data: [], + isExport:true, // 鏍囬 column: [ { @@ -78,6 +82,14 @@ isSearch: true, searchInfoType: 'text', render: { fun: this.addOrUpdateHandle } + }, + { + minWidth: '120', + prop: 'projectName', + label: '椤圭洰鍚嶇О', + isTrue: true, + isSearch: true, + searchInfoType: 'text' }, { minWidth: '120', @@ -166,8 +178,11 @@ label: '鍚堟牸鐘舵��', isTrue: true, isSearch: true, - searchInfoType: 'text', + searchInfoType: 'select', formatter: this.formatJudgeState, + optList: () => { + return this.StateList + } }, ], toolbar: [ @@ -178,13 +193,11 @@ }, { text: '瀵煎嚭', + type: 'primary', + fun: this.handleExcel } ], operator: [{ - text: '鎵撳嵃', - type: 'text', - size: 'small', - },{ text: '浣滃簾', type: 'text', size: 'small', @@ -197,19 +210,54 @@ minWidth: 100 }, }, - insStateList: [{label:'鍏ㄩ儴',value:''},{label:'宸叉娴�',value:'1'},{label:'鏈娴�',value:'0'}] + insStateList: [{label:'鍏ㄩ儴',value:''},{label:'宸叉娴�',value:'1'},{label:'鏈娴�',value:'0'}], + StateList: [{label:'鍏ㄩ儴',value:''},{label:'宸插悎鏍�',value:'1'},{label:'涓嶅悎鏍�',value:'0'}], } }, components: { ttable, RawMaterialForm, + ExportMaterial, }, created() { + }, computed: { ...mapGetters(['permissions']) }, methods:{ + async costPlannedAmountChange(value){ + this.resultData= value + }, + + handleExcel() { + console.log(this.resultData); + console.log(this.table.column); + // let arr = this.table.column.map(el = el.isTrue == true) + // console.log(arr); + let arr = this.table.column.filter(item => item.isTrue == true).map(item => { + return{ + prop:item.prop, + label:item.label + } + }) + let opt = { + title: '鏂囨。鏍囬', + column: [{ + label:'', + prop:'header', + children:arr + }], + data: this.resultData + } + this.$Export.excel({ + title: opt.title, + columns: opt.column, + data: opt.data + }); + // console.log(this.table); + + }, // 鍒犻櫎 deleteHandle(row) { this.$confirm('鏄惁纭鍒犻櫎璇ユ暟鎹細' + row.code , '鎻愮ず', { @@ -260,6 +308,7 @@ }, getData() { this.$refs.rawMaterialTable.getDataList() + }, // table鑷甫浜嬩欢 handleSelectionChange(val) { diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue index bed230b..b5923d0 100644 --- a/src/views/quality/rawMaterial/rawMaterial-form.vue +++ b/src/views/quality/rawMaterial/rawMaterial-form.vue @@ -86,6 +86,12 @@ <el-input v-model="dataForm.createUser" disabled /> </el-form-item> </el-col> + <el-col :span="6"> + <el-form-item prop="projectName" label="椤圭洰鍚嶇О"> + <el-input v-model="dataForm.projectName" disabled > + </el-input> + </el-form-item> + </el-col> </el-row> </el-form> </div> @@ -107,16 +113,18 @@ :data="list" border style="width: 100%;" height="400"> <el-table-column type="index" label="搴忓彿" width="60"> </el-table-column> + <el-table-column prop="name" label="椤圭洰" width="260"> <template slot-scope="scope"> <el-select v-if="projectList.length > 0" :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name" filterable allow-create placeholder="璇疯緭鍏ユ垨閫夋嫨椤圭洰鍚嶇О" style="width:100%" @change="changeName(scope.$index,scope.row)"> <el-option v-for="(item,index) in projectList" :key="index" :label="item.name" :value="item.name"/> </el-select> - <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name" + <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="list.name" placeholder="璇疯緭鍏ラ」鐩悕绉�"></el-input> </template> </el-table-column> + <el-table-column prop="unit" label="鍗曚綅" width="260"> <template slot-scope="scope"> <el-input :disabled="dataForm.id != null" v-model="scope.row.unit" placeholder="璇疯緭鍏ュ崟浣�"></el-input> @@ -128,16 +136,29 @@ placeholder="璇疯緭鍏ユ爣鍑嗗��"></el-input> </template> </el-table-column> + <el-table-column prop="testValue" label="妫�娴嬪��" min-width="260" v-for="(item, index) in empiricalValueAdd" :key="index"> <template slot-scope="scope"> <el-tooltip :disabled="scope.row.equipmentId != null" class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> - <el-input :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" - @blur="updateTestValue(scope.row,index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> - </el-tooltip> + + <!-- <el-input :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" + @blur="updateTestValue(scope.row,index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> --> + + <el-autocomplete + :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" + class="inline-input" + v-model="scope.row.testValueList[index]" + :fetch-suggestions="querySearch" + placeholder="璇疯緭鍏ュ唴瀹�" + @select="handleSelect" + ></el-autocomplete> + + </el-tooltip> </template> </el-table-column> + <el-table-column prop="deviceName" label="璇曢獙璁惧" min-width="260"> <template slot-scope="scope"> <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%" @@ -147,6 +168,7 @@ </el-select> </template> </el-table-column> + <el-table-column fixed="right" v-if="dataForm.id != null" prop="testState" label="缁撹" min-width="150"> <template slot-scope="scope"> <span v-if="scope.row.testState == 0" style="color:#F56C6C">涓嶅悎鏍�</span> @@ -211,6 +233,7 @@ <el-button type="primary" @click="submitSave()">纭� 瀹�</el-button> </span> </el-dialog> + <!-- <rawMaterialPartDialog :currentRow ="currentRow" @costPlannedAmountChange="costPlannedAmountChange"/> --> </div> </template> @@ -223,13 +246,17 @@ updateRawInspectsById, updateDeviceById, } from '@/api/quality/rawMaterial' import rawMaterialPartDialog from '@/views/common/rawMaterial-part' +import { log } from 'util' export default { + // props:['currentRow'], computed:{}, components:{ rawMaterialPartDialog }, data(){ return{ + currentRow:[], + userlist:[], fiedNum: null, unqualifiedNum: null, dialogVisible:false, @@ -249,7 +276,7 @@ formTime: '', message: '', name: '', - code: '88.118.1/A0487643', + code: '88.118.1/A0498220', specs: '', unit: '', number: '', @@ -274,6 +301,8 @@ }], dataRule: {}, deviceList: [], + restaurants:[], + whetherNot:'', } }, beforeUpdate(){ @@ -290,6 +319,8 @@ } this.init() this.getDeviceList() + this.restaurants = this.loadAll(); + // this.costPlannedAmountChange() }, watch:{ dialogVisible(newVal){ @@ -297,9 +328,41 @@ this.unqualifiedNum = null this.fiedNum = null } - } + }, + }, methods:{ + //椤圭洰 + // xxxx(){ + // console.log(currentRow); + // }, + // 浜嬩欢澶勭悊鍑芥暟 + // costPlannedAmountChange(value) { + // console.log("==>"); + // console.log(value.rawInsProducts); + // this.userlist = value.rawInsProducts + // this.list = this.userlist + // console.log(this.list); + // }, + querySearch(queryString, cb) { + var restaurants = this.restaurants; + var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; + + cb(results); + }, + createFilter(queryString) { + return (restaurant) => { + return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0); + }; + }, + loadAll(){ + return [ + {"value":"鏄�"}, + {"value":"鍚�"} + ];}, + handleSelect(item) { + console.log(item); + }, changeName(index,row){ this.projectList.forEach(item=>{ if(row.name == item.name){ @@ -310,6 +373,7 @@ }, // 纭鍥炶皟 selectPart(param, nodePart, index) { + console.log("鎴愬姛--",param); if (typeof param !== 'undefined') { this.dataForm.code = param.code this.dataForm.name = param.name @@ -319,13 +383,18 @@ this.dataForm.supplier = param.supplier this.dataForm.number = param.number this.dataForm.message = param.message + this.dataForm.projectName = param.projectName this.projectList = param.rawInsProducts == null ? [] : param.rawInsProducts + // param.rawInsProducts.forEach(item=>{ + // this.list.push(item) + // }) } }, queryCode(){ this.paramObj = { code: this.dataForm.code } + console.log(this.paramObj); this.showPart = true }, updateDevice(row,index){ -- Gitblit v1.9.3