¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | - Copyright (c) 2018-2025, ztt All rights reserved. |
| | | - |
| | | - Redistribution and use in source and binary forms, with or without |
| | | - modification, are permitted provided that the following conditions are met: |
| | | - |
| | | - Redistributions of source code must retain the above copyright notice, |
| | | - this list of conditions and the following disclaimer. |
| | | - Redistributions in binary form must reproduce the above copyright |
| | | - notice, this list of conditions and the following disclaimer in the |
| | | - documentation and/or other materials provided with the distribution. |
| | | - Neither the name of the pig4cloud.com developer nor the names of its |
| | | - contributors may be used to endorse or promote products derived from |
| | | - this software without specific prior written permission. |
| | | - Author: ztt |
| | | --> |
| | | <template> |
| | | <div class="mod-config"> |
| | | <basic-container> |
| | | <ttable |
| | | :table="table" |
| | | :resultData="resultData" |
| | | @handleSelectionChange="handleSelectionChange" |
| | | :prelang="prelang" |
| | | :options="options" |
| | | :ajaxFun="ajaxFun" |
| | | ref="packageInspectTable"> |
| | | <template #toolbar> |
| | | </template> |
| | | </ttable> |
| | | </basic-container> |
| | | <!-- å¼¹çª, æ°å¢ / ä¿®æ¹ --> |
| | | <!-- <RawMaterialForm |
| | | v-if="addOrUpdateVisible" |
| | | ref="addOrUpdate" |
| | | @refreshDataList="getData" |
| | | ></RawMaterialForm> --> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | | import { fetchList,deleteById } from '@/api/quality/packageInspect' |
| | | // import RawMaterialForm from './rawMaterial-form' |
| | | import * as fecha from 'element-ui/lib/utils/date' |
| | | import { mapGetters } from 'vuex' |
| | | export default { |
| | | data() { |
| | | return { |
| | | resultData:[], |
| | | addOrUpdateVisible: false, |
| | | type: [1], |
| | | multipleSelection: [], |
| | | prelang: 'packageInspect', |
| | | ajaxFun: fetchList, |
| | | options: { |
| | | height: 300, // é»è®¤é«åº¦-为äºè¡¨å¤´åºå® |
| | | stripe: true, // æ¯å¦ä¸ºæé©¬çº¹ table |
| | | highlightCurrentRow: false, // æ¯å¦è¦é«äº®å½åè¡ |
| | | border: true, // æ¯å¦æçºµåè¾¹æ¡ |
| | | lazy: false, // æ¯å¦éè¦æå è½½ |
| | | fit: true, // åç宽度æ¯å¦èªæå¼ |
| | | multiSelect: true, // |
| | | seqNo: true, |
| | | isRefresh: true, // æ¯å¦æ¾ç¤ºå·æ°æé® |
| | | isShowHide: true, // æ¯å¦æ¾ç¤ºæ¾å½±æé®H |
| | | isSearch: true, // é«çº§æ¥è¯¢æé® |
| | | defaultOrderBy: { column: 'createTime', direction: 'desc' }, |
| | | }, |
| | | table: { |
| | | total: 0, |
| | | currentPage: 1, |
| | | pageSize: 20, |
| | | data: [], |
| | | // æ é¢ |
| | | column: [ |
| | | { |
| | | minWidth: '180', |
| | | prop: 'packInsNo', |
| | | label: 'å
è£
æ£éªç¼å·', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | render: { fun: this.addOrUpdateHandle } |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'packageNo', |
| | | label: 'å
è£
ç¼ç ', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'contractNo', |
| | | label: 'ååå·', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'projectName', |
| | | label: '项ç®åç§°', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'customerName', |
| | | label: '客æ·åç§°', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'createTime', |
| | | label: 'æ¥æ£æ¥æ', |
| | | isTrue: true, |
| | | sort: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | formatter: this.formatDateTime, |
| | | }, |
| | | { |
| | | minWidth: '180', |
| | | prop: 'createUser', |
| | | label: 'æ¥æ£äºº', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '200', |
| | | prop: 'result', |
| | | label: 'ç»è®º', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | ], |
| | | toolbar: [ |
| | | // { |
| | | // text: 'æ°å¢', |
| | | // type: 'primary', |
| | | // fun: this.addOrUpdateHandle |
| | | // }, |
| | | ], |
| | | operator: [ |
| | | { |
| | | text: 'ä½åº', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.deleteHandle |
| | | }], |
| | | operatorConfig: { |
| | | fixed: 'right', |
| | | label: 'æä½', |
| | | width: 100, |
| | | minWidth: 100 |
| | | }, |
| | | }, |
| | | } |
| | | }, |
| | | components: { |
| | | ttable, |
| | | }, |
| | | created() { }, |
| | | computed: { |
| | | ...mapGetters(['permissions']) |
| | | }, |
| | | watch:{ |
| | | |
| | | }, |
| | | methods:{ |
| | | // å é¤ |
| | | deleteHandle(row) { |
| | | const _than = this |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å
è£
ç¼å·ã' + row.packInsNo+'ãçæ°æ®ï¼' , 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | closeOnClickModal: false, |
| | | type: 'warning' |
| | | }).then(function() { |
| | | deleteById(row.id).then((response)=>{ |
| | | var data = response.data |
| | | if (data.code == 0) { |
| | | _than.$message.success('å 餿å') |
| | | } else { |
| | | _than.$message.error('å é¤å¤±è´¥') |
| | | } |
| | | _than.getData() |
| | | }) |
| | | }).catch((error) => { |
| | | console.log(error); |
| | | }) |
| | | }, |
| | | // æ°å¢ / ä¿®æ¹ |
| | | addOrUpdateHandle(row) { |
| | | this.$router.push({ |
| | | name: 'packageInspectForm', |
| | | query: { |
| | | id: row == null ? null : row.id |
| | | }, |
| | | params:{resultVal : row.result=='' ? null : row.result} |
| | | }) |
| | | }, |
| | | formatResult(row, column, cellValue){ |
| | | if(cellValue != undefined || cellValue != null){ |
| | | if(cellValue == 'ä¸åæ ¼'){ |
| | | return "<span style='color:#E84738;'>ä¸åæ ¼</span>" |
| | | } |
| | | return "<span style='color:#34BD66;'>åæ ¼</span>" |
| | | } |
| | | }, |
| | | formatDateTime(row, column, cellValue) { |
| | | return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : '' |
| | | }, |
| | | getData() { |
| | | this.$refs.packageInspectTable.getDataList() |
| | | }, |
| | | // tableèªå¸¦äºä»¶ |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |