Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
35ce362961
16 changed files with 71 additions and 158 deletions
  1. +7
    -12
      src/views/business/comps/template/comps/sp/SP001.vue
  2. +9
    -16
      src/views/business/comps/template/comps/sp/SP002.vue
  3. +7
    -12
      src/views/business/comps/template/comps/sp/SP003.vue
  4. +6
    -8
      src/views/business/comps/template/comps/sp/SP00456.vue
  5. +4
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP008.vue
  6. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP009.vue
  7. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP010.vue
  8. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP011.vue
  9. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP012.vue
  10. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP013.vue
  11. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP014.vue
  12. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP015.vue
  13. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP016.vue
  14. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP017.vue
  15. +3
    -10
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP018.vue
  16. +8
    -0
      src/views/business/comps/template/mixins/templateMixin.js

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

@ -41,6 +41,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSn } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
export default {
name: "SP001",
@ -248,17 +249,11 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if (!v.targetCodeSn && this.fillType === "actFill") {
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if(!formData.targetCodeSn&& this.fillType === "actFill"){
this.getCode(formData);
}
},
methods: {
//
@ -271,7 +266,7 @@ export default {
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
async getCode(v) {
getCode: debounce(async function (v) {
const result = await getLatestSn({
count: 1,
pre:v.targetCode,
@ -280,7 +275,7 @@ export default {
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
}
},
}, 100),
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"])

+ 9
- 16
src/views/business/comps/template/comps/sp/SP002.vue View File

@ -248,16 +248,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if (!v.targetCodeSn && this.fillType === "actFill") {
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (!formData.targetCodeSn && this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
@ -270,15 +263,15 @@ export default {
EventBus.$emit('showTagPrintDialog', { printConfig })
},
getStepResource(){
getStepResource() {
return this.$refs.stepRef.getStepResource()
},
//
async getCode(v) {
const result = await getLatestSn({
count: 1,
pre:v.targetCode,
type:1
pre: v.targetCode,
type: 1
})
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
@ -301,7 +294,7 @@ export default {
ph: '',
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
ly: 'ELN配制',
sxrq: content.expireDate,
kc: content.targetActVolume,
@ -316,8 +309,8 @@ export default {
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return content;
}
}

+ 7
- 12
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -63,16 +63,7 @@ export default {
default: 'preFill',
},
},
watch: {
fillType: {
immediate: true,
handler(v) {
if (v && this.fillType === "actFill") {
this.handleUpdateCode();
}
}
},
},
computed: {
//
storageFormConfig() {
@ -423,6 +414,10 @@ export default {
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.handleUpdateCode(formData);
}
},
methods: {
//
@ -488,8 +483,8 @@ export default {
}
},
//
async handleUpdateCode() {
const { stepTableFormData = [] } = this.formData;
async handleUpdateCode(v) {
const { stepTableFormData = [] } = v;
if (stepTableFormData.length === 0) {
return;
}

+ 6
- 8
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -133,14 +133,6 @@ export default {
console.log(v, "fillType")
}
},
formData: {
immediate: true,
handler(v) {
if (v && this.fillType === "actFill") {
this.handleUpdateCode();
}
}
}
},
computed: {
//
@ -184,6 +176,12 @@ export default {
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
setTimeout(() => {
this.handleUpdateCode(formData);
}, 0);
}
},
methods: {
onSureModifyRecord(type, index, e) {

+ 4
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP008.vue View File

@ -244,18 +244,12 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if(this.fillType === "actFill"){
this.getCode(formData);
}
},
methods: {
//
handleJzClickable(obj){

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP009.vue View File

@ -283,16 +283,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if (this.fillType === "actFill") {
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP010.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP011.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP012.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP013.vue View File

@ -242,16 +242,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP014.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP015.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP016.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP017.vue View File

@ -244,16 +244,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 3
- 10
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP018.vue View File

@ -242,16 +242,9 @@ export default {
};
},
mounted() {
},
watch: {
formData: {
immediate: true,
handler(v) {
if(this.fillType === "actFill"){
this.getCode(v);
}
}
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {

+ 8
- 0
src/views/business/comps/template/mixins/templateMixin.js View File

@ -159,6 +159,14 @@ export default {
this.setTemplateData({})
},
methods: {
getFormDataByTemplateData(){
let o = {};
const { bdnr } = this.templateData
if(bdnr){
o = JSON.parse(bdnr)
}
return o;
},
//开始配置
//postData: {bh: '123456'}
async startConfigRequest(postData) {

Loading…
Cancel
Save