Browse Source

Merge branch 'master' into ouqian

# Conflicts:
#	src/views/business/comps/template/TemplateTable.vue
lkf
ouqian 1 month ago
parent
commit
ad7fd4c0b5
10 changed files with 707 additions and 63 deletions
  1. +13
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +88
    -49
      src/components/Template/CustomTable.vue
  3. +124
    -3
      src/components/Template/HandleFormItem.vue
  4. +10
    -1
      src/lang/en/template/dl.js
  5. +10
    -1
      src/lang/zh/template/dl.js
  6. +24
    -2
      src/views/business/comps/template/TemplateTable.vue
  7. +208
    -0
      src/views/business/comps/template/comps/dl/DL016.vue
  8. +205
    -0
      src/views/business/comps/template/comps/dl/DL020.vue
  9. +23
    -5
      src/views/business/comps/template/comps/yp/YP003.vue
  10. +2
    -2
      vue.config.js

+ 13
- 0
src/components/Template/BaseInfoFormPackage.vue View File

@ -114,6 +114,13 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxTag'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxTag" :item="sItem" :value="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]"
@ -268,6 +275,12 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxTag'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxTag" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)"
@change="(e) => onAttachmentChange(key, e)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)"

+ 88
- 49
src/components/Template/CustomTable.vue View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="custom-table-wrapper" :class="{'no-border': !isBorder}">
<div class="custom-table-wrapper" :class="{ 'no-border': !isBorder }">
<div class="custom-table-header" v-if="isBorder">
<div class="custom-table-row">
<div v-if="showSort" class="custom-table-cell header-cell sort-cell">
@ -19,8 +19,9 @@
:error="hasError(-1, index, col.headerSelectKey)"
@update:error="onErrorUpdate(-1, index, col.headerSelectKey, $event)" />
</template>
<div v-else-if="headerSelectFields[col.headerSelectKey]" class="fill-type-icon" :style="{ width: (templateFillType !== 'actFill')? '60px' : 'auto' }">({{
headerSelectFields[col.headerSelectKey] }})</div>
<div v-else-if="headerSelectFields[col.headerSelectKey]" class="fill-type-icon"
:style="{ width: (templateFillType !== 'actFill') ? '60px' : 'auto' }">({{
headerSelectFields[col.headerSelectKey] }})</div>
</div>
@ -42,7 +43,7 @@
<div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell"
:style="getCellWidth(col)">
<div class="inner-table-cell">
<div class="flex1" :class="{'item-center': !isBorder && col.label}">
<div class="flex1" :class="{ 'item-center': !isBorder && col.label }">
<div v-if="!isBorder && col.label" class="mr-5">
{{ $t(col.label) }}
</div>
@ -54,7 +55,7 @@
@change="onBodyValueChange(rowIndex, colIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
@beforeSaveRecord = "(data,callback)=>beforeSaveRecord(data,callback,rowIndex, col,row)"
@beforeSaveRecord="(data, callback) => beforeSaveRecord(data, callback, rowIndex, col, row)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</template>
<template v-else-if="col.bodyType === 'inputNumber'">
@ -65,7 +66,7 @@
@blur="onBlur(rowIndex, col.prop, $event)"
@change="onBodyValueChange(rowIndex, colIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@beforeSaveRecord = "(data,callback)=>beforeSaveRecord(data,callback,rowIndex, col,row)"
@beforeSaveRecord="(data, callback) => beforeSaveRecord(data, callback, rowIndex, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</template>
@ -75,7 +76,7 @@
:fieldItemLabel="fieldItemLabel" type="select" class="body-select"
@blur="onBlur(rowIndex, col.prop, $event)"
:item="getBodyItem(col, rowIndex)" v-model="row[col.prop]"
@change="onBodyValueChange(rowIndex, colIndex, $event,row,'select')"
@change="onBodyValueChange(rowIndex, colIndex, $event, row, 'select')"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
@ -93,14 +94,13 @@
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div>
<div class="flex flex1" v-else-if="isRegent(col,'bodyType')">
<div class="flex flex1" v-else-if="isRegent(col, 'bodyType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable"
sourceFrom = "customTable"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
:error="hasError(rowIndex, colIndex, col.prop)"
@onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,col, rowIndex, colIndex, row)"
@beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,col,row)"
sourceFrom="customTable" :item="getBodyItem(col, rowIndex)"
:value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row)"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div>
@ -109,10 +109,20 @@
{{ row[col.prop] }}
</div>
</template>
<template v-else-if="col.bodyType === 'span'">
<div class="body-span">
{{ row[col.prop] }}
<template v-else-if="col.bodyType === 'checkboxTag'">
<div class="flex flex-wrap">
<HandleFormItem v-for="(tag, tagIndex) in row[col.prop]" :key="tagIndex"
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex + '_' + tagIndex"
:fieldItemLabel="fieldItemLabel" type="checkboxTag"
@blur="onBlur(rowIndex, col.prop, $event)"
:value="tag"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex,tagIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div>
</template>
</div>
@ -130,14 +140,15 @@
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" />
</div>
</div>
<div class="m-l-5 flex1" v-if="isShowBodySub(col, row)">
<div class="m-l-5" :class="{ 'flex1': col.bodySubType !== 'button' }"
v-if="isShowBodySub(col, row)">
<template v-if="col.bodySubType === 'inputNumber'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" type="inputNumber"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex,$event,)"
@change="onBodySubValueChange(rowIndex, colIndex, $event,)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -148,7 +159,7 @@
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex,$event,)"
@change="onBodySubValueChange(rowIndex, colIndex, $event,)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -158,7 +169,7 @@
:fieldItemLabel="fieldItemLabel" type="select" class="body-select"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
:item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex, $event,row,'select')"
@change="onBodySubValueChange(rowIndex, colIndex, $event, row, 'select')"
:error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -169,12 +180,18 @@
{{ row[col.bodySubKey] }}
</div>
</template>
<template v-else-if="col.bodySubType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)"
:value="row[col.bodySubKey]"
@clickButton="(e, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template>
</div>
</div>
</div>
<!-- 默认操作栏 -->
<div class="custom-table-cell body-cell" :style="{ width: isBorder ? '245px' : 'auto' }" v-if="showOperation">
<div class="custom-table-cell body-cell" :style="{ width: isBorder ? '245px' : 'auto' }"
v-if="showOperation">
<div class="inner-table-cell">
<slot name="operation" :row="row" :rowIndex="rowIndex" :columns="getOperationColumns()">
</slot>
@ -300,14 +317,20 @@ export default {
this.oldLocalDataSource = [];
},
methods: {
beforeSaveRecord(data,callback,rowIndex, col,row){
this.$emit("beforeSaveRecord", {inputData:data, callback,rowIndex, key:col.prop, rowData:row,dataSource:this.localDataSource})
onCheckboxTagChange(rowIndex, colIndex,tagIndex, e) {
console.log(e,"eee")
},
handleClickButton(e, data, key, rowIndex, colIndex) {
this.$emit("clickButton", key, rowIndex, colIndex, e, data,)
},
beforeSaveRecord(data, callback, rowIndex, col, row) {
this.$emit("beforeSaveRecord", { inputData: data, callback, rowIndex, key: col.prop, rowData: row, dataSource: this.localDataSource })
},
getCellWidth(col){
const {templateFillType} = this;
getCellWidth(col) {
const { templateFillType } = this;
let width = col.width ? col.width + 'px' : 'auto';
if(templateFillType !== "actFill" && templateFillType !== "preFill"){
width = (col.showWidth)?col.showWidth + 'px' :(col.width ? col.width + 'px' : 'auto')
if (templateFillType !== "actFill" && templateFillType !== "preFill") {
width = (col.showWidth) ? col.showWidth + 'px' : (col.width ? col.width + 'px' : 'auto')
}
return { width }
},
@ -348,18 +371,18 @@ export default {
}
this.$emit("clickable", col, rowIndex, row)
},
onBeforeReagentSubmit(data, callback, col, row){
onBeforeReagentSubmit(data, callback, col, row) {
if (this.templateFillType !== 'actFill') {
return
}
this.$emit("beforeReagentSubmit", {selectData:data, callback, key:col.prop, rowData:row})
this.$emit("beforeReagentSubmit", { selectData: data, callback, key: col.prop, rowData: row })
},
onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row){
onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row) {
if (this.templateFillType !== 'actFill') {
return
}
this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:inputValue})
this.$emit("onRegentSubmit", {selectInfo:data,key:col.prop, col, rowIndex, colIndex, rowData:row})
this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: inputValue })
this.$emit("onRegentSubmit", { selectInfo: data, key: col.prop, col, rowIndex, colIndex, rowData: row })
},
isShowAddRos() {
if (this.showAddRow !== undefined) {
@ -374,7 +397,7 @@ export default {
if (this.isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {//
return
}
this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:this.localDataSource[rowIndex][col.copyFrom]},"clickable")
this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: this.localDataSource[rowIndex][col.copyFrom] }, "clickable")
this.onBlur(rowIndex, col.prop, this.localDataSource[rowIndex][col.prop]);
}
},
@ -526,7 +549,7 @@ export default {
this.headerSelectFields[col.headerSelectTo] = value;
}
this.headerSelectFields[col.headerSelectKey] = value;
this.$emit('headerSelectChange', {key:col.headerSelectKey, headerSelectFields:this.headerSelectFields,dataSource:this.localDataSource});
this.$emit('headerSelectChange', { key: col.headerSelectKey, headerSelectFields: this.headerSelectFields, dataSource: this.localDataSource });
//
this.formErrors = this.formErrors.filter(error =>
!(error.rowIndex === -1 &&
@ -588,7 +611,7 @@ export default {
},
//
onBodyValueChange(rowIndex, colIndex, value,row,type) {
onBodyValueChange(rowIndex, colIndex, value, row, type) {
const col = this.columns[colIndex];
this.localDataSource[rowIndex][col.prop] = value;
@ -601,12 +624,12 @@ export default {
error.colIndex === colIndex &&
error.field === col.prop)
);
if(type === "select"){
this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.prop,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields});
if (type === "select") {
this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.prop, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields });
}
},
//
onBodySubValueChange(rowIndex, colIndex, value,row,type) {
onBodySubValueChange(rowIndex, colIndex, value, row, type) {
const col = this.columns[colIndex];
this.localDataSource[rowIndex][col.bodySubKey] = value;
@ -629,8 +652,8 @@ export default {
error.colIndex === colIndex &&
error.field === col.bodySubKey)
);
if(type === "select"){
this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.bodySubKey,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields});
if (type === "select") {
this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.bodySubKey, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields });
}
},
getHeaderItem(col) {
@ -651,13 +674,20 @@ export default {
copyFrom: col.copyFrom || "",
compareTo: col.compareTo, // compareTo
type: col.bodyType || "input",
filledCodes:col.filledCodes,
filledCodes: col.filledCodes,
};
if (col.bodyDisabled) {
item.disabled = col.bodyDisabled;
}
return item
},
getBodyButtonItem(col,) {
return {
buttonName: col.bodySubButtonName,
fillType: col.bodySubFillType,
type: "button",
}
},
getBodySubItem(col) {
const item = {
fillType: col.bodySubFillType,
@ -719,7 +749,7 @@ export default {
targetStartSolutionVolumePrecision: 3,//3
});
},
//
addRow(row = {}) {
this.localDataSource.push(row);
@ -779,7 +809,7 @@ export default {
}
}
this.$emit("blur", { rowIndex, colKey, value,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields, item: this.localDataSource[rowIndex] });
this.$emit("blur", { rowIndex, colKey, value, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields, item: this.localDataSource[rowIndex] });
},
onSubBlur(rowIndex, colKey, value) {
//
@ -810,13 +840,16 @@ export default {
font-size: 14px;
color: #606266;
margin-top: 20px;
&.no-border {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 5px 5px;
border: none;
.custom-table-cell {
border-right: none;
}
.custometable-row {
display: flex;
border-bottom: none;
@ -885,7 +918,7 @@ export default {
text-align: left;
vertical-align: middle;
border-right: 1px solid #ebeef5;
page-break-inside: avoid;
page-break-inside: avoid;
box-sizing: border-box;
}
@ -897,15 +930,15 @@ export default {
color: #909399;
background-color: #f5f7fa;
font-size: 12px;
word-break: break-word;
white-space: normal;
word-break: break-word;
white-space: normal;
}
.body-cell {
color: #606266;
page-break-inside: avoid;
page-break-inside: avoid;
background-color: #fff;
}
@ -980,15 +1013,21 @@ export default {
.body-span {
text-align: center;
}
.item-center {
display: flex;
align-items: center;
}
.mr-5{
.mr-5 {
margin-right: 5px;
}
.sort-cell{
.sort-cell {
text-align: center;
width: 100px;
}
.flex-wrap{
flex-wrap: wrap;
}
</style>

+ 124
- 3
src/components/Template/HandleFormItem.vue View File

@ -1,6 +1,6 @@
<template>
<div class="flex " :class="type !=='radio' ? 'flex1' : ''">
<div class="flex" :class="type !=='radio' ? 'flex1' : ''">
<div class="flex " :class="getFlexClass()">
<div class="flex" :class="getFlexClass()">
<el-input v-if="type === 'input'" :maxlength="item.maxlength || 50" :disabled="getDisabled()"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" @blur="onBlur"
:placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" />
@ -89,6 +89,30 @@
<div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div>
</el-upload>
</template>
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div class="checkbox-tag-item">
<el-checkbox v-model="checkboxTagChecked" :disabled="getDisabled()" @change="onCheckboxTagChange"></el-checkbox>
<div class="tag-content blue-border" @click="onTagClick">
<el-input v-if="isEditingTag"
v-model="tagValue"
ref="tagInput"
:maxlength="item.maxlength || 20"
@blur="onTagBlur"
@keyup.enter.native="onTagBlur"
placeholder="请输入"
size="mini"
class="tag-input" />
<el-tag v-else
:type="'info'"
class="tag-display"
:closable="false">
{{ tagValue || '点击输入' }}
</el-tag>
</div>
<i class="el-icon-close delete-icon" @click="onDeleteTag" v-if="tagValue"></i>
</div>
</div>
</div>
<div class="handle-row" v-if="isShowHandle()">
@ -218,7 +242,7 @@ export default {
},
data() {
let initialValue = this.value;
let initialOtherValues = {};
let initialOtherValues = {},checkboxTagChecked = false,tagValue = '';
// checkboxListvalue
if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') {
@ -226,6 +250,9 @@ export default {
initialOtherValues = this.value.otherValues || {};
} else if (this.type === 'checkboxList' && !Array.isArray(this.value)) {
initialValue = [];
}else if (this.type === 'checkboxTag' && this.value && typeof this.value === 'object') {
checkboxTagChecked = this.value.checked || false;
tagValue = this.value.tagValue || '';
}
return {
inputValue: initialValue,
@ -241,6 +268,9 @@ export default {
replyContent: '', //
visible: false,//
checkboxValue: this.getChecked(),//
checkboxTagChecked: checkboxTagChecked, // checkboxTagcheckbox
tagValue: tagValue, // checkboxTagtag
isEditingTag: false, // tag
uuid: getuuid(), // EventBus
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], ////
selectRegentInfo: {},////
@ -255,9 +285,13 @@ export default {
},
watch: {
value(newVal) {
console.log(newVal,"newVal")
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') {
this.inputValue = newVal.checkboxValues || [];
this.otherValues = newVal.otherValues || {};
} else if (this.type === 'checkboxTag' && newVal && typeof newVal === 'object') {
this.checkboxTagChecked = newVal.checked || false;
this.tagValue = newVal.tagValue || '';
} else {
this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal;
}
@ -294,6 +328,10 @@ export default {
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit)
},
methods: {
getFlexClass(){
const noFlexArr = ["radio","checkboxTag"]
return noFlexArr.includes(this.type) ? '' : 'flex1'
},
getDecimalDigits(){
const {precision} = this.item;
if(!isNaN(precision)){
@ -774,6 +812,40 @@ export default {
this.otherValues[code] = value;
this.onInputChange();
},
// checkboxTagcheckbox
onCheckboxTagChange() {
this.emitCheckboxTagValue();
},
// tag
onTagClick() {
this.isEditingTag = true;
this.$nextTick(() => {
this.$refs.tagInput && this.$refs.tagInput.focus();
});
},
// tag
onTagBlur() {
this.isEditingTag = false;
this.emitCheckboxTagValue();
//
if (this.tagValue) {
this.onCommonHandleSaveRecord(this.tagValue);
}
},
// tag
onDeleteTag() {
this.tagValue = '';
this.emitCheckboxTagValue();
this.onCommonHandleSaveRecord('');
},
// checkboxTag
emitCheckboxTagValue() {
const value = {
checked: this.checkboxTagChecked,
tagValue: this.tagValue
};
this.$emit('change', value);
},
//
onBlur(e) {
this.onCommonHandleSaveRecord(e.target.value);
@ -927,6 +999,9 @@ export default {
}
if(this.type === "button"){
this.$emit('clickButton', this.item,this.inputValue,data);
if(this.templateFillType === "preFill"){
return;
}
}
//
this.oldValue = value; //
@ -1569,4 +1644,50 @@ export default {
border-color: #f9c588;
}
}
// checkboxTag
.checkbox-tag-container {
border-radius: 4px;
// transition: all 0.3s;
margin-bottom: 5px;
margin-right: 5px;
&.error-border {
border-color: #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important;
}
.checkbox-tag-item {
display: flex;
align-items: center;
gap: 8px;
.tag-content {
cursor: pointer;
.tag-input {
width: 100px;
}
.tag-display {
cursor: pointer;
user-select: none;
}
}
.delete-icon {
cursor: pointer;
color: #909399;
font-size: 14px;
padding: 2px;
border-radius: 50%;
// transition: all 0.3s;
&:hover {
color: #ff5d5d;
background-color: #f5f5f5;
}
}
}
}
</style>

+ 10
- 1
src/lang/en/template/dl.js View File

@ -1,4 +1,13 @@
//毒理
export default {
dl001: {}
dl001: {},
dl020: {
swdljlbxx: '毒理记录表信息',
xbxx:'细胞信息',
sydd:'实验地点',
czsj:'操作时间',
qxbd: '前序表单',
dlbz: '备注',
czbz: '操作步骤',
}
}

+ 10
- 1
src/lang/zh/template/dl.js View File

@ -1,4 +1,13 @@
//毒理
export default {
dl001: {}
dl001: {},
dl020: {
swdljlbxx: '毒理记录表信息',
xbxx:'细胞信息',
sydd:'实验地点',
czsj:'操作时间',
qxbd: '前序表单',
dlbz: '备注',
czbz: '操作步骤',
}
}

+ 24
- 2
src/views/business/comps/template/TemplateTable.vue View File

@ -86,6 +86,9 @@ import DL012 from './comps/dl/DL012.vue'
import DL013 from './comps/dl/DL013.vue'
import DL014 from './comps/dl/DL014.vue'
import DL015 from './comps/dl/DL015.vue'
import DL016 from "./comps/dl/DL016.vue";
import DL020 from "./comps/dl/DL020.vue";
export default {
name: "TemplateTable",
@ -121,7 +124,24 @@ export default {
DL012,
DL013,
DL014,
DL015
DL015,
DL016,
DL020
},
data() {
return {
componentMap: null,
}
},
methods: {
getTemplateComponent() {
if (!this.sn) return 'Demo';
let componentName = this.componentMap[this.sn] || 'Demo';
return componentName;
},
handleEditSignCancel(e) {
EventBus.$emit('edit-sign-cancel', e);
},
},
props: {
sn: {
@ -222,6 +242,8 @@ export default {
'DL013': 'DL013',
'DL014': 'DL014',
'DL015': 'DL015',
'DL016': 'DL016',
'DL020': 'DL020',
}
}
return this.componentMap || "Demo"
@ -408,4 +430,4 @@ export default {
padding: 10px 10px;
width: 100%;
}
</style>
</style>

+ 208
- 0
src/views/business/comps/template/comps/dl/DL016.vue View File

@ -0,0 +1,208 @@
<!-- 生物分析生物样品采集管制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.yp.yp004.zbxx" />
<CustomTable
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
</template>
</CustomTable>
<LineLabel label="template.yp.yp004.zbbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "DL016",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
}
},
{
type: "conditionItem",
label: 'template.yp.yp004.pztj',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
compareTo: "pre",
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.lba.lba002.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
tableColumns() {
return [{
label: 'template.yp.yp004.zbdx',
prop: 'zbdx',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength: 50,
},{
label: 'template.yp.yp004.yjzbs',
prop: 'yjzbs',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength: 10,
},{
label: 'template.yp.yp004.sjzbs',
prop: 'sjzbs',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 280,
bodyMaxlength: 10,
copyFrom:'yjzbs',
compareTo:'yjzbs'
}]
},
},
data() {
return {
formData: {},
};
},
mounted() {
},
methods: {
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]);
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
let content = await this.$refs.stepRef.getFormData();
console.log(content);
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>

+ 205
- 0
src/views/business/comps/template/comps/dl/DL020.vue View File

@ -0,0 +1,205 @@
<!-- 生物样品接收记录表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.xbxx" label="template.dl.dl020.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData"
/>
<LineLabel label="template.dl.dl020.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.dlbz" label="template.dl.dl020.dlbz"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import moment from "moment";
export default {
name: "DL020",
components: { BaseInfoFormPackage, LineLabel, TableList, Step },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
}
},
{
type: "cellItem",
label: 'template.dl.dl020.sydd',
config: {
pre: {
label: 'template.dl.dl020.sydd',
type: "input",
fillType: "actFill",
},
}
},
{
type: "cellItem",
label: 'template.dl.dl020.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
swypyjInfoFormConfig() {
return [
{
type: "cellItem",
config: {
qxbd: {
span:1,
label: 'template.dl.dl020.qxbd',
type: 'qxbd',
fillType: 'actFill',
filledCodes:['bdmc','bdbh'],
},
}
},
]
},
},
data() {
return {
formData: {},
};
},
mounted() {
},
methods: {
//
// handleClickButton(item,signData){
// this.$refs.ypjsInfoRef.updateFormData("jssj", moment().format("YYYY/MM/DD HH:mm"),{isUpdateRecord:true,signData});
// },
//
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
const swypyjData = this.$refs.swypyjInfoRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
const stepData = this.$refs.stepRef.getFilledFormData();
return {
...baseData,
...swypyjData,
...remarkData,
...stepData,
}
},
//
async getFormData() {
//
const validFlag = await this.validFields();
if (!validFlag) {
return false;
}
let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "swypyjInfoRef", "stepRef", "remarkRef"];
return await this.validFormFields(refsToValidate);
},
getResource() {
let content = this.getFilledFormData();
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
.config-header-end {
display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
</style>

+ 23
- 5
src/views/business/comps/template/comps/yp/YP003.vue View File

@ -19,6 +19,7 @@
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
@clickButton="handleClickButton"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
@ -34,9 +35,6 @@
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
<el-button type="primary" @click="showImportExcelDialog">{{ $t('template.common.importTemplate')
}}</el-button>
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" />
</div>
</template>
@ -166,8 +164,13 @@ export default {
},{
label: 'template.yp.yp003.dwbh',
prop: 'dwbh',
bodyType: 'input',
bodyType: 'checkboxTag',
bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"preFill",
bodySubButtonName:"template.common.importTemplate",
bodySubKey:"exportBtn",
showBodySub:true,
width: 280,
},{
label: 'template.yp.yp003.ypsl',
@ -181,11 +184,19 @@ 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()
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"])
@ -220,7 +231,14 @@ export default {
this.$refs.ImportExcelDialog.show()
},
onLoadExcelData(excelData) {
console.log(excelData)
const data = excelData.splice(1);
const tagData = data.map((item)=>{
return {
checked:false,
tagValue:item[0],
}
})
this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex,{dwbh:tagData});
this.$refs.ImportExcelDialog.cancel()
},
downloadExcelTemplate(arr){

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
// target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save