Browse Source

feat: [模板管理] 样品

ouqian
memorylkf 1 month ago
parent
commit
a0e09ca387
4 changed files with 73 additions and 6 deletions
  1. +3
    -1
      src/lang/en/template/yp.js
  2. +3
    -1
      src/lang/zh/template/yp.js
  3. +1
    -1
      src/views/business/comps/template/comps/yp/YP002.vue
  4. +66
    -3
      src/views/business/comps/template/comps/yp/YP005.vue

+ 3
- 1
src/lang/en/template/yp.js View File

@ -57,6 +57,8 @@ export default {
ybsm: 'Sample Description',
zz: 'Tissue',
qxsj: 'Cleaning time',
qxbz: 'Cleaning Procedure'
qxbz: 'Cleaning Procedure',
ks: 'Start',
js: 'Finish'
}
}

+ 3
- 1
src/lang/zh/template/yp.js View File

@ -57,6 +57,8 @@ export default {
ybsm: '样本说明',
zz: '组织',
qxsj: '清洗时间',
qxbz: '清洗步骤'
qxbz: '清洗步骤',
ks: '开始',
js: '结束'
}
}

+ 1
- 1
src/views/business/comps/template/comps/yp/YP002.vue View File

@ -141,7 +141,7 @@ export default {
maxlength: 200,
subType:"button",
subKey:"jssjButton",
buttonName:"获取时间"
buttonName:"template.yp.yp002.hqsj"
},
}
},

+ 66
- 3
src/views/business/comps/template/comps/yp/YP005.vue View File

@ -17,8 +17,11 @@
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
operationWidth = "80px"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
fieldItemLabel = "template.yp.yp005.ybsm"
@clickButton="handleClickButton"
@onCheckboxTagChange="onCheckboxTagChange"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
@ -34,6 +37,7 @@
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['组织']" @downloadExcelTemplate="downloadExcelTemplate" />
</div>
</template>
@ -48,10 +52,12 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import ImportExcelDialog from '../../dialog/ImportExcelDialog'
import moment from "moment";
export default {
name: "YP003",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog },
mixins: [templateMixin],
props: {
fillType: {
@ -147,14 +153,25 @@ export default {
},{
label: 'template.yp.yp005.zz',
prop: 'zz',
bodyType: 'input',
bodyType: 'checkboxTag',
bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"preFill",
bodySubButtonName:"template.common.importTemplate",
bodySubKey:"exportBtn",
showBodySub:this.fillType === "preFill",
width: 280,
},{
label: 'template.yp.yp005.qxsj',
prop: 'qxsj',
bodyType: 'input',
bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"actFill",
bodySubButtonName:"template.yp.yp005.ks",
bodySubKey:"startBtn",
showBodySub:this.fillType === "actFill",
width: 280,
}]
},
@ -162,11 +179,34 @@ export default {
data() {
return {
formData: {},
currentRowIndex: -1,
};
},
mounted() {
},
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() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"])
@ -195,6 +235,29 @@ export default {
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>

Loading…
Cancel
Save