¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="mod-config"> |
| | | <basic-container> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <ttable |
| | | :table="table" |
| | | :isShowHide="true" |
| | | :prelang="prelang" |
| | | :ajaxFun="ajaxFun" |
| | | :options="options" |
| | | @handleSelectionChange="handleSelectionChange" |
| | | ref="processconfiguration" |
| | | > |
| | | <template #toolbar></template> |
| | | </ttable> |
| | | </el-col> |
| | | <el-col :span="13" style="padding-left: 10px"> |
| | | <el-card> |
| | | <div slot="header"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <span>è£
ç®±æç»</span> |
| | | </el-col> |
| | | <el-col :span="8" :offset="4"> |
| | | <!-- <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | @click="beginItemLayOut" |
| | | > |
| | | å¸å± |
| | | </el-button> --> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | @click="addpreserve" |
| | | >ä¿å |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-button |
| | | v-if="!isCheck" |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | @click="relateOperationParam()" |
| | | >æ·»å |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-table |
| | | :data="testStandardParams" |
| | | id="testStandardParamTable" |
| | | ref="testStandardParam" |
| | | |
| | | highlight-current-row |
| | | height="700" |
| | | style="width: 100%" |
| | | class="l-mes-table" |
| | | border |
| | | stripe |
| | | > |
| | | <el-table-column |
| | | type ="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | label="产å" |
| | | prop="product" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | label="产åç¼å·" |
| | | prop="productNo" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="specs" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="åä½" |
| | | prop="unit" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æ°é" |
| | | prop="number" |
| | | align="center" |
| | | width="80" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.number"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed="right" |
| | | label="æä½" |
| | | align="center" |
| | | width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="deleteadd(scope.row)" size="small">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æ°å¢ --> |
| | | <packfrom |
| | | :currshowlist.sync="addOrUpdateVisible" |
| | | @refreshDataList="getData"> |
| | | </packfrom> |
| | | <packfromadd |
| | | :currshowlist.sync="increase" |
| | | :packageBoxIddata ="packageBoxId" |
| | | @handleSelectionChange = "preserve" |
| | | > |
| | | </packfromadd> |
| | | </basic-container> |
| | | <el-dialog title="æ ç¾å表" top="5vh" :visible.sync="diaPrintTab" width="500px"> |
| | | <div id="qrCard" class="dia_body" style="height: 400px;overflow-y: auto;padding: 0 10px;"> |
| | | <el-card class="box-card" v-for="(item, i) in qrData" :key="i" style="margin-bottom: 15px;"> |
| | | <el-row> |
| | | <el-col :span="10" :offset="3">åºå·ï¼</el-col> |
| | | <el-col :span="10" style="font-weight: bold;">{{ i + 1 }}</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="10" :offset="3">å
è£
ç¼å·ï¼</el-col> |
| | | <el-col :span="10" style="font-weight: bold;">{{ item.packageNo }}</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="10" :offset="3">äºç»´ç ï¼</el-col> |
| | | <el-col :span="10"> |
| | | <vueQr :text="JSON.stringify(item)" :size="120" :margin="1"></vueQr> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="diaPrintTab = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="printFun">æ å°</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { pagedata,dropById,list,saveList,deledata,sAuditstatus} from '@/api/quality/Packaging_ledger' |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | | import packfrom from './pack-from.vue' |
| | | import packfromadd from './pack-fromadd.vue' |
| | | import vueQr from 'vue-qr' |
| | | import PrintJS from 'print-js' |
| | | export default { |
| | | data(){ |
| | | return { |
| | | qrData:[], |
| | | diaPrintTab: false, |
| | | multipleSelection: [], |
| | | isCheck: false, |
| | | dataway:{}, |
| | | goid:'', |
| | | testStandardParams: [], |
| | | packageBoxId:{}, |
| | | prelang: 'operation', |
| | | dataListLoading: false, |
| | | ajaxFun: pagedata, |
| | | increase:false, |
| | | addOrUpdateVisible:false, |
| | | options: { |
| | | height: 300, // é»è®¤é«åº¦-为äºè¡¨å¤´åºå® |
| | | stripe: true, // æ¯å¦ä¸ºæé©¬çº¹ table |
| | | highlightCurrentRow: false, // æ¯å¦è¦é«äº®å½åè¡ |
| | | border: true, // æ¯å¦æçºµåè¾¹æ¡ |
| | | lazy: false, // æ¯å¦éè¦æå è½½ |
| | | fit: true, // åç宽度æ¯å¦èªæå¼ |
| | | multiSelect: true, // |
| | | isEdit:false, |
| | | seqNo: true, |
| | | isShowHide: true, // æ¯å¦æ¾ç¤ºæ¾å½±æé® |
| | | isRefresh: true, // æ¯å¦æ¾ç¤ºå·æ°æé® |
| | | isSearch: true, // é«çº§æ¥è¯¢æé® |
| | | defaultOrderBy: { column: 'createTime', direction: 'desc' } |
| | | }, |
| | | table: { |
| | | total: 0, |
| | | currentPage: 1, |
| | | pageSize: 20, |
| | | data: [], |
| | | // æ é¢ |
| | | column: [ |
| | | { |
| | | minWidth: 'code', |
| | | prop: 'state', |
| | | label: 'ç¶æ', |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '140', |
| | | prop: 'packageNo', |
| | | label: 'å
è£
ç¼å·', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | },{ |
| | | minWidth: '140', |
| | | prop: 'createUser', |
| | | label: 'å建人', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | },{ |
| | | minWidth: '140', |
| | | prop: 'contractNo', |
| | | label: 'ååå·', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | }, |
| | | { |
| | | minWidth: '140', |
| | | prop: 'updateUser', |
| | | label: 'æ´æ°äºº', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | }, |
| | | { |
| | | minWidth: '130', |
| | | width: '150', |
| | | prop: 'updateTime', |
| | | label: 'æ´æ°æ¥æ', |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'datetimerange', |
| | | }, |
| | | { |
| | | minWidth: '130', |
| | | width: '150', |
| | | prop: 'createTime', |
| | | label: 'åå»ºæ¥æ', |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'datetimerange', |
| | | }, |
| | | ], |
| | | toolbar: [ |
| | | { |
| | | text: 'æ°å¢', |
| | | type: 'primary', |
| | | fun: this.addOrUpdateHandle |
| | | }, |
| | | { |
| | | text: 'æ ç¾æå°', |
| | | type: 'primary', |
| | | fun: this.printLabel |
| | | }, |
| | | ], |
| | | operator: [ |
| | | { |
| | | text: 'æ£éª', |
| | | icon: 'el-icon-position', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.check |
| | | },{ |
| | | text: 'å é¤', |
| | | icon: 'el-icon-delete', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.deleteHandle |
| | | } |
| | | ], |
| | | operatorConfig: { |
| | | fixed: 'right', |
| | | label: 'æä½', |
| | | width: 120, |
| | | minWidth: 120 |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | components: { |
| | | ttable, |
| | | packfrom, |
| | | packfromadd, |
| | | vueQr |
| | | }, |
| | | watch: { |
| | | diaPrintTab(newVal){ |
| | | if(!newVal){ |
| | | this.qrData = [] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | //æå°æé® |
| | | printFun() { |
| | | this.diaPrintTab = false; |
| | | PrintJS({ |
| | | printable: "qrCard", |
| | | type: "html", |
| | | // header: "åæææ£æµæ¥å", |
| | | targetStyles: ["*"], |
| | | style: `@page {margin: 0mm 5mm;} |
| | | html {zoom:100%;} |
| | | @media print { |
| | | html,body{ |
| | | width:60mm; |
| | | height:40mm; |
| | | } |
| | | }`, |
| | | ignoreElements: ["no-ignore"], |
| | | orientation: 'portrait' |
| | | }); |
| | | }, |
| | | handleSelectionChange(val){ |
| | | this.multipleSelection = val |
| | | let lastRow = val[val.length - 1] |
| | | this.handleCurrentChange(lastRow) |
| | | }, |
| | | printLabel(){ |
| | | if(this.multipleSelection.length==0){ |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | return |
| | | } |
| | | this.diaPrintTab = true |
| | | console.log(this.multipleSelection); |
| | | this.multipleSelection.forEach(item=>{ |
| | | let obj = { |
| | | packageNo: item.packageNo, |
| | | contractNo: item.contractNo, |
| | | boxInfo: [] |
| | | } |
| | | list({packageBoxId:item.id}).then((res) =>{ |
| | | res.data.data.forEach(ele=>{ |
| | | obj.boxInfo.push({ |
| | | product: ele.product, |
| | | productNo: ele.productNo, |
| | | specs: ele.specs, |
| | | unit: ele.unit, |
| | | number: ele.number |
| | | }) |
| | | }) |
| | | }) |
| | | this.qrData.push(obj) |
| | | }) |
| | | }, |
| | | // è·åæ°æ®å表 |
| | | getData() { |
| | | this.$refs.processconfiguration.refreshData() |
| | | }, |
| | | wayRenovate(){ |
| | | this.getData() |
| | | }, |
| | | //add |
| | | addOrUpdateHandle(){ |
| | | this.addOrUpdateVisible = true |
| | | }, |
| | | //å é¤ |
| | | deleteHandle(row){ |
| | | dropById({id:row.id}).then((res) =>{ |
| | | this.getData() |
| | | this.$message.success('å 餿å') |
| | | }) |
| | | }, |
| | | handleCurrentChange(row){ |
| | | if(row.state=='å·²æ¥æ£'){ |
| | | this.isCheck = true |
| | | } |
| | | this.dataway = row |
| | | this.packageBoxId = { |
| | | packageBoxId:row.id |
| | | } |
| | | this.goid = row.id |
| | | this.rightquery() |
| | | }, |
| | | rightquery(){ |
| | | list({packageBoxId:this.goid}).then((res) =>{ |
| | | this.testStandardParams = res.data.data |
| | | }) |
| | | }, |
| | | //详æ
æ·»å |
| | | relateOperationParam(){ |
| | | if (this.dataway.state == "æªæ¥æ£") { |
| | | this.increase = true |
| | | }else{ |
| | | this.$message.error('请å
éæ©å
è£
项ç®') |
| | | } |
| | | }, |
| | | preserve(datalist){ |
| | | this.testStandardParams = datalist |
| | | }, |
| | | //å³è¾¹ä¿å |
| | | addpreserve(){ |
| | | this.testStandardParams.forEach(el => { |
| | | el.packageBoxId =this.goid |
| | | }); |
| | | saveList(this.testStandardParams).then((res) =>{ |
| | | this.$message.success('ä¿åæå') |
| | | this.rightquery() |
| | | }) |
| | | }, |
| | | //å é¤ |
| | | deleteadd(row){ |
| | | deledata({id:row.id}).then((res)=>{ |
| | | this.$message.success('å 餿å') |
| | | this.rightquery() |
| | | }) |
| | | }, |
| | | //å®¡æ ¸ |
| | | check(row){ |
| | | let packageBox = { |
| | | id:row.id, |
| | | packageNo:row.packageNo, |
| | | contractNo:row.contractNo, |
| | | customerId:row.customerId, |
| | | } |
| | | sAuditstatus(packageBox).then((res) =>{ |
| | | this.getData() |
| | | this.$message.success('æ£éªæå') |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |