| | |
| | | <basic-container> |
| | | <ttable |
| | | :table="table" |
| | | :resultData="resultData" |
| | | @change ="costPlannedAmountChange" |
| | | @handleSelectionChange="handleSelectionChange" |
| | | :prelang="prelang" |
| | | :options="options" |
| | |
| | | ></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' |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | resultData:[], |
| | | addOrUpdateVisible: false, |
| | | type: [1], |
| | | prelang: 'rawMaterial', |
| | |
| | | currentPage: 1, |
| | | pageSize: 20, |
| | | data: [], |
| | | isExport:true, |
| | | // 标题 |
| | | column: [ |
| | | { |
| | |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | render: { fun: this.addOrUpdateHandle } |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'projectName', |
| | | label: '项目名称', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | |
| | | label: '合格状态', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | searchInfoType: 'select', |
| | | formatter: this.formatJudgeState, |
| | | optList: () => { |
| | | return this.StateList |
| | | } |
| | | }, |
| | | ], |
| | | toolbar: [ |
| | |
| | | }, |
| | | { |
| | | text: '导出', |
| | | type: 'primary', |
| | | fun: this.handleExcel |
| | | } |
| | | ], |
| | | operator: [{ |
| | | text: '打印', |
| | | type: 'text', |
| | | size: 'small', |
| | | },{ |
| | | text: '作废', |
| | | type: 'text', |
| | | size: 'small', |
| | |
| | | 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.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 |
| | | }); |
| | | }, |
| | | // 删除 |
| | | deleteHandle(row) { |
| | | this.$confirm('是否确认删除该数据:' + row.code , '提示', { |
| | |
| | | addOrUpdateHandle(row) { |
| | | this.$router.push({ |
| | | name: 'rawMaterialForm', |
| | | query: { id: row == null ? null : row.id } |
| | | query: { |
| | | id: row == null ? null : row.id, |
| | | resultVal: row == null ? null : row.judgeState |
| | | } |
| | | }) |
| | | }, |
| | | formatInsState(row, column, cellValue){ |
| | |
| | | }, |
| | | getData() { |
| | | this.$refs.rawMaterialTable.getDataList() |
| | | |
| | | }, |
| | | // table自带事件 |
| | | handleSelectionChange(val) { |