cuiqian2004
2025-06-05 a2f5317f01290597eb44aaf80aa535ff468a61c5
3202 set_subtable_page_content
7个文件已修改
336 ■■■■ 已修改文件
locale/en.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/es.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/zh-Hans.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/zh-Hant.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/language.vue 补丁 | 查看 | 原始文档 | blame | 历史
pages/modal/3200.vue 219 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/modal/3202.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/en.json
@@ -117,6 +117,7 @@
    "page.are_you_sure_clear_last": "Continuing the operation will clear them. Do you want to continue?",
    "page.tip_no_data_first": "There is no data in",
    "page.tip_no_data_last": "!",
    "page.are_you_sure_clear_data": "There is already data in the list. Continuing the operation will clear it. Do you want to continue?",
    "page.execute_event_success": "Successfully executed event",
    "page.are_you_sure_delete_sorted_data": "Are you sure to delete the sorted data?",
    "page.are_you_sure_delete_coded_disk_data": "Are you sure to delete the encoded disk data??",
locale/es.json
@@ -116,6 +116,7 @@
    "page.are_you_sure_clear_last": ". continuar la operación se vaciará, ¿ continuar?",
    "page.tip_no_data_first": "¡¡ no hay datos en",
    "page.tip_no_data_last": "!",
    "page.are_you_sure_clear_data": "¿Ya hay datos en la lista, continuar la operación se vaciará, ¿ continuar?",
    "page.execute_event_success": "El evento de ejecución fue exitoso",
    "page.are_you_sure_delete_sorted_data": "¿¿ estás seguro de eliminar los datos clasificados?",
    "page.are_you_sure_delete_coded_disk_data": "¿¿ estás seguro de eliminar los datos del disco codificado?",
locale/zh-Hans.json
@@ -119,6 +119,9 @@
    "page.are_you_sure_clear_last": "中的货品,继续操作会清空,是否继续",
    "page.tip_no_data_first": "",
    "page.tip_no_data_last": "没有数据!",
    "page.are_you_sure_clear_data": "列表中已有数据,继续操作会清空,是否继续?",
    "page.execute_event_success": "执行事件成功",
    "page.are_you_sure_delete_sorted_data": "确定删除该已分拣数据?",
locale/zh-Hant.json
@@ -114,8 +114,11 @@
    "page.tip_no_master_class": "未設定主數據類",
    "page.are_you_sure_clear_first": "系統檢測到有",
    "page.are_you_sure_clear_last": "中的貨品,繼續操作會清空,是否繼續?",
    "page.tip_no_data_first": "",
    "page.tip_no_data_last": "中沒有數據!",
    "page.are_you_sure_clear_data": "清單中已有數據,繼續操作會清空,是否繼續?",
    "page.execute_event_success": "執行事件成功!",
    "page.are_you_sure_delete_sorted_data": "確定删除該已分揀數據?",
    "page.are_you_sure_delete_coded_disk_data": "確定删除該已碼盤數據?",
pages/login/language.vue
pages/modal/3200.vue
@@ -1382,38 +1382,43 @@
                                        'close')
                                });
                                if (result.result_type == 0 && result
                                    .action) {
                                    result.action.forEach(item => {
                                        if (item.action_type ==
                                            "set_dlg_attr") {
                                if (result.result_type == 0 && result.action) {
                                    var actionlist = result.action;
                                    for (var j = 0; j < actionlist.length; j++) {
                                        var action = actionlist[j];
                                        var action_type = action.action_type;
                                        var value = action.value;
                                        if (action_type == "set_dlg_attr") {
                                            if (value) {
                                                this.setFormValues(value)
                                            }
                                        } else if (action_type == "set_subtable_page_content") {
                                            if (value.clear_confirm != false && value.clear == true &&
                                                $this.detail1StyleDefList.length > 0
                                            ) { //判断是否清空页签内容,正在码盘是否有数据
                                                uni.showModal({
                                                    title: this.translateSys('tip'),
                                                    content: this.translate("are_you_sure_clear_data"),
                                                    cancelText: $this.translateSys('ok'),
                                                    confirmText: $this.translateSys('cancel'),
                                                    success: function(res) {
                                                        if (res.cancel) {
                                                            $this.detail1StyleDefList = [];
                                                            $this.viewAceionContent(value);
                                                        } else if (res.confirm) {
                                                            $this.detail1StyleDefList = [];
                                                            $this.viewAceionContent(value);
                                                        }
                                                    }
                                                });
                                            } else {
                                                $this.detail1StyleDefList = [];
                                                $this.viewAceionContent(value);
                                            }
                                        }
                                    }
                                            // value = {"attr":"xxx", "value":"xxx"}
                                            var data = item.value;
                                            $this.$data
                                                .head_styledef.form
                                                .items
                                                .forEach(
                                                    async (
                                                        ele,
                                                        index
                                                    ) => {
                                                        data.forEach(
                                                            async (ele2,
                                                                index
                                                            ) => {
                                                                if (ele
                                                                    .fieldId ==
                                                                    ele2
                                                                    .attr
                                                                ) {
                                                                    ele.value =
                                                                        ele2
                                                                        .value;
                                                                }
                                                            });
                                                    });
                                        }
                                    });
                                } else {
                                    if (result.info) {
                                        uni.showModal({
@@ -1459,6 +1464,158 @@
                }
            },
            setFormValues(attrs) {
                const head_styledef = this.head_styledef
                if (JSON.stringify(attrs) == '{}') {
                    return;
                }
                attrs.forEach(async (attr, key) => {
                    if (attr.choice_list) {
                        var dictItemList = [];
                        attr.choice_list.forEach(async (val, index) => {
                            dictItemList.push({
                                text: val,
                                value: val
                            });
                        });
                        head_styledef.form.items.forEach(async (attr_item, index) => {
                            if (attr_item.name != "Layout") {
                                if (attr_item.fieldId == attr.attr) {
                                    if (attr_item.useDict) {
                                        attr_item.dict = dictItemList;
                                    } else {
                                        attr_item.selections = dictItemList;
                                    }
                                }
                            } else if (attr_item.name == "Layout") {
                                attr_item.setting.colList.forEach((col) => {
                                    if (col) {
                                        if (col.fieldId == attr.attr) {
                                            if (col.useDict) {
                                                col.dict = dictItemList;
                                            } else {
                                                col.selections = dictItemList;
                                            }
                                        }
                                    }
                                });
                            }
                        });
                    }
                    if (!head_styledef.form.model[attr.attr]) {
                        head_styledef.form.model[attr.attr] = attr.value;
                    }
                    head_styledef.form.items.forEach(async (ele) => {
                        if (ele.name != "Layout") {
                            if (ele.fieldId == attr.attr) {
                                ele.value = attr.value;
                                ele.oldvalue = attr.value;
                                if (ele.name == "Input") {
                                    if (attr.prompt) ele.placeholder = attr.prompt;
                                }
                                if (attr.enable !== undefined) {
                                    if (attr.enable) ele.disabled = false;
                                    else ele.disabled = true;
                                }
                            }
                        } else if (ele.name == "Layout") {
                            ele.setting.colList.forEach((col) => {
                                if (col) {
                                    if (col.fieldId == attr.attr) {
                                        col.value = attr.value;
                                        col.oldvalue = attr.value;
                                        if (col.name == "Input") {
                                            if (attr.prompt) col.placeholder = attr.prompt;
                                        }
                                        if (attr.enable !== undefined) {
                                            if (attr.enable) col.disabled = false;
                                            else col.disabled = true;
                                        }
                                    }
                                }
                            });
                        }
                    })
                    //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据
                })
                console.log(head_styledef)
                this.setData({
                    head_styledef: head_styledef
                })
            },
            //加载已码盘内容
            viewAceionContent(data) {
                var $this = this;
                if (JSON.stringify(data.content) == '{}') {
                    return;
                }
                var styleStr = JSON.stringify($this.detail1_styledef);
                var detailStyle = JSON.parse(styleStr);
                if (detailStyle.form) {
                    data.content.forEach(cont => {
                        detailStyle = JSON.parse(styleStr);
                        detailStyle.SelBut_Checked = data.checkbox ?? true;
                        detailStyle.form.objId = cont.id;
                        detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g,
                                '')
                            .replace('{', '').replace('}',
                                '') : 'null';
                        detailStyle.form.attrs = cont.attrs;
                        cont.attrs.forEach(attr => {
                            detailStyle.form.items.forEach(ele => {
                                if (ele.name != 'Layout') {
                                    if (ele.fieldId == attr.attr)
                                        ele.value = attr.value;
                                } else if (ele.name == 'Layout') {
                                    ele.setting.colList.forEach(
                                        col => {
                                            if (col) {
                                                if (col.fieldId ==
                                                    attr.attr)
                                                    col.value = attr.value;
                                            }
                                        });
                                }
                            });
                        });
                        //如果 clear = false 则不需要清除,根据id判断是否存在,不存在插入到页面,如果存在用新的属性覆盖
                        if (data.clear == false) {
                            var isflag = true;
                            $this.detail1StyleDefList.forEach((style, index) => {
                                if (style.form.objId == detailStyle.form.objId) {
                                    cont.attrs.forEach(attr => {
                                        style.form.items.forEach(ele => {
                                            if (ele.name != 'Layout') {
                                                if (ele.fieldId == attr.attr)
                                                    ele.value = attr.value;
                                            } else if (ele.name == 'Layout') {
                                                ele.setting.colList.forEach(
                                                    col => {
                                                        if (col) {
                                                            if (col.fieldId ==
                                                                attr
                                                                .attr)
                                                                col.value =
                                                                attr.value;
                                                        }
                                                    });
                                            }
                                        });
                                    });
                                    isflag = false;
                                }
                            });
                            if (isflag) $this.detail1StyleDefList.push(detailStyle); //待分拣
                        } else {
                            $this.detail1StyleDefList.push(detailStyle); //待分拣
                        }
                    });
                }
            },
            onDetail1EnterChange() {},
            //点中表单
            onPanelClick(value) { //点击面板高亮显示
pages/modal/3202.vue
@@ -741,19 +741,43 @@
                                });
                                if (result.result_type == 0 && result.action) {
                                    result.action.forEach(item => {
                                        if (item.action_type ==
                                            "set_query_condition") {
                                            var value = item.value;
                                    for (var j = 0; j < actionlist.length; j++) {
                                        var action = actionlist[j];
                                        var action_type = action.action_type;
                                        var value = action.value;
                                        if (action_type == "set_query_condition") {
                                            $this.wheres = value.condition;
                                            $this.orderby = value.order ? value.order :
                                                ""
                                            $this.orderby = value.order ? value.order : ""
                                            $this.pageindex = 1;
                                            $this.query_id = "";
                                            $this.detail1StyleDefList = [];
                                            $this.loadDataGetList();
                                        } else if (action_type == "set_subtable_page_content") {
                                            if (value.clear_confirm != false && value.clear == true &&
                                                $this.detail1StyleDefList.length > 0
                                            ) { //判断是否清空页签内容,正在码盘是否有数据
                                                uni.showModal({
                                                    title: this.translateSys('tip'),
                                                    content: this.translate("are_you_sure_clear_data"),
                                                    cancelText: $this.translateSys('ok'),
                                                    confirmText: $this.translateSys('cancel'),
                                                    success: function(res) {
                                                        if (res.cancel) {
                                                            $this.detail1StyleDefList = [];
                                                            $this.viewAceionContent(value);
                                                        } else if (res.confirm) {
                                                            $this.detail1StyleDefList = [];
                                                            $this.viewAceionContent(value);
                                        }
                                    })
                                                    }
                                                });
                                            } else {
                                                $this.detail1StyleDefList = [];
                                                $this.viewAceionContent(value);
                                            }
                                        }
                                    }
                                } else {
                                    if (result.info) {
                                        uni.showModal({
@@ -889,6 +913,77 @@
                    head_styledef: head_styledef
                })
            },
            //加载已码盘内容
            viewAceionContent(data) {
                var $this = this;
                if (JSON.stringify(data.content) == '{}') {
                    return;
                }
                var styleStr = JSON.stringify($this.detail1_styledef);
                var detailStyle = JSON.parse(styleStr);
                if (detailStyle.form) {
                    data.content.forEach(cont => {
                        detailStyle = JSON.parse(styleStr);
                        detailStyle.SelBut_Checked = data.checkbox ?? true;
                        detailStyle.form.objId = cont.id;
                        detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g,
                                '')
                            .replace('{', '').replace('}',
                                '') : 'null';
                        detailStyle.form.attrs = cont.attrs;
                        cont.attrs.forEach(attr => {
                            detailStyle.form.items.forEach(ele => {
                                if (ele.name != 'Layout') {
                                    if (ele.fieldId == attr.attr)
                                        ele.value = attr.value;
                                } else if (ele.name == 'Layout') {
                                    ele.setting.colList.forEach(
                                        col => {
                                            if (col) {
                                                if (col.fieldId ==
                                                    attr.attr)
                                                    col.value = attr.value;
                                            }
                                        });
                                }
                            });
                        });
                        //如果 clear = false 则不需要清除,根据id判断是否存在,不存在插入到页面,如果存在用新的属性覆盖
                        if (data.clear == false) {
                            var isflag = true;
                            $this.detail1StyleDefList.forEach((style, index) => {
                                if (style.form.objId == detailStyle.form.objId) {
                                    cont.attrs.forEach(attr => {
                                        style.form.items.forEach(ele => {
                                            if (ele.name != 'Layout') {
                                                if (ele.fieldId == attr.attr)
                                                    ele.value = attr.value;
                                            } else if (ele.name == 'Layout') {
                                                ele.setting.colList.forEach(
                                                    col => {
                                                        if (col) {
                                                            if (col.fieldId ==
                                                                attr
                                                                .attr)
                                                                col.value =
                                                                attr.value;
                                                        }
                                                    });
                                            }
                                        });
                                    });
                                    isflag = false;
                                }
                            });
                            if (isflag) $this.detail1StyleDefList.push(detailStyle); //待分拣
                        } else {
                            $this.detail1StyleDefList.push(detailStyle); //待分拣
                        }
                    });
                }
            },
            //点中表单
            onPanelClick(value) { //点击面板高亮显示
                // console.log(value);