Browse Source

feat:[模板管理][update]

luojie
luojie 1 week ago
parent
commit
dd3ce637ae
3 changed files with 24 additions and 8 deletions
  1. +17
    -7
      src/components/Template/StepComponents/ZLSubPackage.vue
  2. +5
    -1
      src/components/Template/StepComponents/ry/bdzl.vue
  3. +2
    -0
      src/components/Template/mixins/stepMixins.js

+ 17
- 7
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -22,7 +22,7 @@
<div class="header-item"> <div class="header-item">
<div class="header-title">预设每份容量</div> <div class="header-title">预设每份容量</div>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey="prefixKey + stepIndex + formData.mybh + '_mfbzl'" type="inputNumber"
<HandleFormItem :fieldKey="prefixKey + stepIndex + '_mfbzl'" type="inputNumber"
:error="formErrors.mfbzl" :isFieldsRecord="false" :item="preInputNumberItem" :error="formErrors.mfbzl" :isFieldsRecord="false" :item="preInputNumberItem"
v-model="formData.mfbzl" /> v-model="formData.mfbzl" />
</div> </div>
@ -34,7 +34,7 @@
<div class="header-item"> <div class="header-item">
<div class="header-title">电子天平</div> <div class="header-title">电子天平</div>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey="prefixKey + stepIndex + formData.dztp + '_dztp'" type="yq"
<HandleFormItem :fieldKey="prefixKey + stepIndex + '_dztp'" type="yq"
@onRegentSubmit="(data) => onRegentSubmit(data, 'dztp')" :error="formErrors.dztp" @onRegentSubmit="(data) => onRegentSubmit(data, 'dztp')" :error="formErrors.dztp"
:item="yqItem" v-model="formData.dztp" /> :item="yqItem" v-model="formData.dztp" />
</div> </div>
@ -56,9 +56,14 @@
<HandleFormItem fieldItemLabel="质量分装" <HandleFormItem fieldItemLabel="质量分装"
:fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_actnum'" class="ml-5" :fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_actnum'" class="ml-5"
:item="inputNumberItem" :error="hasError(index, 'actnum')" type="inputNumber" :item="inputNumberItem" :error="hasError(index, 'actnum')" type="inputNumber"
:ref = "prefixKey + stepIndex + '_actnum'+index"
@blur="onBlurFzNum(index, 'actnum')" v-model="item.actnum" /> @blur="onBlurFzNum(index, 'actnum')" v-model="item.actnum" />
<el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain
@click="onGetValue(item)">获取值</el-button>
<HandleFormItem
:fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_hqz'" class="ml-5"
:item="getButtonItem()" @clickButton="(e,v,d) => onGetValue(d, item,index)" type="button" v-model="item.hqz" />
<!-- <el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain
@click="onGetValue(item)">获取值</el-button> -->
<el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain <el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain
@click="onPrint(item)">打印</el-button> @click="onPrint(item)">打印</el-button>
</div> </div>
@ -119,7 +124,8 @@ export default {
inputNumberItem: { inputNumberItem: {
type: "inputNumber", type: "inputNumber",
fillType: "actFill", fillType: "actFill",
label: "实际称量"
label: "实际称量",
disabled: true,
}, },
preInputNumberItem: { preInputNumberItem: {
type: "inputNumber", type: "inputNumber",
@ -391,17 +397,21 @@ export default {
this.formData[field] = selectedId; this.formData[field] = selectedId;
this.formData.dztpInfo = data.row; this.formData.dztpInfo = data.row;
}, },
async onGetValue(item) {
async onGetValue(signData, item, index) {
const { dztp,dztpInfo,dw } = this.formData; const { dztp,dztpInfo,dw } = this.formData;
if (isValueEmpty(dztp)) { if (isValueEmpty(dztp)) {
this.$message.error("请选择电子天平"); this.$message.error("请选择电子天平");
return; return;
} }
const oldItem = JSON.parse(JSON.stringify(item));
const result = await getBalance({yq:dztpInfo,dw}); const result = await getBalance({yq:dztpInfo,dw});
if(result.success){ if(result.success){
item.actnum = result.value; item.actnum = result.value;
this.fzList = [...this.fzList]; this.fzList = [...this.fzList];
justUpdateFilledFormData()
this.$refs[this.prefixKey + this.stepIndex + '_actnum'+index][0].handleUpdateRecord(signData,{
oldValue: oldItem.actnum,
inputValue: result.value
})
}else{ }else{
this.$message.error(result.message || "获取值失败"); this.$message.error(result.message || "获取值失败");
} }

+ 5
- 1
src/components/Template/StepComponents/ry/bdzl.vue View File

@ -1,6 +1,6 @@
<!-- 标定(质量) --> <!-- 标定(质量) -->
<template> <template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_bdzl'" @resetRecord = "resetRecord" :form-config="formConfig" :formData = "formData" />
<StepFormPackage @clickButton="onHandleClickButton" :fieldItemLabel = "fieldItemLabel" ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_bdzl'" @resetRecord = "resetRecord" :form-config="formConfig" :formData = "formData" />
</template> </template>
<script> <script>
@ -52,6 +52,10 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
}, },
button1:{ button1:{
type:"button", type:"button",
dataSource:"tp",//
yqCode:"yq",//
fillField:"sjbdtj",//
dwField:"bdtjdw",//
buttonName:"获取值", buttonName:"获取值",
}, },
text5:{ text5:{

+ 2
- 0
src/components/Template/mixins/stepMixins.js View File

@ -201,6 +201,8 @@ export default {
maxVolumeUnit, maxVolumeUnit,
uuid: this.uuid, uuid: this.uuid,
}) })
}else if(buttonName === '获取值'){
console.log(e,"iii")
} }
}, },

Loading…
Cancel
Save