Browse Source

feat:[模板管理][update]

luojie
luojie 4 weeks ago
parent
commit
f8a0cc6e3d
29 changed files with 115 additions and 104 deletions
  1. +4
    -1
      src/components/Template/BaseInfoFormPackage.vue
  2. +5
    -13
      src/components/Template/HandleFormItem.vue
  3. +43
    -24
      src/components/Template/mixins/formPackageMixins.js
  4. +1
    -1
      src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue
  5. +1
    -1
      src/views/business/comps/template/comps/gsp/GSP001.vue
  6. +1
    -1
      src/views/business/comps/template/comps/gsp/GSP003.vue
  7. +1
    -1
      src/views/business/comps/template/comps/gsp/GSP005.vue
  8. +1
    -1
      src/views/business/comps/template/comps/gsp/GSP009.vue
  9. +1
    -1
      src/views/business/comps/template/comps/gsp/GSP010.vue
  10. +1
    -1
      src/views/business/comps/template/comps/lba/LBA002.vue
  11. +1
    -1
      src/views/business/comps/template/comps/lba/LBA003.vue
  12. +1
    -1
      src/views/business/comps/template/comps/lba/LBA004.vue
  13. +1
    -1
      src/views/business/comps/template/comps/lba/LBA006.vue
  14. +1
    -1
      src/views/business/comps/template/comps/lba/LBA008.vue
  15. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR005.vue
  16. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR008.vue
  17. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR009.vue
  18. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR010.vue
  19. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR011.vue
  20. +1
    -1
      src/views/business/comps/template/comps/pcr/PCR012.vue
  21. +1
    -1
      src/views/business/comps/template/comps/sp/SP001.vue
  22. +2
    -1
      src/views/business/comps/template/comps/sp/SP003.vue
  23. +1
    -1
      src/views/business/comps/template/comps/sp/SP008.vue
  24. +1
    -1
      src/views/business/comps/template/comps/sp/SP009.vue
  25. +5
    -3
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  26. +32
    -39
      src/views/business/comps/template/comps/yp/YP003.vue
  27. +1
    -1
      src/views/business/comps/template/comps/yp/YP004.vue
  28. +1
    -1
      src/views/business/comps/template/comps/yp/YP005.vue
  29. +2
    -1
      src/views/business/comps/template/mixins/templateMixin.js

+ 4
- 1
src/components/Template/BaseInfoFormPackage.vue View File

@ -39,7 +39,10 @@
:field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)" :field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)"
:item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
@copy="onCopy(sItem, key)" :error="errors[sItem.otherCode]" @copy="onCopy(sItem, key)" :error="errors[sItem.otherCode]"
@update:error="errors[sItem.otherCode] = false" />
@update:error="errors[sItem.otherCode] = false"
:orange-bg="orangeBgFields[sItem.otherCode]"
/>
</div> </div>
</div> </div>

+ 5
- 13
src/components/Template/HandleFormItem.vue View File

@ -193,14 +193,8 @@
<span>{{ modificationRecords.length - 1 == index ? "提交" : "修改" }}</span> <span>{{ modificationRecords.length - 1 == index ? "提交" : "修改" }}</span>
</div> </div>
<div v-if="modificationRecords.length - 1 !== index"> <div v-if="modificationRecords.length - 1 !== index">
<div class="flex">
<span>原值</span>
<div v-html = "record.oldValue"></div>
</div>
<div class="flex">
<span>修改值</span>
<div v-html = "record.value"></div>
</div>
<div>原值{{ record.oldValue }}</div>
<div>修改值{{ record.value }}</div>
<div v-if="record.reason">备注{{ record.reason }}</div> <div v-if="record.reason">备注{{ record.reason }}</div>
</div> </div>
</div> </div>
@ -1293,12 +1287,10 @@ export default {
}else if(this.type === "attachment"){ }else if(this.type === "attachment"){
const attList = JSON.parse(recordValue); const attList = JSON.parse(recordValue);
const oldAttList = JSON.parse(recordOldVlaue || "[]"); const oldAttList = JSON.parse(recordOldVlaue || "[]");
const urlList = attList.map(item => {
return `<a href="${process.env.VUE_APP_FILE_DOMAIN+item.url}" target="_blank">${item.name}</a>`
});
recordValue = urlList.join("、");
recordOldVlaue = oldAttList.map(item => `<a href="${process.env.VUE_APP_FILE_DOMAIN+item.url}" target="_blank">${item.name}</a>`).join("、");
recordValue = attList.map(item => item.name).join(";");
recordOldVlaue = oldAttList.map(item => item.name).join(";");
} }
const record = { const record = {
...baseInfo, ...baseInfo,
oldValue: recordOldVlaue, oldValue: recordOldVlaue,

+ 43
- 24
src/components/Template/mixins/formPackageMixins.js View File

@ -260,7 +260,7 @@ export default {
} }
config[subKey] = { label: currentConfig.label, subKey, type: currentConfig.subType, fillType: currentConfig.subFillType || currentConfig.fillType, selectTo: currentConfig.selectTo } config[subKey] = { label: currentConfig.label, subKey, type: currentConfig.subType, fillType: currentConfig.subFillType || currentConfig.fillType, selectTo: currentConfig.selectTo }
} }
if(currentConfig.thirdKey){
if (currentConfig.thirdKey) {
const { thirdKey } = currentConfig; const { thirdKey } = currentConfig;
if (update) { if (update) {
result[thirdKey] = formFields[thirdKey] || formData[thirdKey] || ''; result[thirdKey] = formFields[thirdKey] || formData[thirdKey] || '';
@ -269,7 +269,7 @@ export default {
} }
config[thirdKey] = { label: currentConfig.label, thirdKey, type: currentConfig.thirdType, fillType: currentConfig.thirdFillType, selectTo: currentConfig.selectTo } config[thirdKey] = { label: currentConfig.label, thirdKey, type: currentConfig.thirdType, fillType: currentConfig.thirdFillType, selectTo: currentConfig.selectTo }
} }
if(currentConfig.fourthKey){
if (currentConfig.fourthKey) {
const { fourthKey } = currentConfig; const { fourthKey } = currentConfig;
if (update) { if (update) {
result[fourthKey] = formFields[fourthKey] || formData[fourthKey] || ''; result[fourthKey] = formFields[fourthKey] || formData[fourthKey] || '';
@ -293,6 +293,12 @@ export default {
this.compareFieldsIsEqual(currentValue, compareToValue, currentConfig.subKey) this.compareFieldsIsEqual(currentValue, compareToValue, currentConfig.subKey)
} }
if (currentConfig.otherCodeCompareTo && formData[currentConfig.otherCodeCompareTo] && result[currentConfig.otherCode]) {
const compareToValue = formData[currentConfig.otherCodeCompareTo];
const currentValue = result[currentConfig.otherCode];
this.compareFieldsIsEqual(currentValue, compareToValue, currentConfig.otherCode)
}
}); });
// 处理可能存在的直接otherCode字段 // 处理可能存在的直接otherCode字段
@ -350,24 +356,24 @@ export default {
const o = allFieldsConfig[key]; const o = allFieldsConfig[key];
if (o.otherCode) {// if (o.otherCode) {//
if (o.type === "select") { if (o.type === "select") {
const isSelectedOther = this.isShowOther(formFields[key],o);
const isSelectedOther = this.isShowOther(formFields[key], o);
if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段 if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段
formFields[o.otherCode] = ""; formFields[o.otherCode] = "";
} }
} else if (o.subType === "select") { } else if (o.subType === "select") {
const isSelectedOther = this.isShowOther(formFields[o.subKey],o);
const isSelectedOther = this.isShowOther(formFields[o.subKey], o);
if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段 if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段
formFields[o.otherCode] = ""; formFields[o.otherCode] = "";
} }
} else if (o.type === "radioAndOther") { } else if (o.type === "radioAndOther") {
const isSelectedOther = this.isShowOtherByRadioAndOther(formFields[key],o);
const isSelectedOther = this.isShowOtherByRadioAndOther(formFields[key], o);
if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段 if (!isSelectedOther) {//如果其他选项没有被选择,清空其他字段
formFields[o.otherCode] = ""; formFields[o.otherCode] = "";
} }
} }
} }
if (o.type === "attachment"&&o.fillType === this.templateFillType) {
if (o.type === "attachment" && o.fillType === this.templateFillType) {
const attValue = formFields[key]; const attValue = formFields[key];
if (!attValue || attValue == "[]") { if (!attValue || attValue == "[]") {
errors.push({ errors.push({
@ -377,9 +383,9 @@ export default {
}); });
this.$set(this.errors, key, true); this.$set(this.errors, key, true);
} }
} else if (o.type === "fqyq" &&o.fillType === this.templateFillType) {
} else if (o.type === "fqyq" && o.fillType === this.templateFillType) {
const fqyqValue = formFields[key] || {}; const fqyqValue = formFields[key] || {};
const {mainRadio, subRadio,inputValue} = fqyqValue;
const { mainRadio, subRadio, inputValue } = fqyqValue;
if (!mainRadio) { if (!mainRadio) {
errors.push({ errors.push({
field: key, field: key,
@ -388,7 +394,7 @@ export default {
}); });
this.$set(this.errors, key, true); this.$set(this.errors, key, true);
} else { } else {
if (mainRadio==="是") {
if (mainRadio === "是") {
if (!subRadio) { if (!subRadio) {
errors.push({ errors.push({
field: key, field: key,
@ -396,7 +402,7 @@ export default {
error: "请选择是否在规定时间完成" error: "请选择是否在规定时间完成"
}); });
this.$set(this.errors, key, true); this.$set(this.errors, key, true);
}else if(!inputValue){
} else if (!inputValue) {
errors.push({ errors.push({
field: key, field: key,
label: o.label, label: o.label,
@ -408,10 +414,10 @@ export default {
} }
continue continue
}else if(o.type === "checkboxTree"&&o.fillType === this.templateFillType){
} else if (o.type === "checkboxTree" && o.fillType === this.templateFillType) {
const checkboxTreeValue = formFields[key] || {}; const checkboxTreeValue = formFields[key] || {};
const {checkedValues=[],otherValues = {}} = checkboxTreeValue;;
const {options = []} = o;
const { checkedValues = [], otherValues = {} } = checkboxTreeValue;;
const { options = [] } = o;
//需要校验第一层是否有选中项 //需要校验第一层是否有选中项
const parentOptions = options.map(item => item.label); const parentOptions = options.map(item => item.label);
const isChecked = checkedValues.some(option => { const isChecked = checkedValues.some(option => {
@ -420,9 +426,9 @@ export default {
//获取所有选中的选项 //获取所有选中的选项
const allCheckedOptions = checkedValues.filter(item => item.checked).map(item => item.label); const allCheckedOptions = checkedValues.filter(item => item.checked).map(item => item.label);
//再筛选出需要显示其他输入框的选项 //再筛选出需要显示其他输入框的选项
const otherOptions = allCheckedOptions.filter((label)=>isShowOtherByCheckboxTree(label))
const otherOptions = allCheckedOptions.filter((label) => isShowOtherByCheckboxTree(label))
const isHasOtherInfo = otherOptions.every(item => otherValues[item]); const isHasOtherInfo = otherOptions.every(item => otherValues[item]);
console.log(isChecked,isHasOtherInfo,"isChecked")
console.log(isChecked, isHasOtherInfo, "isChecked")
if (!isChecked || !isHasOtherInfo) { if (!isChecked || !isHasOtherInfo) {
errors.push({ errors.push({
field: key, field: key,
@ -432,12 +438,12 @@ export default {
this.$set(this.errors, key, true); this.$set(this.errors, key, true);
} }
continue continue
}else if(o.type === "radioAndOther"&&o.fillType === this.templateFillType){
} else if (o.type === "radioAndOther" && o.fillType === this.templateFillType) {
const radioValue = formFields[key] || {}; const radioValue = formFields[key] || {};
const {otherCode} = o;
const { otherCode } = o;
const otherValue = formFields[otherCode] || ""; const otherValue = formFields[otherCode] || "";
const isShow = this.isShowOtherByRadioAndOther(radioValue,o)
if(isShow&&!otherValue){
const isShow = this.isShowOtherByRadioAndOther(radioValue, o)
if (isShow && !otherValue) {
errors.push({ errors.push({
field: key, field: key,
label: o.label, label: o.label,
@ -460,7 +466,7 @@ export default {
if (o.label === "template.common.other" && !this.isShowOther(formFields[o.parentKey])) { if (o.label === "template.common.other" && !this.isShowOther(formFields[o.parentKey])) {
continue continue
} }
//span的字段不校验 //span的字段不校验
if (o.type === "span" || o.type === "text" || o.type === "button") { if (o.type === "span" || o.type === "text" || o.type === "button") {
continue continue
@ -532,10 +538,23 @@ export default {
onValueChangeCompareTo(key, val, compKey) { onValueChangeCompareTo(key, val, compKey) {
// compareTo 功能:当fillType==="actFill"时,判断当前值是否与compareTo字段的值一样,如果不一样则将当前input框的背景色标记成橙色 // compareTo 功能:当fillType==="actFill"时,判断当前值是否与compareTo字段的值一样,如果不一样则将当前input框的背景色标记成橙色
const currentFieldConfig = this.allFieldsConfig[key]; const currentFieldConfig = this.allFieldsConfig[key];
if (currentFieldConfig && currentFieldConfig.fillType === "actFill" && (currentFieldConfig.compareTo || compKey)) {
const compareToKey = compKey || currentFieldConfig.compareTo;
const compareToValue = this.formFields[compareToKey];
this.compareFieldsIsEqual(val, compareToValue, key);
if (currentFieldConfig && currentFieldConfig.fillType === "actFill") {
if ((currentFieldConfig.compareTo || compKey)) {
const compareToKey = compKey || currentFieldConfig.compareTo;
const compareToValue = this.formFields[compareToKey];
this.compareFieldsIsEqual(val, compareToValue, key);
}
if (currentFieldConfig.otherCodeCompareTo && this.formFields[currentFieldConfig.otherCodeCompareTo] && this.formFields[currentFieldConfig.otherCode]) {
const compareToValue = this.formFields[currentFieldConfig.otherCodeCompareTo];
const currentValue = this.formFields[currentFieldConfig.otherCode];
this.compareFieldsIsEqual(currentValue, compareToValue, currentFieldConfig.otherCode)
}
if(currentFieldConfig.subCompareTo && this.formFields[currentFieldConfig.subCompareTo] && this.formFields[currentFieldConfig.subKey]){
const compareToValue = this.formFields[currentFieldConfig.subCompareTo];
const currentValue = this.formFields[currentFieldConfig.subKey];
this.compareFieldsIsEqual(currentValue, compareToValue, currentFieldConfig.subKey)
}
} }
}, },
onAttachmentChange(key, val) { onAttachmentChange(key, val) {

+ 1
- 1
src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue View File

@ -157,7 +157,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/gsp/GSP001.vue View File

@ -156,7 +156,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/gsp/GSP003.vue View File

@ -179,7 +179,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/gsp/GSP005.vue View File

@ -181,7 +181,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/gsp/GSP009.vue View File

@ -128,7 +128,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/gsp/GSP010.vue View File

@ -135,7 +135,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/lba/LBA002.vue View File

@ -128,7 +128,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/lba/LBA003.vue View File

@ -112,7 +112,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/lba/LBA004.vue View File

@ -188,7 +188,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/lba/LBA006.vue View File

@ -125,7 +125,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')
} }

+ 1
- 1
src/views/business/comps/template/comps/lba/LBA008.vue View File

@ -162,7 +162,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR005.vue View File

@ -166,7 +166,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR008.vue View File

@ -145,7 +145,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR009.vue View File

@ -162,7 +162,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR010.vue View File

@ -147,7 +147,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR011.vue View File

@ -147,7 +147,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/pcr/PCR012.vue View File

@ -148,7 +148,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/sp/SP001.vue View File

@ -157,7 +157,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 2
- 1
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -158,7 +158,8 @@ export default {
otherCode: "actOther", otherCode: "actOther",
multiple: true, multiple: true,
options: this.getDictOptions('business_pztj'), options: this.getDictOptions('business_pztj'),
compareTo: "pre"
compareTo: "pre",
otherCodeCompareTo: "preOther",
} }
} }
}, },

+ 1
- 1
src/views/business/comps/template/comps/sp/SP008.vue View File

@ -171,7 +171,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
compareTo: "pre", compareTo: "pre",
multiple: true, multiple: true,
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 1
- 1
src/views/business/comps/template/comps/sp/SP009.vue View File

@ -175,7 +175,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
compareTo: "pre", compareTo: "pre",
multiple: true, multiple: true,
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 5
- 3
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -268,7 +268,9 @@ export default {
} }
}, },
bodySelectChange(data) { bodySelectChange(data) {
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields, data.dataSource);
if(this.configType === "paralle"){//
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields, data.dataSource);
}
}, },
// //
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields, dataSource) { paralleUpdateTargetStartSolutionVolume(item, headerSelectFields, dataSource) {
@ -277,8 +279,8 @@ export default {
const params = { const params = {
headerSelectFields, headerSelectFields,
subTargetStartSolution, subTargetStartSolution,
dataSource,
} }
if (volumne) { if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne, params); this.updateTargetStartSolutionVolume(item, volumne, params);
} }
@ -303,7 +305,7 @@ export default {
const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData(); const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields
headerSelectFields,
} }
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params) this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params)
} else { } else {

+ 32
- 39
src/views/business/comps/template/comps/yp/YP003.vue View File

@ -10,25 +10,18 @@
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<!-- <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> --> <!-- <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> -->
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.yp.yp003.ybxx" /> <LineLabel label="template.yp.yp003.ybxx" />
<CustomTable
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
operationWidth = "80px"
:prefixKey = "`table`"
fieldItemLabel = "template.yp.yp003.ybxx"
@clickButton="handleClickButton"
@onCheckboxTagChange="onCheckboxTagChange"
:showOperation="fillType === 'preFill'"
>
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="formData" operationWidth="80px"
:prefixKey="`table`" fieldItemLabel="template.yp.yp003.ybxx" @clickButton="handleClickButton"
@onCheckboxTagChange="onCheckboxTagChange" :showOperation="fillType === 'preFill'">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="deleteRow"></TableOpertaionDelete>
</template> </template>
</CustomTable> </CustomTable>
<LineLabel label="template.yp.yp003.fqxx" /> <LineLabel label="template.yp.yp003.fqxx" />
<Step ref="stepRef" :formData="formData.stepData"></Step> <Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.yp.yp003.fqyq" label="template.yp.yp003.fqyq" <BaseInfoFormPackage fieldItemLabel="template.yp.yp003.fqyq" label="template.yp.yp003.fqyq"
@ -39,7 +32,8 @@
</div> </div>
</div> </div>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" />
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']"
@downloadExcelTemplate="downloadExcelTemplate" />
</div> </div>
</template> </template>
@ -58,7 +52,7 @@ import ImportExcelDialog from '../../dialog/ImportExcelDialog'
export default { export default {
name: "YP003", name: "YP003",
components: { ImportExcelDialog,BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
components: { ImportExcelDialog, BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -136,10 +130,10 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther", otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj')
options: this.getDictOptions('business_pztj'),
} }
} }
}, },
@ -181,18 +175,18 @@ export default {
bodyFillType: 'actFill', bodyFillType: 'actFill',
width: 100, width: 100,
bodyMaxlength: 50, bodyMaxlength: 50,
},{
}, {
label: 'template.yp.yp003.dwbh', label: 'template.yp.yp003.dwbh',
prop: 'dwbh', prop: 'dwbh',
bodyType: 'checkboxTag', bodyType: 'checkboxTag',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"preFill",
bodySubButtonName:"template.common.importTemplate",
bodySubKey:"exportBtn",
showBodySub:this.fillType === "preFill",
bodySubType: "button",
bodySubFillType: "preFill",
bodySubButtonName: "template.common.importTemplate",
bodySubKey: "exportBtn",
showBodySub: this.fillType === "preFill",
width: 280, width: 280,
},{
}, {
label: 'template.yp.yp003.ypsl', label: 'template.yp.yp003.ypsl',
prop: 'ypsl', prop: 'ypsl',
bodyType: 'input', bodyType: 'input',
@ -212,19 +206,19 @@ export default {
}, },
methods: { methods: {
// //
handleClickButton(key,rowIndex,colIndex,e,data){
if(key === "exportBtn"){
handleClickButton(key, rowIndex, colIndex, e, data) {
if (key === "exportBtn") {
this.currentRowIndex = rowIndex; this.currentRowIndex = rowIndex;
this.$refs.ImportExcelDialog.show() this.$refs.ImportExcelDialog.show()
} }
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "fqyqRef","remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "fqyqRef", "remarkRef"])
}, },
// //
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "tableRef", "stepRef", "fqyqRef","remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "tableRef", "stepRef", "fqyqRef", "remarkRef"]);
return content; return content;
}, },
getResource() { getResource() {
@ -253,28 +247,27 @@ export default {
}, },
onLoadExcelData(excelData) { onLoadExcelData(excelData) {
const data = excelData.splice(1); const data = excelData.splice(1);
const tagData = data.map((item)=>{
const tagData = data.map((item) => {
return { return {
checked:undefined,
tagValue:item[0],
checked: undefined,
tagValue: item[0],
} }
}) })
this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex,{dwbh:tagData});
this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex, { dwbh: tagData });
this.$refs.tableRef.onErrorUpdate(this.currentRowIndex, 1, 'dwbh', false) this.$refs.tableRef.onErrorUpdate(this.currentRowIndex, 1, 'dwbh', false)
this.$refs.ImportExcelDialog.cancel() this.$refs.ImportExcelDialog.cancel()
setTimeout(() => { setTimeout(() => {
this.justUpdateFilledFormData(); this.justUpdateFilledFormData();
}, 100); }, 100);
}, },
downloadExcelTemplate(arr){
downloadExcelTemplate(arr) {
this.exportExcel(arr) this.exportExcel(arr)
}, },
onCheckboxTagChange(rowIndex,colIndex,data){
const num = data.filter((item)=>item.checked).length;
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, {'ypsl':num})
onCheckboxTagChange(rowIndex, colIndex, data) {
const num = data.filter((item) => item.checked).length;
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, { 'ypsl': num })
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss">
</style>
<style rel="stylesheet/scss" lang="scss"></style>

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

@ -114,7 +114,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

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

@ -119,7 +119,7 @@ export default {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther",
otherCode: "actOther",otherCodeCompareTo: "preOther",
multiple: true, multiple: true,
compareTo: "pre", compareTo: "pre",
options: this.getDictOptions('business_pztj') options: this.getDictOptions('business_pztj')

+ 2
- 1
src/views/business/comps/template/mixins/templateMixin.js View File

@ -655,7 +655,8 @@ export default {
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
let initNd = volume,unit = subTargetStartSolution; let initNd = volume,unit = subTargetStartSolution;
if (rowIndex > 0) {
//平行配置不会传dataSource;
if (rowIndex > 0 && dataSource.length > 0) {
initNd = dataSource[rowIndex - 1].targetSolutionConcentration; initNd = dataSource[rowIndex - 1].targetSolutionConcentration;
unit = targetSolutionConcentrationUnit; unit = targetSolutionConcentrationUnit;
} }

Loading…
Cancel
Save