xiejun
2023-08-23 fffb0389bbc255a6a7fe4282471f86fd95bee49d
Merge remote-tracking branch 'origin/master'
已修改3个文件
已添加2个文件
272 ■■■■■ 文件已修改
Source/UBCS-WEB/src/api/code/maxSerialNum.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/code.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/code/maxSerialNum.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
import request from '@/router/axios';
export const getCodePrice = (data) => {
  return request({
    url: '/api/ubcs-code/ubcs-code/mdmRule/getCodeRuleAndBasicSecByRuleOid',
    method: 'get',
    params: data
  })
}
Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,231 @@
<template>
    <el-dialog title="最大流水号" width="30%" append-to-body="true" :visible.sync="visible">
        <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
            <el-tab-pane label="最大流水号" name="codeApply">
                <form-template v-bind="$attrs" type="add" :selfColumnType="selfColumnType" :selfColumnConfig="selfColumnConfig"
                    ref="CodeApply" @getFormData="getCodeApplyFormData"
                    @referConfigDataUpdate="referConfigDataUpdate"></form-template>
            </el-tab-pane>
        </el-tabs>
    </el-dialog>
</template>
<script>
import FormTemplate from "@/components/FormTemplate/FormTemplate";
import { getCodePrice } from "@/api/code/maxSerialNum.js"
export default {
    name: 'maxSerialnumDialog',
    components: {
        FormTemplate
    },
    props: {
        // æ˜¯å¦æ‰“å¼€
        visible: {
            typeof: Boolean,
            default: false
        },
        // ruleOid
        ruleOid: {
            typeof: String,
            default: ""
        }
    },
    watch: {
        visible(n) {
            this.dialogVisible = n;
        },
        dialogVisible(n) {
            this.$emit('update:visible', n)
            if (n) this.apiGetCode()
        },
        selfColumnConfig: {
            handler(newval) {
                console.log('selfColumnConfig', newval)
            },
            immediate: true,
            deep: true
        }
    },
    data() {
        return {
            dialogVisible: this.visible,
            activeName: 'codePrice',
            codeApplyForm: {},
            secVOList: [],
            selfColumnType: {
                codefixedsec: "combox",
                codeclassifysec: "refer",
                codevariablesec: "text",
                coderefersec: "refer",
            },
            selfColumnConfig: {
                function: {
                    required: this.isRequired,
                    dicData: this.getOptionList,
                    type: this.getType,
                    referConfig: this.getReferConfig,
                    readOnly: this.getDisabled,
                },
                exchange: {
                    text: "name",
                    field: "oid",
                    prop: "oid",
                    showField: "name",
                    parentClassifySecOid: "parentClassifySecOid",
                    label: "name",
                    maxlength: "codeSecLength",
                    data: "fixedValueVOList",
                },
                directVoluation: {
                    search: true,
                    props: {
                        label: "id",
                        value: "id",
                    },
                },
            },
        }
    },
    methods: {
        async apiGetCode() {
            const response = await getCodePrice({ ruleOid: this.ruleOid })
            const res = response.data
            if (res.success && res.code === 200) {
                console.log(response)
                const typeList = [
                    "codefixedsec",
                    "codeclassifysec",
                    "codevariablesec",
                    "coderefersec",
                ];
                this.secVOList = (res.data.secVOList || []).filter((item) =>
                    typeList.includes(item.secType)
                );
                console.log(this.secVOList)
                if (this.secVOList.length > 0) {
                    // this.showCodeApply = true;
                    this.activeName = "codePrice";
                    this.$nextTick(() => {
                        this.$refs.CodeApply.templateRender(this.secVOList);
                    });
                } else {
                    // this.showCodeApply = false;
                }
            }
        },
        handleClick(tab, event) {
            console.log(event)
        },
        getCodeApplyFormData(codeApplyForm) {
            this.codeApplyForm = codeApplyForm;
        },
        // å‚照组件数据变更
        referConfigDataUpdate(data) {
            console.log(data)
            const { field } = data;
            this.secVOList = this.secVOList.map((item) => {
                if (item.parentClassifySecOid === field) {
                    this.$refs.CodeApply.form[item.oid] = undefined;
                    this.$refs.CodeApply.form[item.name] = undefined;
                }
                return item;
            });
            console.log(this.secVOList)
            this.$refs.CodeApply.templateRender(this.secVOList);
        },
        isRequired(item) {
            return item.nullableFlag != "true";
        },
        getType(item) {
            return this.selfColumnType[item.secType];
        },
        getDisabled(item) {
            if (item.secType === "codeclassifysec") {
                if (item.parentClassifySecOid) {
                    if (!this.codeApplyForm[item.parentClassifySecOid]) {
                        return true;
                    } else {
                        return false;
                    }
                }
            }
        },
        getReferConfig(item) {
            console.log(item)
            let params = {};
            if (item.secType == "codeclassifysec") {
                params = {
                    isMuti: false,
                    type: "grid",
                    tableConfig: {
                        limit: -1,
                        cols: [
                            {
                                field: "id",
                                title: "英文名称",
                                sort: true,
                                width: 150,
                            },
                            {
                                field: "name",
                                title: "中文名称",
                                sort: true,
                                width: 150,
                            },
                            {
                                field: "description",
                                title: "描述",
                                width: 250,
                            },
                        ],
                        queryColumns: [
                            {
                                field: "id",
                                title: "英文名称",
                            },
                            {
                                field: "name",
                                title: "中文名称",
                            },
                        ],
                    },
                    url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid",
                    extraParams: {
                        classifySecOid: item.oid,
                        parentClassifyValueOid: item.parentClassifySecOid
                            ? this.codeApplyForm[item.parentClassifySecOid]
                            : "",
                    },
                };
            } else if (item.secType == "coderefersec") {
                params = JSON.parse(item.referValueInfo);
            }
            console.log(params)
            return params;
        },
        getOptionList(item) {
            if (
                Array.isArray(item.fixedValueVOList) &&
                item.fixedValueVOList.length > 0
            ) {
                const configAttr = {
                    key: "id",
                    value: "id",
                };
                const optionList = item.fixedValueVOList.map((item) => {
                    for (const key in configAttr) {
                        if (Object.hasOwnProperty.call(configAttr, key)) {
                            const element = configAttr[key];
                            item[key] = item[element];
                        }
                    }
                    return item;
                });
                return optionList;
            } else {
                return [];
            }
        },
    }
}
</script>
Source/UBCS-WEB/src/main.js
@@ -53,6 +53,7 @@
import businesswork from "@/components/work/BusinessWork"
import MasterTransfer from "@/components/Master/MasterTransfer";
import ThemeImport from "@/components/Theme/ThemeImport";
import maxSerialnumDialog from '@/components/code-dialog-page/maxSerialnumDialog'
// å°†å·¥å…·å‡½æ•°æ·»åŠ åˆ°å…¨å±€
import utilFunc from './util/func'
Vue.prototype.$utilFunc = utilFunc
@@ -106,6 +107,7 @@
Vue.component('businesswork', businesswork)
Vue.component('MasterTransfer', MasterTransfer)
Vue.component('ThemeImport', ThemeImport)
Vue.component('maxSerialnumDialog', maxSerialnumDialog)
// åŠ è½½ç›¸å…³url地址
Object.keys(urls).forEach(key => {
Source/UBCS-WEB/src/views/code/code.vue
@@ -106,6 +106,13 @@
                @click="escapeOwner">
                è½¬ç§»æ‰€æœ‰è€…
            </el-button>
            <el-button
                size="small"
                icon="el-icon-guide"
                plain
                @click="maxSerialNum">
                æœ€å¤§æµæ°´å·
            </el-button>
          </template>
        </avue-crud>
      </basic-container>
@@ -248,6 +255,9 @@
            <el-button type="primary" @click="escapeOwnerConfirm">ç¡® å®š</el-button>
          </span>
      </el-dialog>
      <!-- æœ€å¤§æµæ°´å·å¯¹è¯æ¡† -->
      <max-serialnum-dialog :visible.sync="maxSerial.visible" :ruleOid="maxSerial.ruleOid"></max-serialnum-dialog>
      <!-- åŸºç¡€ç æ®µå±•示区域 -->
      <basic-container class="code-basicsec-container">
@@ -875,6 +885,12 @@
          ruleOwner: '', // å½“前要转移给哪个规则管理员的ID
          releadDisabled: false, // é¿å…è§„则发布重复提交
          /*最大流水号*/
          maxSerial:{
            visible:false,
          },
          /*使用范围对话框显示控制*/
          codeRangeSettingBox: false,
          useRangeData: [],
@@ -2787,6 +2803,16 @@
          let enumList = this.getLocalStorageEnum("codeGetValueType");
          this.enumParam.codeGetValueType =  enumList.length>0 ? enumList:[];
        },
        // æœ€å¤§æµæ°´å·
        maxSerialNum(){
          console.log(this.selectionList)
          if (this.selectionList.length === 0) {
            this.$message.warning("请选择一条编码规则!");
            return;
          }
          this.maxSerial.visible = true
          this.maxSerial.ruleOid = this.selectionList[0]['oid']
        }
      }
  };
Source/UBCS-WEB/vue.config.js
@@ -28,8 +28,8 @@
        //本地服务接口地址
        // target: 'http://127.0.0.1',
        // target: 'http://192.168.1.51:37000',
        target: 'http://dev.vci-tech.com:37000',
        // target: 'http://192.168.1.104:37000',
        // target: 'http://dev.vci-tech.com:37000',
        target: 'http://192.168.1.16:37000',
        // target: 'http://192.168.0.105:37000',
        // target: 'http://192.168.0.103:37000',
        // target: 'http://192.168.1.63:37000',