|
|
@ -17,8 +17,11 @@ |
|
|
:ref="`tableRef`" |
|
|
:ref="`tableRef`" |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:formData="formData" |
|
|
:formData="formData" |
|
|
|
|
|
operationWidth = "80px" |
|
|
:prefixKey = "`table`" |
|
|
:prefixKey = "`table`" |
|
|
fieldItemLabel = "template.common.operationSteps" |
|
|
|
|
|
|
|
|
fieldItemLabel = "template.yp.yp005.ybsm" |
|
|
|
|
|
@clickButton="handleClickButton" |
|
|
|
|
|
@onCheckboxTagChange="onCheckboxTagChange" |
|
|
:showOperation="fillType === 'preFill'" |
|
|
:showOperation="fillType === 'preFill'" |
|
|
> |
|
|
> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
@ -34,6 +37,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
|
|
|
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['组织']" @downloadExcelTemplate="downloadExcelTemplate" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -48,10 +52,12 @@ import { EventBus } from "@/utils/eventBus"; |
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
import { debounce } from 'lodash-es' |
|
|
import { debounce } from 'lodash-es' |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
|
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
|
|
|
import moment from "moment"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "YP003", |
|
|
name: "YP003", |
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete }, |
|
|
|
|
|
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog }, |
|
|
mixins: [templateMixin], |
|
|
mixins: [templateMixin], |
|
|
props: { |
|
|
props: { |
|
|
fillType: { |
|
|
fillType: { |
|
|
@ -147,14 +153,25 @@ export default { |
|
|
},{ |
|
|
},{ |
|
|
label: 'template.yp.yp005.zz', |
|
|
label: 'template.yp.yp005.zz', |
|
|
prop: 'zz', |
|
|
prop: 'zz', |
|
|
bodyType: 'input', |
|
|
|
|
|
|
|
|
bodyType: 'checkboxTag', |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
|
|
|
bodySubType:"button", |
|
|
|
|
|
bodySubFillType:"preFill", |
|
|
|
|
|
bodySubButtonName:"template.common.importTemplate", |
|
|
|
|
|
bodySubKey:"exportBtn", |
|
|
|
|
|
showBodySub:this.fillType === "preFill", |
|
|
width: 280, |
|
|
width: 280, |
|
|
},{ |
|
|
},{ |
|
|
label: 'template.yp.yp005.qxsj', |
|
|
label: 'template.yp.yp005.qxsj', |
|
|
prop: 'qxsj', |
|
|
prop: 'qxsj', |
|
|
bodyType: 'input', |
|
|
bodyType: 'input', |
|
|
bodyFillType: 'actFill', |
|
|
bodyFillType: 'actFill', |
|
|
|
|
|
|
|
|
|
|
|
bodySubType:"button", |
|
|
|
|
|
bodySubFillType:"actFill", |
|
|
|
|
|
bodySubButtonName:"template.yp.yp005.ks", |
|
|
|
|
|
bodySubKey:"startBtn", |
|
|
|
|
|
showBodySub:this.fillType === "actFill", |
|
|
width: 280, |
|
|
width: 280, |
|
|
}] |
|
|
}] |
|
|
}, |
|
|
}, |
|
|
@ -162,11 +179,34 @@ export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
formData: {}, |
|
|
formData: {}, |
|
|
|
|
|
currentRowIndex: -1, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 点击按钮 |
|
|
|
|
|
handleClickButton(key,rowIndex,colIndex,e,data){ |
|
|
|
|
|
if(key === "exportBtn"){ |
|
|
|
|
|
this.currentRowIndex = rowIndex; |
|
|
|
|
|
this.$refs.ImportExcelDialog.show() |
|
|
|
|
|
} |
|
|
|
|
|
if(key === "startBtn"){ |
|
|
|
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex,{ |
|
|
|
|
|
qxsj: moment().format("YYYY/MM/DD HH:mm"), |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
// //通知后端保存数据 |
|
|
|
|
|
// const params = { |
|
|
|
|
|
// type: "fieldChanged", |
|
|
|
|
|
// newRecord: null, |
|
|
|
|
|
// resourceList: null, |
|
|
|
|
|
// } |
|
|
|
|
|
// EventBus.$emit('onModifyRecord', params,) |
|
|
|
|
|
// }) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
//获取已填写的表单数据 |
|
|
//获取已填写的表单数据 |
|
|
getFilledFormData() { |
|
|
getFilledFormData() { |
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]) |
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]) |
|
|
@ -195,6 +235,29 @@ export default { |
|
|
tableRef.deleteRow(rowIndex); |
|
|
tableRef.deleteRow(rowIndex); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onLoadExcelData(excelData) { |
|
|
|
|
|
const data = excelData.splice(1); |
|
|
|
|
|
const tagData = data.map((item)=>{ |
|
|
|
|
|
return { |
|
|
|
|
|
checked:undefined, |
|
|
|
|
|
tagValue:item[0], |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex,{zz:tagData}); |
|
|
|
|
|
this.$refs.tableRef.onErrorUpdate(this.currentRowIndex, 1, 'zz', false) |
|
|
|
|
|
this.$refs.ImportExcelDialog.cancel() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.justUpdateFilledFormData(); |
|
|
|
|
|
}, 100); |
|
|
|
|
|
}, |
|
|
|
|
|
downloadExcelTemplate(arr){ |
|
|
|
|
|
this.exportExcel(arr) |
|
|
|
|
|
}, |
|
|
|
|
|
onCheckboxTagChange(rowIndex,colIndex,data){ |
|
|
|
|
|
const num = data.filter((item)=>item.checked).length; |
|
|
|
|
|
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, {'ypsl':num}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|