소스 검색

udpate 混料批次编辑

docs_0727
lb 1 년 전
부모
커밋
a94d5c2715
6개의 변경된 파일30개의 추가작업 그리고 26개의 파일을 삭제
  1. +13
    -10
      src/components/DialogJustForm.vue
  2. +8
    -8
      src/components/noTemplateComponents/operationComponent.js
  3. +2
    -1
      src/views/atomViews/ListViewWithHead.vue
  4. +2
    -2
      src/views/modules/pms/blenderBatch/config.js
  5. +4
    -4
      src/views/modules/pms/blenderBatch/index.vue
  6. +1
    -1
      src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue

+ 13
- 10
src/components/DialogJustForm.vue 파일 보기

@@ -121,6 +121,10 @@ export default {
type: Boolean,
default: false,
},
// extraParams: {
// type: Object,
// default: () => ({})
// }
},
inject: ["urls"],
data() {
@@ -248,7 +252,7 @@ export default {
},

/** init **/
init(id, detailMode, extraParams) {
init(id, detailMode, tagInfo, extraParams) {
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation...");
@@ -258,6 +262,14 @@ export default {

this.detailMode = detailMode ?? false;

/** 判断 extraParams */
if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) {
// console.log("[dialog] dataForm | key | value", this.dataForm, key, value);
this.$set(this.dataForm, key, value);
}
}

this.$nextTick(() => {
this.dataForm.id = id || null;
if (this.dataForm.id) {
@@ -298,15 +310,6 @@ export default {
});
});
} else {
// 如果不是编辑,看看是否有其他 extraParams

if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) {
this.$set(this.dataForm, key, value);
console.log('[DialogJustForm] setting: ', key, value)
}
}

this.loadingStatus = false;
}
});


+ 8
- 8
src/components/noTemplateComponents/operationComponent.js 파일 보기

@@ -59,23 +59,23 @@ export default {
let emitFull = false;
let eventType = "default";
let customField;
let payload = {};
if (typeof opt === "object") {
eventType = opt.name;
customField = opt.emitField || "id";
emitFull = opt.emitFull || false;
if ("url" in opt) {
payload.url = this.injectData.url;
}
if ("toRouter" in opt) {
payload.toRouter = opt.toRouter;
}
} else {
eventType = opt;
}

/** 处理 toRouter */
let payload = { type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id };
if ("url" in opt) {
payload.url = this.injectData.url;
}
if ("toRouter" in opt) {
payload.toRouter = opt.toRouter;
}
// this.$emit('emit-data', { type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id, url: this.injectData.url, toRouter: opt.toRouter })
payload = { ...payload, type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id };
this.$emit("emit-data", payload);
},
},


+ 2
- 1
src/views/atomViews/ListViewWithHead.vue 파일 보기

@@ -451,10 +451,11 @@ export default {
if (this.attachListQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.forEach((item) => {
let found = item[this.attachListQueryExtra];
if (found !== null && found !== undefined) extraParams = found;
if (found !== null && found !== undefined) extraParams = item;
});
}
this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`)
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
});
},


+ 2
- 2
src/views/modules/pms/blenderBatch/config.js 파일 보기

@@ -29,9 +29,9 @@ export default function () {
prop: "operations",
name: "操作",
fixed: "right",
width: 160,
width: 120,
subcomponent: TableOperaionComponent,
options: ['add', { name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual'} }] // 只有 injectRow.task 为手动时,才允许编辑
options: [{ name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } }] // 只有 injectRow.task 为手动时,才允许编辑
},
];



+ 4
- 4
src/views/modules/pms/blenderBatch/index.vue 파일 보기

@@ -24,7 +24,7 @@ export default {
computed: {
// 混料订单id
id() {
return this.$route.params.id || "";
return this.$route.query.id || "";
},
},
data() {
@@ -39,10 +39,10 @@ export default {
},
watch: {
$route: {
handler: function (val) {
if (val.params.id) {
handler: function (route) {
if (route.query.id) {
this.triggerUpdateKey = Math.random().toString()
console.log('[$oute changed] val.params.id', val.params.id, this.triggerUpdateKey)
console.log('[$oute changed] val.params.id', route.query.id, this.triggerUpdateKey)
}
},
immediate: true,


+ 1
- 1
src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue 파일 보기

@@ -212,7 +212,7 @@ export default {
case 'view-batch': {
this.$router.push({
name: toRouter,
params: {
query: {
id: data // 混料订单id
}
})


불러오는 중...
취소
저장