| | |
| | | }, |
| | | selectRow: { |
| | | handler(newval) { |
| | | console.log(newval); |
| | | // console.log(newval); |
| | | let ids = newval.map(item => item.id); |
| | | this.selectValue = ids.join(","); |
| | | }, |
| | |
| | | let slotColumnList = []; |
| | | formItemList.forEach((formItem) => { |
| | | formItem = this.resetFormConfig(formItem); |
| | | console.log(formItem) |
| | | // console.log(formItem) |
| | | //属性码段规则 |
| | | if (formItem.secType === "codeattrsec") { |
| | | this.attrList.push(formItem); |
| | |
| | | //系列号规则 |
| | | if (formItem.field === "codeStandardEditType") { |
| | | if (this.status === "amend") { |
| | | console.log("formItem-amend", formItem) |
| | | formItem.readOnly = true; |
| | | } |
| | | } |
| | |
| | | }, |
| | | //修改级联项 |
| | | changeChildItem(items, TreeValue, type) { |
| | | type = type || "add" |
| | | type = type || "add"; |
| | | let column = this.option.column; |
| | | let group = this.option.group; |
| | | // let column = []; |
| | | // let group = []; |
| | | let that = this; |
| | | items.forEach((item) => { |
| | | let formItem = this.resetFormConfig(item); |
| | | if (formItem.field == "lcstatus") { |
| | | formItem.field = formItem.field + "_text"; |
| | | formItem.readOnly = true; |
| | | } |
| | | // 设置表单校验的规则,文本 |
| | | let message = "请选择"; |
| | | let trigger = "change"; |
| | | if (formItem.type === "text") { |
| | | message = "请输入"; |
| | | trigger = "blur"; |
| | | } |
| | | let fieldMapKey = '' |
| | | if (formItem.type == "refer" && !formItem.fieldMap) { |
| | | fieldMapKey = formItem.field + 'Id' |
| | | formItem.fieldMap = {} |
| | | formItem.fieldMap[fieldMapKey] = 'id' |
| | | formItem.fieldMap[formItem.field + 'id'] = 'id' |
| | | } |
| | | let columnItem = { |
| | | label: formItem.text, |
| | | labelslot: true, |
| | | prop: this.$utilFunc.isValuableObj(formItem.referConfig) |
| | | ? formItem.showField || formItem.field |
| | | : formItem.field, |
| | | field: formItem.field, |
| | | type: this.columnType[formItem.type], |
| | | dicData: this.getDataList(formItem.type, formItem.data), |
| | | disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false) || |
| | | (this.status ? (formItem.field === "reviseSeries" ? (formItem.value == 'false' ? true : false) : false) : false), |
| | | prepend: this.preOrSufFixShow("text", formItem.prefix), |
| | | append: this.preOrSufFixShow("text", formItem.suffix), |
| | | prefixIcon: this.preOrSufFixShow("icon", formItem.prefix), |
| | | suffixIcon: this.preOrSufFixShow("icon", formItem.suffix), |
| | | valueFormat: formItem.dateFormate || "yyyy-MM-dd HH:mm:ss", |
| | | format: formItem.dateFormate, |
| | | keyAttr: formItem.keyAttr, |
| | | value: formItem.defaultValue || (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || |
| | | (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) || |
| | | (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) || |
| | | (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null) || |
| | | //父组件如果是参照数据会将selectRow置空,selectRow不为空就说明不是参照要回填源标准号数据 |
| | | (this.status === "amend" ? (this.selectRow && (formItem.field === "oldcode" ? this.selectValue : null)) : null), |
| | | placeholder: formItem.inputTip, |
| | | comboxKey: formItem.comboxKey, |
| | | tip: formItem.tooltips, |
| | | display: !formItem.hidden, |
| | | maxlength: formItem.maxlength, |
| | | filterable: true, |
| | | referConfig: |
| | | formItem.type == "refer" |
| | | ? { |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | fieldMap: formItem.fieldMap || {}, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig |
| | | } |
| | | : {}, |
| | | span: formItem.span |
| | | ? formItem.span |
| | | : formItem.type === "textarea" |
| | | ? 24 |
| | | : this.localTrendsSpan, |
| | | rules: [ |
| | | { |
| | | required: formItem.required, |
| | | message: `${message}${formItem.text}`, |
| | | trigger, |
| | | }, |
| | | { |
| | | // 如果没有正则则匹配任何字符 |
| | | pattern: formItem.verify ? formItem.verify : /[\s\S.]*/g, |
| | | message: formItem.tooltips, |
| | | trigger, |
| | | }, |
| | | ], |
| | | props: { |
| | | label: "value", |
| | | value: "key", |
| | | }, |
| | | }; |
| | | if (group.length === 0) { |
| | | that.slotColumnList.forEach((colItem, index) => { |
| | | if (colItem.field == columnItem.field) { |
| | | that.slotColumnList[index] = columnItem; |
| | | column[index] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | } else { |
| | | that.slotColumnList.forEach((colItem, index) => { |
| | | if (colItem.field == columnItem.field) { |
| | | that.slotColumnList[index] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | group.forEach((groupItem, index) => { |
| | | groupItem.column.forEach((colItem, colIndex) => { |
| | | if (colItem.field == columnItem.field) { |
| | | group[index].column[colIndex] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }); |
| | | that.$set(that.option, "column", column); |
| | | that.$set(that.option, "group", group); |
| | | }, |
| | | //标准-修订 |
| | | changeStatusItem(items, TreeValue, type) { |
| | | type = type || "add"; |
| | | // let column = this.option.column; |
| | | // let group = this.option.group; |
| | | let column = []; |
| | |
| | | field: formItem.field, |
| | | type: this.columnType[formItem.type], |
| | | dicData: this.getDataList(formItem.type, formItem.data), |
| | | disabled: type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false), |
| | | disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false) || |
| | | (this.status === 'amend' ? (formItem.field === "reviseSeries" ? (formItem.value == 'false' ? true : false) : false) : false), |
| | | prepend: this.preOrSufFixShow("text", formItem.prefix), |
| | | append: this.preOrSufFixShow("text", formItem.suffix), |
| | | prefixIcon: this.preOrSufFixShow("icon", formItem.prefix), |
| | |
| | | valueFormat: formItem.dateFormate || "yyyy-MM-dd HH:mm:ss", |
| | | format: formItem.dateFormate, |
| | | keyAttr: formItem.keyAttr, |
| | | value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || |
| | | value: formItem.defaultValue || (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || |
| | | (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) || |
| | | (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) || |
| | | (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null), |
| | | (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null) || |
| | | //父组件如果是参照数据会将selectRow置空,selectRow不为空就说明不是参照要回填源标准号数据 |
| | | (this.status === "amend" ? (this.selectRow && (formItem.field === "oldcode" ? this.selectValue : null)) : null), |
| | | placeholder: formItem.inputTip, |
| | | comboxKey: formItem.comboxKey, |
| | | tip: formItem.tooltips, |
| | | // hidden:formItem.secType && formItem.codeValueApplyStatus == 3 ? true : false, |
| | | // readonly:formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ?true : false , |
| | | display: !formItem.hidden, |
| | | maxlength: formItem.maxlength, |
| | | filterable: true, |
| | |
| | | openDialog() { |
| | | //新增和修改共同调用(有改动 不需要在使用edit,方法没什么影响) |
| | | this.getFormTemplate(); |
| | | if (this.type === "add" || (this.type !== "add" && this.status === "amend")) { |
| | | if (this.type === "add") { |
| | | this.getCodeRule(); |
| | | return; |
| | | } |
| | |
| | | } |
| | | }) |
| | | if (this.$refs.CodeApply) { // 添加一个判断语句,检查对象是否为undefined |
| | | this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type); |
| | | this.$refs.CodeApply.changeStatusItem(this.secVOList, this.TreeValue, this.type); |
| | | } |
| | | }, |
| | | //年代号 |
| | |
| | | }); |
| | | |
| | | if (this.$refs.CodeApply) { |
| | | this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type); |
| | | this.$refs.CodeApply.changeStatusItem(this.secVOList, this.TreeValue, this.type); |
| | | } |
| | | }, |
| | | //属性码段赋值 |
| | |
| | | attrTableWidth: 120, |
| | | ts: "" |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | // 将英文编号转换为小写 |
| | | let { id, ...res } = this.busineAddList; |
| | | this.busineAddList = { id: id.toLowerCase(), ...res }; |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))); |
| | | } |
| | | }) |
| | | this.addVisible = false; |
| | |
| | | |
| | | <!-- 基础码段展示区域 --> |
| | | <basic-container class="code-basicsec-container"> |
| | | <div style="height: 38.5vh;overflow: auto"> |
| | | <p |
| | | style="margin-top: -5px; |
| | | <div style="height: 38.5vh;overflow: auto"> |
| | | <p |
| | | style="margin-top: -5px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f;"> |
| | | 码段管理 |
| | | </p> |
| | | <avue-crud |
| | | ref="crudBasic" |
| | | :data="basicData" |
| | | :option="optionBasic" |
| | | :permission="basicPermissionList" |
| | | :table-loading="loadingBasic" |
| | | class="code-basic-crud" |
| | | @row-click="codeBasicSecRowClick" |
| | | @search-change="basicSearchChange" |
| | | @search-reset="basicSearchReset" |
| | | @selection-change="selectionBasicChange" |
| | | @refresh-change="refreshChangeBasicSec" |
| | | > |
| | | <!-- 基础码段表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.viewBtn && currentRuleLcStatus != 'Editing'" |
| | | icon="el-icon-view" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('view', scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.editBtn && currentRuleLcStatus === 'Editing'" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('edit', scope.row)" |
| | | >编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="basicPermissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | icon="el-icon-setting" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicSecCodeValueMgr(scope.row)" |
| | | >码值管理 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicMoveupBtn && scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >上移 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >下移 |
| | | </el-button> |
| | | </template> |
| | | 码段管理 |
| | | </p> |
| | | <avue-crud |
| | | ref="crudBasic" |
| | | :data="basicData" |
| | | :option="optionBasic" |
| | | :permission="basicPermissionList" |
| | | :table-loading="loadingBasic" |
| | | class="code-basic-crud" |
| | | @row-click="codeBasicSecRowClick" |
| | | @search-change="basicSearchChange" |
| | | @search-reset="basicSearchReset" |
| | | @selection-change="selectionBasicChange" |
| | | @refresh-change="refreshChangeBasicSec" |
| | | > |
| | | <!-- 基础码段表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.viewBtn && currentRuleLcStatus != 'Editing'" |
| | | icon="el-icon-view" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('view', scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.editBtn && currentRuleLcStatus === 'Editing'" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('edit', scope.row)" |
| | | >编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="basicPermissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | icon="el-icon-setting" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicSecCodeValueMgr(scope.row)" |
| | | >码值管理 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicMoveupBtn && scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >上移 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >下移 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | type="primary" |
| | | @click="openAddBasicCodeSec" |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="deleteBasicCode(scope.row)" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeBasicSec')" |
| | | > |
| | | 高级查询 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | type="primary" |
| | | @click="openAddBasicCodeSec" |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="deleteBasicCode(scope.row)" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeBasicSec')" |
| | | > |
| | | 高级查询 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-container> |
| | | |
| | | <!-- 码段码值管理对话框 --> |
| | |
| | | > |
| | | <!-- 第一层对话框,添加码段信息对话框中的内容 --> |
| | | <div class="add-basicsec-total"> |
| | | <el-form :model="form" class="add-basicsec-form" :rules="rules" > |
| | | <el-form :model="form" :rules="rules" class="add-basicsec-form"> |
| | | <span class="left"> |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | |
| | | <template> |
| | | <vciWebRefer |
| | | ref="refer" |
| | | :referConfig="this.referConfig || {}" |
| | | :display="true" |
| | | :value="form.customCodeSerialClass" |
| | | :text="form.customCodeSerialClassText" |
| | | :referConfig="this.referConfig || {}" |
| | | :serialType="form.serialType" |
| | | :text="form.customCodeSerialClassText" |
| | | :value="form.customCodeSerialClass" |
| | | @setReferValue="setReferValue" |
| | | ></vciWebRefer> |
| | | </template> |
| | |
| | | <!-- 日期码段 --> |
| | | <div v-show="form.secType === 'codedatesec' ? true : false"> |
| | | <el-form-item |
| | | prop="Dateformat" |
| | | :label-width="rightFormLabelWidth" |
| | | label="日期格式:" |
| | | prop="Dateformat" |
| | | > |
| | | <el-input |
| | | ref="codeDateFormatStr" |
| | |
| | | import vciWebRefer from "../../components/refer/vciWebRefer"; |
| | | |
| | | export default { |
| | | components: { vciWebRefer }, |
| | | components: {vciWebRefer}, |
| | | data() { |
| | | return { |
| | | rules: { |
| | |
| | | required: true, |
| | | trigger: 'blur', |
| | | validator: (rule, value, callback) => { |
| | | const Formats = ['yy', 'yyyy', 'yyyy-MM', 'yy-MM', 'yyyy-MM-dd','yy-MM-dd', 'yyyy-MM-dd HH:mm:ss', 'yy-MM-dd HH:mm:ss', 'HH:mm:ss']; |
| | | const Formats = ['yy', 'yyyy', 'yyyy-MM', 'yy-MM', 'yyyy-MM-dd', 'yy-MM-dd', 'yyyy-MM-dd HH:mm:ss', 'yy-MM-dd HH:mm:ss', 'HH:mm:ss']; |
| | | if (!Formats.includes(this.form.codeDateFormatStr)) { |
| | | return callback(new Error('请输入正确日期格式,例如yyyy-MM-dd(并区分大小写)!')); |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | referConfig:{ |
| | | referConfig: { |
| | | title: '自定义流水参照', |
| | | showField: 'customCodeSerialClassText', |
| | | field: 'customCodeSerialClass', |
| | | fieldMap: { |
| | | serialType:"serialType" |
| | | fieldMap: { |
| | | serialType: "serialType" |
| | | }, |
| | | placeholder:'请选择自定义流水', |
| | | options: { |
| | | placeholder: '请选择自定义流水', |
| | | options: { |
| | | // 设置默认的属性 |
| | | url: 'api/ubcs-code/codeSerialAlgorithmController/gridCodeSerialAlgorithm', |
| | | textField:'name', |
| | | valueField:'classFullName', |
| | | textField: 'name', |
| | | valueField: 'classFullName', |
| | | isMuti: false, |
| | | type: "grid", |
| | | method: 'get', |
| | |
| | | }, |
| | | methods: { |
| | | //自定义流水失焦 |
| | | setReferValue(data){ |
| | | if(data.field){ |
| | | setReferValue(data) { |
| | | if (data.field) { |
| | | this.form[data.field] = data.value || ""; |
| | | this.form[data.showField] = data.text || ""; |
| | | this.form.serialType = data.rawData[0].serialType || ""; |
| | |
| | | } |
| | | //console.log(this.form); |
| | | //为form绑定值 |
| | | this.changeSectypeFormItems(condition == "add" ? null:row); |
| | | this.changeSectypeFormItems(condition == "add" ? null : row); |
| | | this.addBasicCodeSettingBox = true; |
| | | }, |
| | | /** 新增基础码段*/ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :permission="permissionList" :search.sync="search" |
| | | <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :permission="permissionList" |
| | | :search.sync="search" |
| | | :table-loading="loading" |
| | | @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" @row-update="handleEdit" |
| | | @refresh-change="handleRefresh" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | |
| | | <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" |
| | | :rules="rules" @resetFields="resetForm" status-icon="true"> |
| | | <el-form-item label="英文名称" label-width="100px" required="true" prop="id"> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="true"></el-input> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="Object.keys(this.btmType).length !== 0 "></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="中文名称" label-width="100px"> |
| | | <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> |
| | |
| | | name: 'BusinessAdd', |
| | | props: { |
| | | btmType: { |
| | | type: Object |
| | | type: Object, |
| | | default:{} |
| | | }, |
| | | domainOption: { |
| | | type: Array |
| | |
| | | <template> |
| | | <el-dialog title="链接类型" :visible.sync="showSubmitDialog" append-to-body @close="closeSubmitDialog" width="70%" top="6vh" |
| | | style="height: 115vh;"> |
| | | <el-form ref="form" :model="linkType" show-message="true" inline size="medium" label-suffix=":" |
| | | class="linkTypeForm" :rules="rules" @resetFields="resetForm" status-icon="true"> |
| | | <el-form-item label="英文名称" label-width="100px" required="true" prop="id"> |
| | | <el-input v-model="linkType.id" :prefix-icon="icons.id" maxlength="15" show-word-limit type="text"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="中文名称" label-width="100px"> |
| | | <el-input v-model="linkType.name" :prefix-icon="icons.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="数据库表名" label-width="100px"> |
| | | <el-input v-model="linkType.tableName" :prefix-icon="icons.tableName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属领域" label-width="100px" prop="domain"> |
| | | <el-select v-model="linkType.domain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" :label="item.label" :value="item.value" |
| | | :key="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="From端类型" label-width="100px"> |
| | | <!-- from端业务类型选择 --> |
| | | <el-select v-model="linkType.fromBtmValues" :value="linkType.fromBtmTypes" value-key="oid" placeholder="请选择From端类型" filterable multiple collapse-tags @change="fromSelectChange"> |
| | | <el-option-group v-for="domain in domainList" :key="domain.id" :label="domain.name"> |
| | | <el-option v-for="item in domain.childList" :key="item.oid" :label="item.id + item.name" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="To端类型" label-width="100px"> |
| | | <!-- to端业务类型选择 --> |
| | | <el-select v-model="linkType.toBtmValues" :value="linkType.toBtmTypes" value-key="oid" placeholder="请选择To端类型" filterable multiple collapse-tags @change="toSelectChange"> |
| | | <el-option-group v-for="domain in domainList" :key="domain.id" :label="domain.name"> |
| | | <el-option v-for="item in domain.childList" :key="item.oid" :label="item.id + item.name" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="描述" label-width="100px" class="description"> |
| | | <el-input v-model="linkType.description" :prefix-icon="icons.desc" class="descClass" id="descId"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <avue-crud :option="option" :data="linkType.attributes" :page.sync="page" ref="attrTable" |
| | | @cell-mouse-enter="cellEditClick" @cell-mouse-leave="cellEditSave"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button type="danger" icon="el-icon-plus" size="small" @click="rowAdd()">属性选择</el-button> |
| | | </template> |
| | | <el-dialog :visible.sync="showSubmitDialog" append-to-body style="height: 115vh;" title="链接类型" top="6vh" |
| | | width="70%" |
| | | @close="closeSubmitDialog"> |
| | | <el-form ref="form" :model="linkType" :rules="rules" class="linkTypeForm" inline label-suffix=":" |
| | | show-message="true" size="medium" status-icon="true" @resetFields="resetForm"> |
| | | <el-form-item label="英文名称" label-width="100px" prop="id" required="true"> |
| | | <el-input v-model="linkType.id" :disabled="this.linkType.hasOwnProperty('id')" :prefix-icon="icons.id" maxlength="15" show-word-limit |
| | | type="text"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="中文名称" label-width="100px"> |
| | | <el-input v-model="linkType.name" :prefix-icon="icons.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="数据库表名" label-width="100px"> |
| | | <el-input v-model="linkType.tableName" :prefix-icon="icons.tableName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属领域" label-width="100px" prop="domain"> |
| | | <el-select v-model="linkType.domain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="From端类型" label-width="100px"> |
| | | <!-- from端业务类型选择 --> |
| | | <el-select v-model="linkType.fromBtmValues" :value="linkType.fromBtmTypes" collapse-tags |
| | | filterable multiple placeholder="请选择From端类型" value-key="oid" @change="fromSelectChange"> |
| | | <el-option-group v-for="domain in domainList" :key="domain.id" :label="domain.name"> |
| | | <el-option v-for="item in domain.childList" :key="item.oid" :label="item.id + item.name" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="To端类型" label-width="100px"> |
| | | <!-- to端业务类型选择 --> |
| | | <el-select v-model="linkType.toBtmValues" :value="linkType.toBtmTypes" collapse-tags filterable |
| | | multiple placeholder="请选择To端类型" value-key="oid" @change="toSelectChange"> |
| | | <el-option-group v-for="domain in domainList" :key="domain.id" :label="domain.name"> |
| | | <el-option v-for="item in domain.childList" :key="item.oid" :label="item.id + item.name" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item class="description" label="描述" label-width="100px"> |
| | | <el-input id="descId" v-model="linkType.description" :prefix-icon="icons.desc" class="descClass"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <avue-crud ref="attrTable" :data="linkType.attributes" :option="option" :page.sync="page" |
| | | @cell-mouse-enter="cellEditClick" @cell-mouse-leave="cellEditSave"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="danger" @click="rowAdd()">属性选择</el-button> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitlinkType">确定</el-button> |
| | | <el-button @click="cancleSubmitlinkType">取消</el-button> |
| | | </div> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitlinkType">确定</el-button> |
| | | <el-button @click="cancleSubmitlinkType">取消</el-button> |
| | | </div> |
| | | |
| | | <!-- 属性池的选择 --> |
| | | <el-dialog title="属性池" :visible="attrRef.visible" append-to-body @close="closeAttrDialog" width="80%"> |
| | | <avue-crud class="attrRef" :option="attrRef.option" :data="attrRef.data" :page.sync="attrRef.page" ref="attrRef" |
| | | @on-load="attrRefOnLoad" @search-change="attrRefSearch" @selection-change="selectionChange"> |
| | | <template slot="typeValue" slot-scope="scope"> |
| | | <el-tag>{{ scope.row.typeValue }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="confirmSelectAttr">确定</el-button> |
| | | <el-button @click="cancleSelectAttr">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 属性池的选择 --> |
| | | <el-dialog :visible="attrRef.visible" append-to-body title="属性池" width="80%" @close="closeAttrDialog"> |
| | | <avue-crud ref="attrRef" :data="attrRef.data" :option="attrRef.option" :page.sync="attrRef.page" class="attrRef" |
| | | @on-load="attrRefOnLoad" @search-change="attrRefSearch" @selection-change="selectionChange"> |
| | | <template slot="typeValue" slot-scope="scope"> |
| | | <el-tag>{{ scope.row.typeValue }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="confirmSelectAttr">确定</el-button> |
| | | <el-button @click="cancleSelectAttr">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | |
| | | import { add, update } from '@/api/omd/linkType'; |
| | | import { queryPage } from '@/api/omd/OmdAttribute'; |
| | | import { getPage } from '@/api/omd/revisionRule'; |
| | | import { initTree } from "@/api/omd/btmType" |
| | | export default { |
| | | name: 'LinkTypeAdd', |
| | | props: { |
| | | linkType: { |
| | | type: Object |
| | | }, |
| | | domainOption: { |
| | | type: Array |
| | | }, |
| | | icons: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | showSubmitDialog: false, |
| | | option: { |
| | | height: "330px", |
| | | tip:false, |
| | | selection: true, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'id', |
| | | tabs: true, |
| | | menu: false, |
| | | addBtn: false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | align: 'center' |
| | | }, { |
| | | label: '中文名称', |
| | | prop: 'name', |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: '类型', |
| | | prop: 'attrDataType', |
| | | align: 'center', |
| | | slot: true |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: '说明', |
| | | prop: 'description', |
| | | align: 'center', |
| | | cell: true |
| | | } |
| | | ] |
| | | }, |
| | | attrRef: { |
| | | visible: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | }, |
| | | key: null, |
| | | option: { |
| | | height: 360, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | align: 'left', |
| | | search: true, |
| | | width: 230 |
| | | }, { |
| | | label: '中文名称', |
| | | prop: 'name', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | label: '类型', |
| | | prop: 'typeValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '允许为空', |
| | | prop: 'nullable', |
| | | type: 'switch', |
| | | display: false, |
| | | hide: true, |
| | | labelWidth: 132, |
| | | dicData: [{ |
| | | label: '否', |
| | | value: 1 |
| | | }, { |
| | | label: '是', |
| | | value: 0 |
| | | }] |
| | | }, |
| | | { |
| | | label: '说明', |
| | | prop: 'description', |
| | | cell: true, |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: null |
| | | }, |
| | | fromBtmValues: [], |
| | | toBtmValues: [], |
| | | domainList: [], |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: '请输入链接类型编号', trigger: 'blur' }, |
| | | { pattern: /^[A-Za-z]+$/, message: '链接类型编号只能为英文', trigger: 'blur' }, |
| | | { min: 2, max: 15, message: '长度在2到15个字符', trigger: 'blur' } |
| | | ], |
| | | domain: [ |
| | | { required: true, message: '请选择所属领域', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.initTreeOnLoad(); |
| | | }, |
| | | methods: { |
| | | // 关闭组件弹窗 |
| | | closeSubmitDialog() { |
| | | this.showSubmitDialog = false; |
| | | this.linkType.attributes = []; |
| | | this.linkType = {}; |
| | | this.attrRef.selectData = []; |
| | | this.attrRef.queryNotIn = null; |
| | | this.resetForm(); |
| | | }, |
| | | // 关闭属性池查询弹窗 |
| | | closeAttrDialog() { |
| | | this.attrRef.visible = false; |
| | | }, |
| | | initTreeOnLoad() { |
| | | initTree().then(res => { |
| | | this.domainList = res.data.data; |
| | | }); |
| | | }, |
| | | // 添加 |
| | | rowAdd() { |
| | | this.attrRef.visible = true; |
| | | this.attrRefOnLoad(); |
| | | }, |
| | | // 属性池加载 |
| | | attrRefOnLoad() { |
| | | queryPage(this.attrRef.key, this.attrRef.queryNotIn, this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.attrRef.page.total = data.total; |
| | | this.attrRef.data = data.records; |
| | | }); |
| | | this.$nextTick(() => { |
| | | this.$refs.attrRef.refreshTable(); |
| | | }); |
| | | }, |
| | | // 属性池检索 |
| | | attrRefSearch(form, done) { |
| | | this.attrRef.key = form.key |
| | | this.attrRefOnLoad(); |
| | | done(); |
| | | this.attrRef.key = null; |
| | | }, |
| | | // 属性池勾选事件 |
| | | selectionChange(list) { |
| | | this.attrRef.selectData = list; |
| | | }, |
| | | // 确认属性池勾选 |
| | | confirmSelectAttr() { |
| | | if(!this.linkType.attributes){ |
| | | this.linkType.attributes = []; |
| | | } |
| | | this.attrRef.queryNotIn = ""; |
| | | console.log(this.attrRef.selectData); |
| | | this.attrRef.selectData.forEach(item => { |
| | | this.linkType.attributes.push({ |
| | | id: item.id, |
| | | name: item.name, |
| | | typeValue: item.typeValue, |
| | | typeKey: item.typeValue, |
| | | attrDataType: item.typeKey, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description, |
| | | attributeLength: item.maxLength |
| | | }); |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | | }); |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 取消属性池勾选 |
| | | cancleSelectAttr() { |
| | | this.attrRef.selectData = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 添加业务类型 |
| | | submitlinkType() { |
| | | add(this.linkType, true).then(res => { |
| | | // 添加完成,回调父组件的刷新 |
| | | this.$message.success('保存成功'); |
| | | this.cancleSubmitlinkType(); |
| | | this.$emit('refreshTable'); |
| | | }) |
| | | }, |
| | | // 取消添加业务类型 |
| | | cancleSubmitlinkType() { |
| | | this.linkType = {}; |
| | | this.linkType.attributes = []; |
| | | this.showSubmitDialog = false; |
| | | }, |
| | | // 刷新属性列表 |
| | | refreshAttrTable() { |
| | | this.$nextTick(() => { |
| | | this.$refs.attrTable.refreshTable(); |
| | | }) |
| | | }, |
| | | // |
| | | viewChange() { |
| | | import {add, update} from '@/api/omd/linkType'; |
| | | import {queryPage} from '@/api/omd/OmdAttribute'; |
| | | import {getPage} from '@/api/omd/revisionRule'; |
| | | import {initTree} from "@/api/omd/btmType" |
| | | |
| | | }, |
| | | // 列表编辑 |
| | | cellEditClick(cell) { |
| | | cell.$cellEdit = true; |
| | | }, |
| | | // 列表编辑保存 |
| | | cellEditSave(row) { |
| | | this.linkType.attributes[row.$index].name = row.name |
| | | this.linkType.attributes[row.$index].defaultValue = row.defaultValue; |
| | | this.linkType.attributes[row.$index].description = row.description; |
| | | row.$cellEdit = false; |
| | | }, |
| | | fromSelectChange(dataList){ |
| | | console.log(dataList); |
| | | this.linkType.fromBtmTypes = []; |
| | | var fromBtmName = ""; |
| | | var fromBtmType = ""; |
| | | dataList.forEach(data => { |
| | | //this.linkType.fromBtmTypes.push(data); |
| | | fromBtmName += (data.name + ','); |
| | | fromBtmType += (data.id + ','); |
| | | }) |
| | | this.linkType.fromBtmTypeName = fromBtmName; |
| | | this.linkType.fromBtmType = fromBtmType; |
| | | console.log(this.linkType); |
| | | }, |
| | | toSelectChange(dataList){ |
| | | console.log(dataList); |
| | | this.linkType.toBtmTypes = []; |
| | | var toBtmName = ""; |
| | | var toBtmType = ""; |
| | | dataList.forEach(data => { |
| | | //this.linkType.toBtmTypes.push(data); |
| | | toBtmName += (data.name + ','); |
| | | toBtmType += (data.id + ','); |
| | | }) |
| | | this.linkType.toBtmTypeName = toBtmName; |
| | | this.linkType.toBtmType = toBtmType; |
| | | console.log(this.linkType); |
| | | }, |
| | | resetForm(){ |
| | | this.linkType = {}; |
| | | this.$refs.form.resetFields(); |
| | | } |
| | | export default { |
| | | name: 'LinkTypeAdd', |
| | | props: { |
| | | linkType: { |
| | | type: Object, |
| | | default: {} |
| | | }, |
| | | domainOption: { |
| | | type: Array |
| | | }, |
| | | icons: { |
| | | type: Array |
| | | } |
| | | }, |
| | | watch: { |
| | | linkType:{ |
| | | handler(newval){ |
| | | // console.log(newval); |
| | | // console.log( newval.hasOwnProperty('id')) |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | showSubmitDialog: false, |
| | | option: { |
| | | height: "330px", |
| | | tip: false, |
| | | selection: true, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'id', |
| | | tabs: true, |
| | | menu: false, |
| | | addBtn: false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | align: 'center' |
| | | }, { |
| | | label: '中文名称', |
| | | prop: 'name', |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: '类型', |
| | | prop: 'attrDataType', |
| | | align: 'center', |
| | | slot: true |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: '说明', |
| | | prop: 'description', |
| | | align: 'center', |
| | | cell: true |
| | | } |
| | | ] |
| | | }, |
| | | attrRef: { |
| | | visible: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | }, |
| | | key: null, |
| | | option: { |
| | | height: 360, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | align: 'left', |
| | | search: true, |
| | | width: 230 |
| | | }, { |
| | | label: '中文名称', |
| | | prop: 'name', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | label: '类型', |
| | | prop: 'typeValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '允许为空', |
| | | prop: 'nullable', |
| | | type: 'switch', |
| | | display: false, |
| | | hide: true, |
| | | labelWidth: 132, |
| | | dicData: [{ |
| | | label: '否', |
| | | value: 1 |
| | | }, { |
| | | label: '是', |
| | | value: 0 |
| | | }] |
| | | }, |
| | | { |
| | | label: '说明', |
| | | prop: 'description', |
| | | cell: true, |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: null |
| | | }, |
| | | fromBtmValues: [], |
| | | toBtmValues: [], |
| | | domainList: [], |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请输入链接类型编号', trigger: 'blur'}, |
| | | {pattern: /^[A-Za-z]+$/, message: '链接类型编号只能为英文', trigger: 'blur'}, |
| | | {min: 2, max: 15, message: '长度在2到15个字符', trigger: 'blur'} |
| | | ], |
| | | domain: [ |
| | | {required: true, message: '请选择所属领域', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.initTreeOnLoad(); |
| | | }, |
| | | methods: { |
| | | // 关闭组件弹窗 |
| | | closeSubmitDialog() { |
| | | this.showSubmitDialog = false; |
| | | this.linkType.attributes = []; |
| | | this.linkType = {}; |
| | | this.attrRef.selectData = []; |
| | | this.attrRef.queryNotIn = null; |
| | | this.resetForm(); |
| | | }, |
| | | // 关闭属性池查询弹窗 |
| | | closeAttrDialog() { |
| | | this.attrRef.visible = false; |
| | | }, |
| | | initTreeOnLoad() { |
| | | initTree().then(res => { |
| | | this.domainList = res.data.data; |
| | | }); |
| | | }, |
| | | // 添加 |
| | | rowAdd() { |
| | | this.attrRef.visible = true; |
| | | this.attrRefOnLoad(); |
| | | }, |
| | | // 属性池加载 |
| | | attrRefOnLoad() { |
| | | queryPage(this.attrRef.key, this.attrRef.queryNotIn, this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.attrRef.page.total = data.total; |
| | | this.attrRef.data = data.records; |
| | | }); |
| | | this.$nextTick(() => { |
| | | this.$refs.attrRef.refreshTable(); |
| | | }); |
| | | }, |
| | | // 属性池检索 |
| | | attrRefSearch(form, done) { |
| | | this.attrRef.key = form.key |
| | | this.attrRefOnLoad(); |
| | | done(); |
| | | this.attrRef.key = null; |
| | | }, |
| | | // 属性池勾选事件 |
| | | selectionChange(list) { |
| | | this.attrRef.selectData = list; |
| | | }, |
| | | // 确认属性池勾选 |
| | | confirmSelectAttr() { |
| | | if (!this.linkType.attributes) { |
| | | this.linkType.attributes = []; |
| | | } |
| | | this.attrRef.queryNotIn = ""; |
| | | console.log(this.attrRef.selectData); |
| | | this.attrRef.selectData.forEach(item => { |
| | | this.linkType.attributes.push({ |
| | | id: item.id, |
| | | name: item.name, |
| | | typeValue: item.typeValue, |
| | | typeKey: item.typeValue, |
| | | attrDataType: item.typeKey, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description, |
| | | attributeLength: item.maxLength |
| | | }); |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | | }); |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 取消属性池勾选 |
| | | cancleSelectAttr() { |
| | | this.attrRef.selectData = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 添加业务类型 |
| | | submitlinkType() { |
| | | add(this.linkType, true).then(res => { |
| | | // 添加完成,回调父组件的刷新 |
| | | this.$message.success('保存成功'); |
| | | this.cancleSubmitlinkType(); |
| | | this.$emit('refreshTable'); |
| | | }) |
| | | }, |
| | | // 取消添加业务类型 |
| | | cancleSubmitlinkType() { |
| | | this.linkType = {}; |
| | | this.linkType.attributes = []; |
| | | this.showSubmitDialog = false; |
| | | }, |
| | | // 刷新属性列表 |
| | | refreshAttrTable() { |
| | | this.$nextTick(() => { |
| | | this.$refs.attrTable.refreshTable(); |
| | | }) |
| | | }, |
| | | // |
| | | viewChange() { |
| | | |
| | | }, |
| | | // 列表编辑 |
| | | cellEditClick(cell) { |
| | | cell.$cellEdit = true; |
| | | }, |
| | | // 列表编辑保存 |
| | | cellEditSave(row) { |
| | | this.linkType.attributes[row.$index].name = row.name |
| | | this.linkType.attributes[row.$index].defaultValue = row.defaultValue; |
| | | this.linkType.attributes[row.$index].description = row.description; |
| | | row.$cellEdit = false; |
| | | }, |
| | | fromSelectChange(dataList) { |
| | | console.log(dataList); |
| | | this.linkType.fromBtmTypes = []; |
| | | var fromBtmName = ""; |
| | | var fromBtmType = ""; |
| | | dataList.forEach(data => { |
| | | //this.linkType.fromBtmTypes.push(data); |
| | | fromBtmName += (data.name + ','); |
| | | fromBtmType += (data.id + ','); |
| | | }) |
| | | this.linkType.fromBtmTypeName = fromBtmName; |
| | | this.linkType.fromBtmType = fromBtmType; |
| | | console.log(this.linkType); |
| | | }, |
| | | toSelectChange(dataList) { |
| | | console.log(dataList); |
| | | this.linkType.toBtmTypes = []; |
| | | var toBtmName = ""; |
| | | var toBtmType = ""; |
| | | dataList.forEach(data => { |
| | | //this.linkType.toBtmTypes.push(data); |
| | | toBtmName += (data.name + ','); |
| | | toBtmType += (data.id + ','); |
| | | }) |
| | | this.linkType.toBtmTypeName = toBtmName; |
| | | this.linkType.toBtmType = toBtmType; |
| | | console.log(this.linkType); |
| | | }, |
| | | resetForm() { |
| | | this.linkType = {}; |
| | | this.$refs.form.resetFields(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | /* 属性池参照列表 */ |
| | | .attrRef>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | .attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | |
| | | .revisionRef>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | .revisionRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | |
| | | .linkTypeForm>.el-form-item>.el-form-item__content>.el-input>.el-input__inner,.linkTypeForm>.el-form-item>.el-form-item__content>.el-select{ |
| | | width: 290px; |
| | | .linkTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner, .linkTypeForm > .el-form-item > .el-form-item__content > .el-select { |
| | | width: 290px; |
| | | } |
| | | |
| | | .descClass>.el-input__inner { |
| | | width: 57vw |
| | | .descClass > .el-input__inner { |
| | | width: 57vw |
| | | } |
| | | |
| | | #descId { |
| | | width: 57vw; |
| | | width: 57vw; |
| | | } |
| | | .el-tag + .el-tag{ |
| | | |
| | | .el-tag + .el-tag { |
| | | margin-top: 2px; |
| | | } |
| | | </style> |
| | |
| | | <el-form ref="form" :model="attribute" show-message="true" inline size="medium" label-suffix=":" |
| | | class="attributeForm" :rules="rules" @resetFields="resetAttributeForm" status-icon="true"> |
| | | <el-form-item label="属性编号" label-width="100px" prop="id"> |
| | | <el-input v-model="attribute.id" maxlength="30" show-word-limit type="text"></el-input> |
| | | <el-input v-model="attribute.id" maxlength="30" show-word-limit @input="handleIdInput"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="属性名称" label-width="100px" prop="name"> |
| | | <el-input v-model="attribute.name"></el-input> |
| | |
| | | this.initAttributeReferTypeList(); |
| | | }, |
| | | methods: { |
| | | handleIdInput(value){ |
| | | this.attribute.id = value.toLowerCase(); |
| | | }, |
| | | onSubmit() { |
| | | if (this.form.name || this.form.label) { |
| | | const params = {}; |
| | |
| | | border |
| | | style="width: 100%;height: calc(100vh - 320px)" |
| | | @cell-click="cellClickHandler"> |
| | | <el-table-column |
| | | align="center" |
| | | label="1" |
| | | prop="1" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="2" |
| | | prop="2" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="3" |
| | | prop="3"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="4" |
| | | prop="4"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="5" |
| | | prop="5"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="6" |
| | | prop="6"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="7" |
| | | prop="7"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="8" |
| | | prop="8"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="9" |
| | | prop="9"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="10" |
| | | prop="10"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="11" |
| | | prop="11"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="12" |
| | | prop="12"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="13" |
| | | prop="13"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="14" |
| | | prop="14"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="15" |
| | | prop="15"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="1" prop="1"></el-table-column> |
| | | <el-table-column align="center" label="2" prop="2"></el-table-column> |
| | | <el-table-column align="center" label="3" prop="3"></el-table-column> |
| | | <el-table-column align="center" label="4" prop="4"></el-table-column> |
| | | <el-table-column align="center" label="5" prop="5"></el-table-column> |
| | | <el-table-column align="center" label="6" prop="6"></el-table-column> |
| | | <el-table-column align="center" label="7" prop="7"></el-table-column> |
| | | <el-table-column align="center" label="8" prop="8"></el-table-column> |
| | | <el-table-column align="center" label="9" prop="9"></el-table-column> |
| | | <el-table-column align="center" label="10" prop="10"></el-table-column> |
| | | <el-table-column align="center" label="11" prop="11"></el-table-column> |
| | | <el-table-column align="center" label="12" prop="12"></el-table-column> |
| | | <el-table-column align="center" label="13" prop="13"></el-table-column> |
| | | <el-table-column align="center" label="14" prop="14"></el-table-column> |
| | | <el-table-column align="center" label="15" prop="15"></el-table-column> |
| | | </el-table> |
| | | </el-main> |
| | | <el-footer> |
| | |
| | | // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue); |
| | | // const chartValue = targetObject.name; |
| | | getList({codeRuleId: this.select, chartType: "charset", chartValue: this.characterValue}).then(res => { |
| | | console.log(res.data.data); |
| | | // console.log(res.data.data); |
| | | this.tableData = res.data.data; |
| | | this.loading = false; |
| | | }); |
| | |
| | | */ |
| | | @GetMapping("/exportGroupCodeExcel") |
| | | @VciBusinessLog(operateName = "导出集团码") |
| | | public R exportGroupCodeExcel(String codeClassifyOid, HttpServletResponse response){ |
| | | public void exportGroupCodeExcel(String codeClassifyOid, HttpServletResponse response) throws IOException { |
| | | try { |
| | | String excelName = mdmIOService.exportGroupCodeExcel(codeClassifyOid); |
| | | ControllerUtil.writeFileToResponse(response,excelName); |
| | |
| | | msg = "未知错误"; |
| | | } |
| | | String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "错误.txt"; |
| | | LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile); |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,errorFile); |
| | | } catch (IOException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | String uuid=ControllerUtil.putErrorFile(errorFile); |
| | | return R.fail(msg); |
| | | // ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null); |
| | | LocalFileUtil.writeContentToFile(msg,errorFile); |
| | | ControllerUtil.writeFileToResponse(response,errorFile); |
| | | // return R.fail(msg); |
| | | } |
| | | return R.status(true); |
| | | // return R.status(true); |
| | | } |
| | | |
| | | /*** |
| | |
| | | * @return 执行结果 |
| | | * @throws VciBaseException 参数为空,唯一项,必输项不通过时会抛出异常 |
| | | */ |
| | | @Override |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "需要添加的数据对象",codeBasicSecDTO.getPkCodeRule(),"编码规则的主键"); |
| | |
| | | //引用码段的时候,需要判断参照的信息是否正确 |
| | | if(CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(codeBasicSecDO.getSecType())){ |
| | | if(StringUtils.isBlank(codeBasicSecDO.getReferConfig())){ |
| | | throw new VciBaseException("引用码段的时候,需要填写 参照配置的内容"); |
| | | throw new VciBaseException("引用码段的时候,需要填写参照配置的内容"); |
| | | } |
| | | try{ |
| | | //JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class); |
| | |
| | | allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode",user);allCode.setLctid("codeAllCodeLC");} |
| | | ); |
| | | |
| | | |
| | | Map<String, String> statusMap = allCodeDOList.stream().collect(Collectors.toMap(s -> s.getOid(), s -> s.getLcStatus())); |
| | | allCodeDOList.stream().filter(s -> StringUtils.equalsIgnoreCase("codeallcode",s.getBtmname())).forEach(s -> { |
| | | s.setLcStatus(statusMap.get(s.getOid())); |
| | |
| | | switchSecValueBZ(secVO, secValueMap, classifyFullInfoBO, serialSecVOList, attrSecVOList, serialUnitList, secValueList); |
| | | //分段存储流水依赖 |
| | | if(secVO.getSecType().equals(CodeSecTypeEnum.CODE_SERIAL_SEC.getValue())){ |
| | | int finalI = i; |
| | | final int[] index = {0}; |
| | | List<String> newSerialUnitList= serialUnitList.stream().filter(secValueStr -> { |
| | | return !secValueStr.equals("${"+secVO.getOid()+"}"); |
| | | return index[0]++< finalI;//除去流水的 |
| | | }).collect(Collectors.toList()); |
| | | String serialUnitString = serialUnitList.size() == 0 ? EMPTY_SERIAL_UNIT : newSerialUnitList.stream().collect(Collectors.joining(SERIAL_UNIT_SPACE)); |
| | | String serialUnitString = newSerialUnitList.size() == 0 ? EMPTY_SERIAL_UNIT : newSerialUnitList.stream().collect(Collectors.joining(SERIAL_UNIT_SPACE)); |
| | | secOdserialUnitMap.put(secVO.getOid(),serialUnitString); |
| | | } |
| | | } |
| | |
| | | AtomicReference<String> serialUnitString= new AtomicReference<>(""); |
| | | for (int j = 0; j < serialSecVOList.size(); j++) { |
| | | CodeBasicSecVO secVO = serialSecVOList.get(j); |
| | | if(lastMaxSerialValueMap.containsKey(secVO.getOid())){ |
| | | if(lastMaxSerialValueMap.containsKey(secVO.getOid())){//此为最后需要存入流水依赖的最大流水 |
| | | Map<String/**流水依据**/, String> serialValueMap= lastMaxSerialValueMap.get(secVO.getOid()); |
| | | serialValueMap.forEach((maxSerialUnitString,serialValue)->{ |
| | | if(StringUtils.isNotBlank(serialValue)){ |
| | |
| | | sb.append(serialValue).append(SERIAL_VALUE_SPACE); |
| | | } |
| | | }); |
| | | }else{ |
| | | if(secValueMap.containsKey(secVO.getOid())) {//企业标准处理修订顺序号已经存在的数据则不需要动流水依赖表的数据 |
| | | serialUnitString.set(secOdserialUnitMap.get(secVO.getOid())); |
| | | sb.append(secValueMap.get(secVO.getOid())).append(SERIAL_VALUE_SPACE); |
| | | } |
| | | } |
| | | } |
| | | String codeDelimiter=thisSecValueList.stream().collect(Collectors.joining(SERIAL_VALUE_SPACE)); |