From ec407e8676f6245d88da3d9f729ad545ae3218c0 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 18 七月 2023 15:20:03 +0800 Subject: [PATCH] 代码提交 --- Source/UBCS-WEB/src/views/code/code.vue | 2007 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 1,085 insertions(+), 922 deletions(-) diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue index 5703cc0..5b4a5a7 100644 --- a/Source/UBCS-WEB/src/views/code/code.vue +++ b/Source/UBCS-WEB/src/views/code/code.vue @@ -54,52 +54,84 @@ @click="enableOrDeactivatse(scope.row.oid,'enable')">鍚� 鐢� </el-button> </template> - <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� --> + <!-- 琛ㄦ牸涓婃柟鎸夐挳鍖哄煙 --> <template slot="menuLeft" slot-scope="scope"> <el-button type="danger" - size="small" - icon="el-icon-delete" - plain - @click="handleDelete">鍒� 闄� + size="small" + icon="el-icon-delete" + plain + @click="handleDelete"> + 鍒� 闄� </el-button> - <el-button size="small" - icon="icon-kelong" - plain - @click="openCodeRuleDialog">鍏� 闅� + <el-button type="primary" + size="small" + icon="el-icon-search" + plain + @click="openAdvancedQuery('codeRule')"> + 楂樼骇鏌ヨ </el-button> - <el-button size="small" - icon="icon-lianjiekelong" - style="font-size: 12px;" - plain - @click="openOtherCodeRuleDialog">浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹 + <el-button + size="small" + icon="icon-kelong" + plain + @click="openCodeRuleDialog"> + 鍏� 闅� </el-button> - <el-button size="small" - icon="el-icon-s-help" - plain - @click="handleRange">浣跨敤鑼冨洿 + <el-button + size="small" + icon="icon-lianjiekelong" + style="font-size: 12px;" + plain + @click="openOtherCodeRuleDialog"> + 浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹 </el-button> - <el-button size="small" - icon="icon-qingkong" - plain - @click="clearAllCodeSec">娓呯┖鐮佸�� + <el-button + size="small" + icon="el-icon-s-help" + plain + @click="handleRange"> + 浣跨敤鑼冨洿 + </el-button> + <el-button + size="small" + icon="icon-qingkong" + plain + @click="clearAllCodeSec"> + 娓呯┖鐮佸�� + </el-button> + <el-button + size="small" + icon="el-icon-guide" + plain + @click="escapeOwner"> + 杞Щ鎵�鏈夎�� </el-button> </template> </avue-crud> </basic-container> + + <!-- 楂樼骇鏌ヨ瀵硅瘽妗� --> + <advanced-query + :ref="advancedQueryParam.ref" + :options="advancedQueryParam.options" + :visible.sync="advancedQueryParam.advancedQuerySettingBox" + @echoContion="echoSeniorContionMap"> + </advanced-query> <!-- 缂栫爜瑙勫垯鐩稿叧瀵硅瘽妗� --> <el-dialog title="缂栫爜瑙勫垯浣跨敤鑼冨洿" append-to-body :visible.sync="codeRangeSettingBox" width="800px" - style="height: 116vh; margin-top: -10vh;"> + style="height: 116vh; margin-top: -10vh;"> <avue-crud - :option="dialogeOption" + :option="dialogeOption" :table-loading="dialogLoading" :data="useRangeData" @refresh-change="refreshUseRangeChange"> </avue-crud> </el-dialog> + <!-- 缂栫爜瑙勫垯,鍏嬮殕瀵硅瘽妗� --> <el-dialog title="鍏嬮殕缂栫爜瑙勫垯" append-to-body @@ -153,6 +185,7 @@ <el-button @click="cloneSettingBox = false">鍙� 娑�</el-button> </div> </el-dialog> + <!-- 缂栫爜瑙勫垯,浠庡叾浠栬鍒欏厠闅嗗璇濇 --> <el-dialog title="鍏嬮殕缂栫爜瑙勫垯鐨勫熀纭�淇℃伅" append-to-body @@ -193,6 +226,27 @@ <el-button type="primary" @click="saveOtherCodeBasic">淇� 瀛�</el-button> <el-button @click="cloneOtherCodeRuleSettingBox = false">鍙� 娑�</el-button> </div> + </el-dialog> + + <!-- 缂栫爜瑙勫垯,杞Щ鎵�鏈夎�呭璇濇 --> + <el-dialog + :visible.sync="escapeOwnerVisible" + append-to-body + title="杞Щ鎵�鏈夎��" + width="30%"> + <el-select v-model="ruleOwner" placeholder="璇烽�夋嫨" class="selects"> + <el-option + v-for="item in ruleAdminUserList" + :key="item.VALUE" + :label="item.LABLE" + :value="item.VALUE" + class="seloption"> + </el-option> + </el-select> + <span slot="footer" class="dialog-footer"> + <el-button @click="escapeOwnerVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="escapeOwnerConfirm">纭� 瀹�</el-button> + </span> </el-dialog> <!-- 鍩虹鐮佹灞曠ず鍖哄煙 --> @@ -259,7 +313,7 @@ size="small" icon="el-icon-plus" :disabled="selectionList.length <= 0" - @click="addBasicCodeSec"> + @click="openAddBasicCodeSec"> 鏂� 澧� </el-button> <el-button type="danger" @@ -269,6 +323,14 @@ plain @click="deleteBasicCode(scope.row)"> 鍒� 闄� + </el-button> + <el-button type="primary" + size="small" + icon="el-icon-search" + plain + :disabled="selectionList.length <= 0" + @click="openAdvancedQuery('codeBasicSec')"> + 楂樼骇鏌ヨ </el-button> </template> @@ -292,8 +354,8 @@ <basic-container> <div class="abox" style="height:54vh"> <avue-tree - :data="classifyValueTreeData" - :option="classisyValueTreeOption" + :data="classifyValueTreeData" + :option="classisyValueTreeOption" @node-click="classisyValueTreeOnodeClick" style="overflow-y: auto; height: 54vh"/> </div> @@ -384,6 +446,8 @@ append-to-body style="height: 115vh; margin-top: -13vh; overflow: hidden" destroy-on-close + lock-scroll + :close-on-click-modal="false" @close="clearBasicAddForm"> <!-- 绗竴灞傚璇濇,娣诲姞鐮佹淇℃伅瀵硅瘽妗嗕腑鐨勫唴瀹� --> @@ -397,11 +461,11 @@ <el-form-item label="鐮佹鍚嶇О:" :label-width="leftFormLabelWidth" required> <el-input ref="name" v-model="form.name" :readonly="basicSecOnlyRead"></el-input> </el-form-item> - + <el-form-item label="鐮佹绫诲瀷" :label-width="leftFormLabelWidth" required> <el-select v-model="form.secType" placeholder="璇烽�夋嫨" @change="changeSectypeFormItems(null)" :disabled="basicSecOnlyRead"> <el-option - v-for="item in sectypeList" + v-for="item in enumParam.secTypeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -429,7 +493,7 @@ <el-form-item label="鐮佹闀垮害绫诲瀷:" :label-width="rightFormLabelWidth" required> <el-select v-model="form.codeSecLengthType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeSecLengthType" + v-for="item in enumParam.codeSecLengthType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -455,7 +519,7 @@ </el-input> </el-form-item> <el-form-item label="灞炴�ф墍鍦ㄥ垎绫�:" :label-width="rightFormLabelWidth"> - <el-input + <el-input v-model="form.referCodeClassifyOidName" disabled> </el-input> @@ -486,17 +550,17 @@ <el-form-item label="缂栫爜琛ヤ綅鏂瑰紡:" :label-width="rightFormLabelWidth" required> <el-select v-model="form.codeFillType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option label="宸﹁ˉ浣�" value="codeattrsec" - v-for="item in codeFillType" + v-for="item in enumParam.codeFillType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> </el-option> </el-select> </el-form-item> - <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth"> - <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> + <el-form-item v-if="form.codeFillType!='code_fill_none'" label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth"> + <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeFillSeparator" + v-for="item in enumParam.codeFillSeparator" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -521,7 +585,7 @@ <el-form-item label="灞傜骇绫诲瀷:" :label-width="rightFormLabelWidth" required> <el-select v-model="form.codeLevelType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeLevelType" + v-for="item in enumParam.codeLevelType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -532,19 +596,22 @@ <el-input v-model.number="form.codeLevelValue" ref="codeLevelValue" :readonly="basicSecOnlyRead"></el-input> </el-form-item> <el-form-item label="瀛楃鎴彇绫诲瀷:" :label-width="rightFormLabelWidth" required> - <el-select v-model="form.valueCutType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> + <el-select v-model="form.valueCutType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead" @change="changeCutType($event)"> <el-option - v-for="item in codeCutType" + v-for="item in enumParam.codeCutType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> </el-option> </el-select> </el-form-item> + <el-form-item id="ShowOrHide" v-if="form.valueCutType!='code_cut_none'" label="鍊兼埅鍙栭暱搴�:" :label-width="rightFormLabelWidth"> + <el-input v-model.number="form.valueCutLength" ref="valueCutLength" :readonly="basicSecOnlyRead"></el-input> + </el-form-item> <el-form-item label="鍙栧�肩被鍨�:" :label-width="rightFormLabelWidth"> <el-select v-model="form.codeGetValueType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeGetValueType" + v-for="item in enumParam.codeGetValueType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -556,11 +623,11 @@ <div v-show="form.secType==='coderefersec' ? true:false"> <el-form-item label="鍙傜収寮曠敤鐨勪笟鍔$被鍨�:" label-width="152px" required> <el-input - ref="referBtmId" + ref="referBtmId" placeholder="璇烽�夋嫨" prefix-icon="el-icon-search" readonly="true" - v-model="form.referBtmId" + v-model="form.referBtmName" @focus="openAttrSelectOrGetValue('referBtmId')" :disabled="basicSecOnlyRead"> <i slot="suffix" class="el-icon-circle-close" @click="clearAttrDataByIcon('referBtmId')" style="margin-right: 5px;cursor: pointer;"></i> @@ -568,7 +635,7 @@ </el-form-item> <el-form-item label="鍙傜収閰嶇疆:" label-width="152px" required> <el-input - ref="referConfig" + ref="referConfig" placeholder="璇烽�夋嫨" prefix-icon="el-icon-search" readonly="true" @@ -590,7 +657,7 @@ <el-form-item label="鐮佹闀垮害绫诲瀷:" :label-width="rightFormLabelWidth" required> <el-select v-model="form.codeSecLengthType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeSecLengthType" + v-for="item in enumParam.codeSecLengthType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -623,17 +690,17 @@ <el-form-item label="缂栫爜琛ヤ綅鏂瑰紡:" :label-width="rightFormLabelWidth" required> <el-select v-model="form.codeFillType" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeFillType" + v-for="item in enumParam.codeFillType" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> </el-option> </el-select> </el-form-item> - <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth"> - <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> + <el-form-item v-if="form.codeFillType!='code_fill_none'" label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth"> + <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead"> <el-option - v-for="item in codeFillSeparator" + v-for="item in enumParam.codeFillSeparator" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"> @@ -644,11 +711,11 @@ </span> </el-form> </div> - <!-- 绗竴灞傚璇濇鐨勬寜閽拰锛岀嚎鏉� --> + <!-- 绗竴灞傚璇濇鐨勬寜閽拰鍒嗛殧绾挎潯 --> <el-divider class="horizontal-line" direction="horizontal"></el-divider> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="saveOrEditBasicCode" v-show="showbtn">淇� 瀛�</el-button> - <el-button @click="addBasicCodeSettingBox = false" v-show="showbtn">鍙� 娑�</el-button> + <el-button type="primary" @click="saveOrEditBasicCode" :disabled="!showbtn">淇� 瀛�</el-button> + <el-button @click="addBasicCodeSettingBox = false">鍙� 娑�</el-button> </div> <!-- 绗簩灞傚璇濇,灞炴�х爜娈碉紝灞炴�ч�夋嫨瀵硅瘽妗� --> @@ -676,11 +743,11 @@ <basic-container> <div class="bbox"> <avue-crud - :data="selectattrData" - :option="attrOption" - :table-loading="selectAttrOptionLoading" - ref="selectionAttrCrud" - @search-change="selectAttrOptionSearchChange" + :data="selectAttrParams.selectAttrData" + :option="selectAttrParams.attrOption" + :table-loading="selectAttrParams.selectAttrOptionLoading" + :ref="selectAttrParams.ref" + @search-change="selectAttrSearchChange" @search-reset="searchAttrReset" @row-click="selectionAttrRowClick" @selection-change="selectionChangeAttr"> @@ -697,25 +764,27 @@ </el-dialog> <!-- 绗簩灞傚璇濇,灞炴�х爜娈碉紝鍏紡缂栬緫妗嗗璇濇缁勪欢 --> - <formula-editor ref="formulaEditor" - @updateFormulaContent="updateFormulaContent" - :thisSceneTableData="thisSceneTableData" - :systemVariableTableData="systemVariableTableData"> + <formula-editor + ref="formulaEditor" + @updateFormulaContent="updateFormulaContent" + :visible.sync="formulaEditorParams.formulaEditorSettingBox" + :thisSceneTableData="formulaEditorParams.thisSceneTableData" + :systemVariableTableData="formulaEditorParams.systemVariableTableData"> </formula-editor> <!-- 绗簩灞傚璇濇,涓恒�愮埗鍒嗙被鐮佹銆戦�夊彇鍊煎璇濇 --> <el-dialog title="涓恒�愮埗鍒嗙被鐮佹銆戦�夊彇鍊�" append-to-body - :visible.sync="isShowParentClassifyOption" + :visible.sync="parentClsfyParams.isShowParentClassifySettingBox" width="65%" style="height: 150vh; margin-top: -13vh;" destroy-on-close> <avue-crud - :page.sync="parentClassifyDataPage" - ref="crudParentClassify" - :option="parentClassifyParentOption" - :table-loading="classifyDialogLoading" - :data="parentClassifyData" + :page.sync="parentClsfyParams.parentClassifyDataPage" + :ref="parentClsfyParams.ref" + :option="parentClsfyParams.parentClassifyParentOption" + :table-loading="parentClsfyParams.classifyDialogLoading" + :data="parentClsfyParams.parentClassifyData" @refresh-change="refreshParentClassifyDataChange" @search-change="parentClassifySearchChange" @search-reset="parentClassifySearchReset" @@ -727,45 +796,23 @@ </avue-crud> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="saveSelectedParentClassify">淇� 瀛�</el-button> - <el-button @click="isShowParentClassifyOption = false">鍙� 娑�</el-button> + <el-button @click="parentClsfyParams.isShowParentClassifySettingBox = false">鍙� 娑�</el-button> </div> </el-dialog> - <!-- 绗簩灞傚璇濇,涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊煎脊瀵硅瘽妗� --> - <el-dialog title="涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊�" - append-to-body - :visible.sync="isShowSelectReferBtmOption" - width="65%" - style="height: 150vh; margin-top: -13vh;"> - <avue-crud - :page.sync="referBtmDataPage" - ref="crudReferBtm" - :option="referBtmOption" - :table-loading="referBtmDialogLoading" - :data="referBtmData" - @refresh-change="referBtmDataChange" - @search-change="referBtmSearchChange" - @search-reset="referBtmSearchReset" - @selection-change="referBtmSelectionChange" - @current-change="referBtmCurrentChange" - @size-change="referBtmSizeChange" - @row-click="referBtmRowClick"> - </avue-crud> - <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="saveSelectedreferBtm">淇� 瀛�</el-button> - <el-button @click="isShowSelectReferBtmOption = false">鍙� 娑�</el-button> - </div> - </el-dialog> + <!-- 绗簩灞傚璇濇,涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊煎璇濇 --> + <refer-btm-type-crud-dialog + :visible.sync="referBtmDialogParams.selectReferBtmSettingBox" + :ref="referBtmDialogParams.ref" + @echoReferBtmType="echoReferBtmType"> + </refer-btm-type-crud-dialog> - <!-- 绗簩灞傚璇濇,鑷畾涔夊弬鐓ч厤缃瓼orm缁勪欢 --> - <refer-config-form-dialog - ref="referConfigFormDialog" - @echoReferConfig="echoReferConfig" > - </refer-config-form-dialog> - <!-- 绗簩灞傚璇濇,鐩存帴閫夋嫨鍙傜収閰嶇疆curd缁勪欢 --> - <refer-config-crud-dialog - ref="referConfigCrudDialog"> - </refer-config-crud-dialog> + <!-- 绗簩灞傚璇濇,鍙傜収閰嶇疆缁勪欢 --> + <refer-config-dialog + :display="referConfigVisble" + @setReferConfigValue="setReferConfigValue" + :referConfigOption="referConfigOption"> + </refer-config-dialog> </el-dialog> @@ -774,33 +821,33 @@ <script> import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus,clone,clearAllCode } from "@/api/code/mdmrule"; - import { - gridCodeBasicSec, - downOrderNum, - upOrderNum, - deleteData, - editSave, + import { + gridCodeBasicSec, + downOrderNum, + upOrderNum, + deleteData, + editSave, cloneCodeBasic, addSave, refDataGridClassifySec, } from "@/api/code/codebasic"; - import { treeTopCodeClassify, listClassifyLinkAttr } from "@/api/code/codeclassify"; + import { listClassifyLinkAttr } from "@/api/code/codeclassify"; import { gridCodeFixedValue,addSaveCodeFixedValue,deleteCodeFixedValue,editCodeFixedValue,saveOrder } from "@/api/code/codeFixedValue"; import { treeCodeClassifyValue,addSaveCodeClassifyValue,editCodeClassifyValue,deleteCodeClassifyValue,saveCodeClassifyValueOrder } from "@/api/code/codeClassifyValue"; import { getDictionary } from "@/api/omd/enum"; import optionBasic from "@/const/code/codebasic"; import cloneOption from "@/const/code/cloneOption"; import cloneBasicOption from "@/const/code/cloneBasicDialogOption"; - import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption.js"; + import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption"; import optionRule from "@/const/code/mdmrule"; import attrOption from "@/const/code/selectAttrOptionDialog"; import treeOption from "@/const/code/classifyTreeOptionDialog"; import classisyValueTreeOption from "@/const/code/classisyValueTreeDialog"; import parentClassifyParentOption from "@/const/code/parentClassifyParentOptionDialog"; - import referBtmOption from "@/const/code/referBtmDialog"; import fixedValueOption from "@/const/code/fixedValueMgrDialog"; import {mapGetters} from "vuex"; - import func from "@/util/func"; + import {getByRoleUserList} from "@/api/system/user"; + export default { data() { return { @@ -833,6 +880,10 @@ cloneBasicOption: cloneBasicOption, cloneCodeRuleOption: cloneCodeRuleOption, selectionOtherCloneCodeBasicList: [], // 褰撳墠閫変腑鐨勫熀纭�鐮佹 + /** 杞Щ鎵�鏈夎�呭璇濇 */ + escapeOwnerVisible: false, + ruleAdminUserList: [], //瑙勫垯绠$悊鍛樺垪琛� + ruleOwner: '', // 褰撳墠瑕佽浆绉荤粰鍝釜瑙勫垯绠$悊鍛樼殑ID /*浣跨敤鑼冨洿瀵硅瘽妗嗘樉绀烘帶鍒�*/ codeRangeSettingBox: false, @@ -882,14 +933,14 @@ /** 鐮佸�肩鐞嗙浉鍏虫暟鎹� */ isShowBasicSecCodeValueMgr: false, //鐮佹鐮佸�肩鐞嗗璇濇 - codefixedsecOrCodeclassifysecOid: '', //瀛樻斁鍩虹鐮佹鐐瑰嚮鐮佸�肩鐞嗘椂鐨勫綋鍓嶈id锛岀敤浜庝繚瀛樼爜鍊兼椂浣跨敤 + codefixedsecOrCodeclassifysec: '', //瀛樻斁鍩虹鐮佹鐐瑰嚮鐮佸�肩鐞嗘椂鐨勫綋鍓嶈id锛岀敤浜庝繚瀛樼爜鍊兼椂浣跨敤 selectedFixedOrCodeclassifyValue: '', //褰撳墠閫変腑鐨勭爜鍊兼暟鎹� //鍥哄畾鐮佹鐮佸�艰〃鍗� codeFixdForm: { codeFixedSecOid: "", description: "", id: "", - }, + }, isShowFixedForm: true, //true鏄剧ず鍥哄畾鐮佹鐮佸�肩鐞嗙晫闈紝false鏄剧ず鍒嗙被鐮佹鐮佸�肩鐞嗙晫闈� fixedValueData: [], //鍥哄畾鐮佹鐮佸�艰〃鏍兼暟鎹� fixedValueOption: fixedValueOption, //琛ㄦ牸閰嶇疆 @@ -905,7 +956,6 @@ }, classisyValueTreeOption: classisyValueTreeOption, //鍒嗙被鐮佹鏍戠浉鍏抽厤缃」 classifyValueTreeData: [], - //currentSelectClsValueTreeData: '', //褰撳墠閫変腑鐨勫垎绫荤爜鍊兼爲鑺傜偣 /* 涓哄睘鎬ч�夊彇鍊肩獥鍙f樉绀烘墦寮�鎺у埗鍙橀噺 */ isShowSelectAttrOption: false, @@ -914,103 +964,107 @@ treeOption: treeOption, currentSelectTreeData: '', //褰撳墠閫変腑鐨勬爲鑺傜偣 /* 涓哄睘鎬ч�夊�煎彸渚ц〃鏍肩浉鍏虫暟鎹� */ - attrOption: attrOption, - selectattrData: [], - selectAttrOptionLoading: false, - selectionChangeAttrList: [], + + selectAttrParams: { + ref: "selectionAttrCrud", + attrOption: attrOption, + selectAttrData: [], + selectAttrOptionLoading: false, + selectionChangeAttrList: [], + selectAttrQeury: {}, + }, + // 灞炴�х爜娈碉紝鍏紡缂栬緫妗嗙粍浠剁殑鏈満鏅樉绀哄彉閲忋�佷笌绯荤粺鍙橀噺 - thisSceneTableData: [ - { - formula: "${}", - desc: "", - } - ], - systemVariableTableData: [ - { - formula: "#CURRENTUSER.OID#", - desc: "褰撳墠鐢ㄦ埛鐨勪富閿�", - }, - { - formula: "#CURRENTUSER.ID#", - desc: "褰撳墠鐢ㄦ埛鐨勮处鎴�", - }, - { - formula: "#CURRENTTIME#", - desc: "褰撳墠鏃堕棿", - }, - { - formula: "#CURRENTDATE#", - desc: "褰撳墠鏃ユ湡", - }, - { - formula: "#CURRENTDATETIME#", - desc: "褰撳墠鏃ユ湡鏃堕棿", - }, - { - formula: "#CURRENTUSER_NAME#", - desc: "褰撳墠鐢ㄦ埛鐨勫鍚�", - }, - { - formula: "#CURRENTUSER.SECRETGRADE#", - desc: "褰撳墠鐢ㄦ埛瀵嗙骇", - }, - { - formula: "#CURRENTUSER.IPSECRET#", - desc: "褰撳墠鐢ㄦ埛鐨処P瀵嗙骇", - }, - { - formula: "#CURRENTUSER.BUSINESSUNIT#", - desc: "褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏�", - }, - { - formula: "#CURRENTUSER.BUSINESSUNITNAME#", - desc: "褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏冨悕绉�", - }, - { - formula: "#CURRENTUSER.GROUPOID#", - desc: "褰撳墠鐢ㄦ埛鐨勯儴闂ㄤ富閿�", - }, - { - formula: "#CURRENTUSER.GROUPNAME#", - desc: "褰撳墠鐢ㄦ埛鎵�灞為儴闂ㄥ悕绉�", - }, - { - formula: "#CURRENTUSER.EMAIL#", - desc: "褰撳墠鐢ㄦ埛閭欢鍦板潃", - }, - { - formula: "#CURRENTUSER.ROLENAME#", - desc: "褰撳墠鐢ㄦ埛鎵�灞炶鑹插悕绉�", - }, - ], + formulaEditorParams: { + thisSceneTableData: [ + { + formula: "${}", + desc: "", + } + ], + systemVariableTableData: [ + { + formula: "#CURRENTUSER.OID#", + desc: "褰撳墠鐢ㄦ埛鐨勪富閿�", + }, + { + formula: "#CURRENTUSER.ID#", + desc: "褰撳墠鐢ㄦ埛鐨勮处鎴�", + }, + { + formula: "#CURRENTTIME#", + desc: "褰撳墠鏃堕棿", + }, + { + formula: "#CURRENTDATE#", + desc: "褰撳墠鏃ユ湡", + }, + { + formula: "#CURRENTDATETIME#", + desc: "褰撳墠鏃ユ湡鏃堕棿", + }, + { + formula: "#CURRENTUSER_NAME#", + desc: "褰撳墠鐢ㄦ埛鐨勫鍚�", + }, + { + formula: "#CURRENTUSER.SECRETGRADE#", + desc: "褰撳墠鐢ㄦ埛瀵嗙骇", + }, + { + formula: "#CURRENTUSER.IPSECRET#", + desc: "褰撳墠鐢ㄦ埛鐨処P瀵嗙骇", + }, + { + formula: "#CURRENTUSER.BUSINESSUNIT#", + desc: "褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏�", + }, + { + formula: "#CURRENTUSER.BUSINESSUNITNAME#", + desc: "褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏冨悕绉�", + }, + { + formula: "#CURRENTUSER.GROUPOID#", + desc: "褰撳墠鐢ㄦ埛鐨勯儴闂ㄤ富閿�", + }, + { + formula: "#CURRENTUSER.GROUPNAME#", + desc: "褰撳墠鐢ㄦ埛鎵�灞為儴闂ㄥ悕绉�", + }, + { + formula: "#CURRENTUSER.EMAIL#", + desc: "褰撳墠鐢ㄦ埛閭欢鍦板潃", + }, + { + formula: "#CURRENTUSER.ROLENAME#", + desc: "褰撳墠鐢ㄦ埛鎵�灞炶鑹插悕绉�", + }, + ], + formulaEditorSettingBox: false, + }, /* 鐖跺垎绫荤爜娈靛璇濇 */ - isShowParentClassifyOption: false, //鐖跺垎绫荤爜娈靛璇濇鏄剧ず鎺у埗 - classifyDialogLoading: true, //琛ㄦ牸鏁版嵁鍔犺浇鎻愮ず - parentClassifyParentOption: parentClassifyParentOption, //琛ㄦ牸閰嶇疆 - parentClassifyData: [], //琛ㄦ牸鏁版嵁 - //鍒嗛〉鍙傛暟閰嶇疆 - parentClassifyDataPage: { - pageSize: 10, - currentPage: 1, - total: 0 + parentClsfyParams: { + ref: 'crudParentClassify', + isShowParentClassifySettingBox: false, //鐖跺垎绫荤爜娈靛璇濇鏄剧ず鎺у埗 + classifyDialogLoading: true, //琛ㄦ牸鏁版嵁鍔犺浇鎻愮ず + parentClassifyParentOption: parentClassifyParentOption, //琛ㄦ牸閰嶇疆 + parentClassifyData: [], //琛ㄦ牸鏁版嵁 + //鍒嗛〉鍙傛暟閰嶇疆 + parentClassifyDataPage: { + pageSize: 10, + currentPage: 1, + total: 0 + }, + parentClassifyQuery: {}, //鏌ヨ鏉′欢 + parentClassifySelectionList: [], //褰撳墠閫変腑琛� }, - parentClassifyQuery: {}, //鏌ヨ鏉′欢 - parentClassifySelectionList: [], //褰撳墠閫変腑琛� - /** 鍙傜収寮曠敤鐨勪笟鍔$被鍨嬪璇濇鐩稿叧鏁版嵁 */ - isShowSelectReferBtmOption: false, //瀵硅瘽妗嗘樉绀烘帶鍒� - referBtmDialogLoading: true, //琛ㄦ牸鏁版嵁鍔犺浇鎻愮ず - referBtmDataPage: { - pageSize: 10, - currentPage: 1, - total: 0 + referBtmDialogParams: { + ref: 'crudReferBtm', + selectReferBtmSettingBox: false, }, - referBtmOption: referBtmOption, //琛ㄦ牸閰嶇疆 - referBtmData: [], //琛ㄦ牸鏁版嵁 - referBtmQuery: {}, //鏌ヨ鏉′欢 - referBtmSelectionList: [], //褰撳墠閫変腑琛� /** 鍩虹鐮佹鏂板琛ㄥ崟 */ form: { @@ -1025,79 +1079,34 @@ componentCodeFlag: false, //鏄惁鍙備笌缂栫爜 pkCodeRule: '', //鎵�灞炵紪鐮佽鍒� }, - // formRules: { - // id: [ - // { required: true, message: '璇疯緭鍏ョ爜娈电紪鍙�', trigger: 'blur' }, - // ], - // name: [ - // { required: true, message: '璇疯緭鍏ョ爜娈靛悕绉�', trigger: 'blur' }, - // ], - // secType: [ - // { required: true, message: '璇烽�変腑鐮佹绫诲瀷', trigger: 'change' }, - // ], - // codeSecLengthType: [ - // { required: true, message: '璇烽�夋嫨鐮佹闀垮害绫诲瀷', trigger: 'change' }, - // ], - // codeSecLength: [ - // { required: true, message: '璇疯緭鍏ョ爜娈电殑闀垮害', trigger: ['blur', 'change']}, - // { type: 'number', message: '鐮佹鐨勯暱搴﹀繀椤讳负鏁板瓧鍊�',trigger: ['blur', 'change']} - // ], - // referAttributeName: [ - // { required: true, message: '璇烽�夋嫨灞炴��', trigger: 'change' }, - // ], - // serialStart: [ - // { type: 'number', message: '娴佹按鍙风殑璧峰鍊煎繀椤讳负鏁板瓧鍊�',trigger: ['blur', 'change']} - // ], - // serialStep: [ - // { type: 'number', message: '娴佹按鐨勬闀垮繀椤讳负鏁板瓧鍊�',trigger: ['blur', 'change']} - // ], - // codeFillType: [ - // { required: true, message: '璇烽�夋嫨缂栫爜琛ヤ綅鏂瑰紡', trigger: ['blur', 'change']}, - // ], - // // 璁剧疆琛ヤ綅鏃剁殑瀛楃锛岄渶瑕佽嚜瀹氫箟鏉ュ仛鍒ゆ柇 - // codeFillSeparatorSelect: [ - // { validator: validateCodeFill, trigger: ['blur', 'change'] }, - // ], - // codeFillLength: [ - // { required: true, message: '璇疯緭鍏ュ~鍏呴暱搴�', trigger: ['blur', 'change'] }, - // { type: 'number', message: '濉厖闀垮害蹇呴』涓烘暟瀛楀��',trigger: ['blur', 'change']} - // ], - // codeFillLimit: [ - // { required: true, message: '璇疯緭鍏ユ祦姘翠笂闄�', trigger: ['blur', 'change'] }, - // { type: 'number', message: '娴佹按涓婇檺蹇呴』涓烘暟瀛楀��',trigger: ['blur', 'change']} - // ], - // codeLevelType: [ - // { required: true, message: '璇烽�夋嫨灞傜骇绫诲瀷', trigger: 'change' }, - // ], - // codeLevelValue: [ - // { required: false, type: 'number', message: '灞傜骇鐨勫�煎繀椤讳负鏁板瓧鍊�', trigger: 'change'} - // ], - // valueCutType: [ - // { required: true, message: '璇烽�夋嫨瀛楃鎴彇绫诲瀷', trigger: 'change' }, - // ], - // referBtmId: [ - // { required: true, message: '璇烽�夋嫨鍙傜収搴旂敤鐨勪笟鍔$被鍨�', trigger: 'change' }, - // ], - // referConfig: [ - // { required: true, message: '璇烽�夋嫨鍙傜収閰嶇疆', trigger: 'change' }, - // ], - // codeDateFormatStr: [ - // { required: true, message: '璇疯緭鍏ユ棩鏈熸牸寮�', trigger: ['blur', 'change'] }, - // ], - // }, //鏋氫妇鍜屽彲杈撳彲閫夋煡璇� - sectypeList:[], //鐮佹绫诲瀷 - codeSecLengthType:[], //鐮佹闀垮害绫诲瀷 - codeFillType:[], //缂栫爜琛ヤ綅鏂瑰紡 - codeFillSeparator:[], //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夊唴瀹� - codeLevelType:[], //灞傜骇绫诲瀷 - codeCutType:[], //瀛楃鎴彇绫诲瀷 - codeGetValueType:[], //鍙栧�肩被鍨� + enumParam: { + secTypeList:[], //鐮佹绫诲瀷 + codeSecLengthType:[], //鐮佹闀垮害绫诲瀷 + codeFillType:[], //缂栫爜琛ヤ綅鏂瑰紡 + codeFillSeparator:[], //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夊唴瀹� + codeLevelType:[], //灞傜骇绫诲瀷 + codeCutType:[], //瀛楃鎴彇绫诲瀷 + codeGetValueType:[], //鍙栧�肩被鍨� + }, //琛ㄥ崟鍏冪礌鏍囩瀹藉害 leftFormLabelWidth: '110px', rightFormLabelWidth: '150px', + + // 楂樼骇鏌ヨ瀵硅瘽妗嗙浉鍏冲弬鏁� + advancedQueryParam: { + ref: 'advancedQuery', + advancedQuerySettingBox: false, + options: [], + currentOpen: '', //褰撳墠鎵撳紑楂樼骇鏌ヨ鐨勭獥鍙f槸 + //conditionMapParams: {}, + }, + + //寮曠敤鐮佹涓弬鐓ч厤缃粍浠剁浉鍏冲弬鏁� + referConfigOption: {}, + referConfigVisble: false, }; }, @@ -1112,221 +1121,229 @@ }; }, }, + watch:{ + + }, + mounted(){ + this.loadTotalEnum(); + }, + // 瑙e喅琛ㄦ牸閿欒闂 + activated () { + this.$nextTick(() => { + this.$refs.crud.doLayout(); + this.$refs.crudBasic.doLayout(); + }) + }, methods: { + /** 杞Щ瑙勫垯鎵�鏈夎�呭璇濇 */ + escapeOwner(){ + if (this.selectionList.length === 0) { + this.$message.warning("璇烽�夋嫨涓�鏉$紪鐮佽鍒欙紒"); + return; + } + this.escapeOwnerVisible = true; + getByRoleUserList("瑙勫垯绠$悊鍛�").then(res=>{ + this.ruleAdminUserList = res.data.data; + }); + }, + /** 纭杞Щ鎵�鏈夎�� */ + escapeOwnerConfirm(){ + if(!this.ruleOwner){ + this.$message.warning("璇烽�夋嫨鎮ㄨ杞Щ鐨勮鍒欑鐞嗗憳锛�"); + return; + } + this.selectionList[0].owner = this.ruleOwner; + let data = this.selectionList[0]; + update(data).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "瑙勫垯杞Щ鎴愬姛!" + }); + this.escapeOwnerVisible = false; + }, error => { + console.log(error); + }); + }, + + /** 楂樼骇鏌ヨ瀵硅瘽妗嗙粍浠�,缁勪欢杩斿洖鐨勫�兼槸condtionMap[field]褰㈠紡鐨勬煡璇㈡潯浠讹紝淇濈暀浜嗗拰涔嬪墠涓�鏍风殑鏂瑰紡 */ + echoSeniorContionMap(conditionMaps){ + //console.log(conditionMaps); + if(JSON.stringify(conditionMaps)!='{}'){ + if(this.advancedQueryParam.currentOpen =='codeRule'){ + this.query = conditionMaps; + this.onLoad(this.page); + }else{ + this.sendGridCodeBasicSec(conditionMaps,true); + } + //console.log(conditionMaps); + } + }, /* 鍏紡缂栬緫妗嗗唴瀹规敼鍙�,瀛愮粍浠剁紪杈戝畬鍏紡涔嬪悗鍐呭鍥炴樉鏃惰皟鐢� */ updateFormulaContent(content){ this.form.getValueClass = content; }, - /* 寮曠敤鐮佹鍙傜収閰嶇疆,瀛愮粍浠跺~瀹屽弬鐓ч厤缃箣鍚庡唴瀹瑰洖鏄炬椂璋冪敤 */ - echoReferConfig(content){ - this.form.referBtmId = content.referType; - this.form.referBtmName = content.referTypeName; + setReferConfigValue(content){ + // console.log(content.referTypeName); + this.form.referBtmId = content.referType || ''; + this.form.referBtmName = content.referTypeName || content.referType; //杞崲鎴怞SON瀛楃涓茶繘琛岀埗缁勪欢鍥炴樉 let submitFormJson = JSON.stringify(content); - this.form.referConfig = submitFormJson; + this.form.referConfig = submitFormJson || ''; }, - - /** 涓哄弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷閫夊彇鍊硷紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ - // 琛ㄦ牸鏁版嵁鍒锋柊鎸夐挳 - referBtmDataChange(){ - this.referBtmOnLoad(this.referBtmDataPage, this.referBtmQuery); - }, - saveSelectedreferBtm(){ - if(this.referBtmSelectionList.length != 1){ - this.$message.warning("鍙兘閫夋嫨涓�鏉℃暟鎹�!"); - return false; - } - //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉 - this.form.referBtmId = this.referBtmSelectionList[0].id; - this.form.referBtmName = this.referBtmSelectionList[0].name; - //娓呯┖褰撳墠閫変腑鐨勮 - this.referBtmSelectionClear(); - this.isShowSelectReferBtmOption = false; - }, - referBtmSearchReset() { - this.referBtmQuery = {}; - this.referBtmOnLoad(this.referBtmDataPage); - }, - referBtmSearchChange(params, done) { - this.referBtmQuery = params; - this.referBtmDataPage.currentPage = 1; - this.referBtmOnLoad(this.page, params); - done(); - }, - // 鍗曞嚮閫変腑琛ㄦ牸琛屾椂瑙﹀彂 - referBtmRowClick(row){ - this.$refs.crudReferBtm.toggleSelection(); - this.referBtmSelectionList = row; - this.$refs.crudReferBtm.setCurrentRow(row); - this.$refs.crudReferBtm.toggleRowSelection(row); //閫変腑褰撳墠琛� - }, - referBtmSelectionChange(list) { - this.referBtmSelectionList = list; - this.$refs.crudReferBtm.setCurrentRow(this.referBtmSelectionList[list.length-1]); - }, - referBtmSelectionClear() { - this.referBtmSelectionList = []; - this.$refs.crudReferBtm.toggleSelection(); - }, - referBtmCurrentChange(currentPage){ - this.referBtmDataPage.currentPage = currentPage; - }, - referBtmSizeChange(pageSize){ - this.referBtmDataPage.pageSize = pageSize; - }, - refreshReferBtmDataChange() { - this.referBtmOnLoad(this.referBtmDataPage, this.referBtmQuery); - }, - //鍔犺浇涓弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷鐨勬暟鎹� - referBtmOnLoad(page, params = {}) { - //琛ㄦ牸琛岄敊浣嶉棶棰� - this.$nextTick(() => { - this.$refs.crudReferBtm.doLayout(); - }) - this.referBtmDialogLoading = true; - let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid; - Object.assign(params,{pkCodeRule:oid}) - //鎺ュ彛杩樻湭鎻愪緵锛屽緟鏇存敼 - refDataGridClassifySec(page.currentPage, page.pageSize, Object.assign(params, this.parentClassifyQuery)).then(res => { - //console.log(res.data); - const data = res.data.data; - this.referBtmDataPage.total = data.total; - this.referBtmData = data.records; - this.referBtmDialogLoading = false; - this.referBtmSelectionClear(); - }); + /** 寮曠敤鐮佹涓恒�愬弬鐓у紩鐢ㄧ殑涓氬姟绫诲瀷銆戦�夊彇鍊间箣鍚庣殑鍐呭鍥炴樉鏃惰皟鐢� */ + echoReferBtmType(content){ + // 瀹炵幇鍥炴樉 + this.form.referBtmId = content.id || ''; + this.form.referBtmName = content.name || content.id; }, - - /** 鐖跺垎绫婚�夋嫨瀵硅瘽妗嗭紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ - // 淇濆瓨褰撳墠鐖跺垎绫荤爜娈电殑閫変腑琛岋紝骞惰繘琛屽洖鏄� + /** 鐖跺垎绫婚�夋嫨瀵硅瘽妗嗭紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ + /** 淇濆瓨褰撳墠鐖跺垎绫荤爜娈电殑閫変腑琛岋紝骞惰繘琛屽洖鏄� */ saveSelectedParentClassify(){ - //console.log(this.parentClassifySelectionList.length); - if(this.parentClassifySelectionList.length != 1){ + //console.log(this.parentClsfyParams.parentClassifySelectionList.length); + if(this.parentClsfyParams.parentClassifySelectionList.length != 1){ this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�!"); return false; } //鍙傛暟鍊硷紝瀹炵幇鍥炴樉 - this.form.parentClassifySecOid = this.parentClassifySelectionList[0].oid; - this.form.parentClassifySecText = this.parentClassifySelectionList[0].name; + this.form.parentClassifySecOid = this.parentClsfyParams.parentClassifySelectionList[0].oid; + this.form.parentClassifySecText = this.parentClsfyParams.parentClassifySelectionList[0].name; //娓呯┖褰撳墠閫変腑鐨勮 this.parentClassifySelectionClear(); - this.isShowParentClassifyOption = false; + this.parentClsfyParams.isShowParentClassifySettingBox = false; }, parentClassifySearchReset() { - this.parentClassifyQuery = {}; - this.parentClassifyOnLoad(this.parentClassifyDataPage); + this.parentClsfyParams.parentClassifyQuery = {}; + this.parentClassifyOnLoad(this.parentClsfyParams.parentClassifyDataPage); }, parentClassifySearchChange(params, done) { - this.parentClassifyQuery = params; - this.parentClassifyDataPage.currentPage = 1; + this.parentClsfyParams.parentClassifyQuery = params; + this.parentClsfyParams.parentClassifyDataPage.currentPage = 1; this.parentClassifyOnLoad(this.page, params); done(); }, parentClassifyRowClick(row){ - this.$refs.crudParentClassify.toggleSelection(); - this.parentClassifySelectionList = row; - this.$refs.crudParentClassify.setCurrentRow(row); - this.$refs.crudParentClassify.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.$refs[this.parentClsfyParams.ref].toggleSelection(); + this.parentClsfyParams.parentClassifySelectionList = row; + this.$refs[this.parentClsfyParams.ref].setCurrentRow(row); + this.$refs[this.parentClsfyParams.ref].toggleRowSelection(row); //閫変腑褰撳墠琛� }, parentClassifySelectionChange(list) { - this.parentClassifySelectionList = list; - this.$refs.crudParentClassify.setCurrentRow(this.parentClassifySelectionList[list.length-1]); + this.parentClsfyParams.parentClassifySelectionList = list; + this.$refs[this.parentClsfyParams.ref].setCurrentRow(this.parentClsfyParams.parentClassifySelectionList[list.length-1]); }, parentClassifySelectionClear() { - this.parentClassifySelectionList = []; - this.$refs.crudParentClassify.toggleSelection(); + this.parentClsfyParams.parentClassifySelectionList = []; + this.$refs[this.parentClsfyParams.ref].toggleSelection(); }, parentClassifyCurrentChange(currentPage){ - this.parentClassifyDataPage.currentPage = currentPage; + this.parentClsfyParams.parentClassifyDataPage.currentPage = currentPage; }, parentClassifySizeChange(pageSize){ - this.parentClassifyDataPage.pageSize = pageSize; + this.parentClsfyParams.parentClassifyDataPage.pageSize = pageSize; }, refreshParentClassifyDataChange() { - this.parentClassifyOnLoad(this.parentClassifyDataPage, this.parentClassifyQuery); + this.parentClassifyOnLoad(this.parentClsfyParams.parentClassifyDataPage, this.parentClsfyParams.parentClassifyQuery); }, parentClassifyOnLoad(page, params = {}) { - this.classifyDialogLoading = true; + let parentClsParam = this.parentClsfyParams; + parentClsParam.classifyDialogLoading = true; let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid; - Object.assign(params,{pkCodeRule:oid}) - refDataGridClassifySec(page.currentPage, page.pageSize, Object.assign(params, this.parentClassifyQuery)).then(res => { + let conditionMaps = {}; + conditionMaps['conditionMap[pkCodeRule]'] = oid; + refDataGridClassifySec( + page.currentPage, + page.pageSize, + conditionMaps + ).then(res => { //console.log(res.data); const data = res.data.data; - this.parentClassifyDataPage.total = data.total; - this.parentClassifyData = data.records; - this.classifyDialogLoading = false; + parentClsParam.parentClassifyDataPage.total = data.total; + parentClsParam.parentClassifyData = data.records; + parentClsParam.classifyDialogLoading = false; this.parentClassifySelectionClear(); }); }, - - /** 鎵撳紑灞炴�ч�夊彇鍊硷紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ - // 鑾峰彇褰撳墠琚�変腑鏍戣妭鐐圭殑oid + + /** 鎵撳紑灞炴�ч�夊彇鍊硷紝绗簩灞傚祵濂楀璇濇锛屽強鍏剁浉鍏虫柟娉� */ + /** 鑾峰彇褰撳墠琚�変腑鏍戣妭鐐圭殑oid */ nodeClick(data) { this.currentSelectTreeData = data; this.loadlistClassifyLinkAttr() }, - // 鍔犺浇鍒嗙被杩炴帴灞炴�ц〃鏍兼暟鎹� - loadlistClassifyLinkAttr(condition) { - //杩欏効杩橀渶瑕佸畬鍠� - this.selectAttrOptionLoading = true; - listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{ - //console.log(res.data.data); - //閫犲亣鏁版嵁 - let dataInfo =[ - {"id":"address","name":"浼氳瀹ゅ湴鍧�","oid":"058D840D-1010-A7DE-7C52-B39C03CE89C1","attrLength":"150","description":"","attributeDataTypeText":"瀛楃涓�"}, - {"id":"businesslicensetype","name":"钀ヤ笟鎵х収绫诲瀷","oid":"BDAC6D3E-1827-35A0-F3CA-0E58A43F6A07","attrLength":"255","description":"钀ヤ笟鎵х収绫诲瀷","attributeDataTypeText":"瀛楃涓�"}, - {"id":"certificatenumber","name":"淇濆瘑璇佺紪鍙�","oid":"E2BC8332-A721-3713-26C3-C9F6340C2C1D","attrLength":"255","description":"淇濆瘑璇佺紪鍙�","attributeDataTypeText":"瀛楃涓�"}, - ] - this.selectattrData = dataInfo; - this.selectAttrOptionLoading = false; + /** 鍔犺浇鍒嗙被杩炴帴灞炴�ц〃鏍兼暟鎹� */ + loadlistClassifyLinkAttr() { + let attrParam = this.selectAttrParams; + //console.log(this.currentSelectTreeData); + this.selectAttrParams.selectAttrOptionLoading = true; + let conditionMaps = {}; + if(attrParam.selectAttrQeury){ + Object.keys(attrParam.selectAttrQeury).forEach(key=>{ + conditionMaps['conditionMap['+key+']'] = attrParam.selectAttrQeury[key].trim(); + }); + } + conditionMaps['conditionMap[codeClassifyOid]'] = this.currentSelectTreeData.oid; + conditionMaps['conditionMap[btmTypeOid]'] = this.currentSelectTreeData.btmTypeOid; + listClassifyLinkAttr(conditionMaps).then(res=>{ + const data = res.data; + this.$nextTick(() => { + this.$refs[attrParam.ref].doLayout() + }); + //console.log(data.data); + this.selectAttrParams.selectAttrData = data.data; + this.selectAttrParams.selectAttrOptionLoading = false; + // 灏嗘悳绱㈡鍐呭缃┖ + this.selectAttrParams.selectAttrQeury = {}; }) }, - // 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢 - selectAttrOptionSearchChange(params, done) { - this.query = params; + /** 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢 */ + selectAttrSearchChange(params, done) { + this.selectAttrParams.selectAttrQeury = params; //console.log(params); //杩欏効闇�瑕佹敼 - this.loadlistClassifyLinkAttr(Object.assign(params,{'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid})); + this.loadlistClassifyLinkAttr(); done(); }, - // 涓哄睘鎬ч�夊�肩晫闈紝鍗曞嚮琛ㄦ牸琛屾椂瑙﹀彂璇ヤ簨浠� + /** 涓哄睘鎬ч�夊�肩晫闈紝鍗曞嚮琛ㄦ牸琛屾椂瑙﹀彂璇ヤ簨浠� */ selectionAttrRowClick(row){ - this.$refs.selectionAttrCrud.toggleSelection(); - this.selectionChangeAttrList = row; - this.$refs.selectionAttrCrud.setCurrentRow(row); - this.$refs.selectionAttrCrud.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.$refs[this.selectAttrParams.ref].toggleSelection(); + this.selectAttrParams.selectionChangeAttrList = row; + this.$refs[this.selectAttrParams.ref].setCurrentRow(row); + this.$refs[this.selectAttrParams.ref].toggleRowSelection(row); //閫変腑褰撳墠琛� }, - // 灞炴�у彇鍊煎綋鍓嶉�変腑琛屽彂鐢熷彉鍖栨椂瑙﹀彂 + /** 灞炴�у彇鍊煎綋鍓嶉�変腑琛屽彂鐢熷彉鍖栨椂瑙﹀彂 */ selectionChangeAttr(list){ - this.selectionChangeAttrList = list; - this.$refs.selectionAttrCrud.setCurrentRow(this.selectionChangeAttrList[list.length-1]); + this.selectAttrParams.selectionChangeAttrList = list; + this.$refs[this.selectAttrParams.ref].setCurrentRow(this.selectAttrParams.selectionChangeAttrList[list.length-1]); }, - // 閲嶇疆浣嶅睘鎬ч�夊彇鍊艰〃鏍肩殑鎼滅储妗嗕箣鍚庣殑鍥炶皟 + /** 閲嶇疆浣嶅睘鎬ч�夊彇鍊艰〃鏍肩殑鎼滅储妗嗕箣鍚庣殑鍥炶皟 */ searchAttrReset() { + this.selectAttrParams.selectAttrQeury = {}; this.loadlistClassifyLinkAttr() }, - // 涓哄睘鎬ч�夊彇鍊间箣鍚庣殑鍥炴樉 + /** 涓哄睘鎬ч�夊彇鍊间箣鍚庣殑鍥炴樉 */ selectedListClassifyLinkAttr(){ - if(this.selectionChangeAttrList.length != 1){ + if(this.selectAttrParams.selectionChangeAttrList.length != 1){ this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�!"); return false; } + const attr = this.selectAttrParams.selectionChangeAttrList[0]; //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉 this.form = Object.assign({}, this.form, { - referAttributeId:this.selectionChangeAttrList[0].id, - referAttributeName:this.selectionChangeAttrList[0].name, - referCodeClassifyOid: this.currentSelectTreeData.key, - referCodeClassifyOidName: this.currentSelectTreeData.title, + referAttributeId: attr.id || '', + referAttributeName: attr.name || attr.id, + referCodeClassifyOid: this.currentSelectTreeData.key || '', + referCodeClassifyOidName: this.currentSelectTreeData.title || '', }) this.isShowSelectAttrOption = false; }, - + /** 鍩虹鐮佹琛ㄤ腑鐨勭爜鍊肩鐞嗙殑鐩稿叧鏂规硶 */ - // 鐮佸�肩鐞嗗脊绐楁帶鍒� + /** 鐮佸�肩鐞嗗脊绐楁帶鍒�*/ openBasicSecCodeValueMgr(row){ //褰撳墠涓哄浐瀹氱爜娈电爜鍊肩鐞嗙爜鍊肩鐞� if(row.secType === "codefixedsec"){ @@ -1337,10 +1354,10 @@ this.isShowFixedForm = false; this.loadClassifyValueData(row); } - this.codefixedsecOrCodeclassifysecOid = row.oid; + this.codefixedsecOrCodeclassifysec = row; this.isShowBasicSecCodeValueMgr = true; }, - //鍔犺浇鍥哄畾鐮佹鐮佸�艰〃鏁版嵁 + /** 鍔犺浇鍥哄畾鐮佹鐮佸�艰〃鏁版嵁*/ loadFixedValueTableData(row){ this.fixedValueOptionLoading = true; gridCodeFixedValue(1, -1, {"codeFixedSecOid":row.oid}).then(res=>{ @@ -1349,7 +1366,7 @@ this.fixedValueOptionLoading = false; }) }, - //鍗曞嚮鍥哄畾鐮佹鐨勭爜鍊艰〃涓鏃惰Е鍙戠殑浜嬩欢 + /** 鍗曞嚮鍥哄畾鐮佹鐨勭爜鍊艰〃涓鏃惰Е鍙戠殑浜嬩欢*/ selectedCodeValueRow(row){ //console.log(row); this.selectedFixedOrCodeclassifyValue = row; @@ -1357,20 +1374,15 @@ this.codeFixdForm.description = row.description; this.codeFixdForm.codeFixedSecOid = row.codefixedsecoid; }, - //鏂板鐮佸�� + /** 鏂板鐮佸��*/ addCodeSecValue(condition){ if(condition === "codefixedsec"){ - if(this.codeFixdForm.id.trim() == ''){ - this.$message.warning("鐮佸�间笉鑳戒负绌猴紒"); + if(!this.tipsCodeSecValueMessage(this.codeFixdForm.id)){ return; } - if(this.codeFixdForm.id.trim().length >= 12 ){ - this.$message.warning("鐮佸�奸暱搴︿笉鑳藉ぇ浜�12锛�"); - return; - } - this.codeFixdForm.codeFixedSecOid = this.codefixedsecOrCodeclassifysecOid; + this.codeFixdForm.codeFixedSecOid = this.codefixedsecOrCodeclassifysec.oid; addSaveCodeFixedValue(this.codeFixdForm).then(() => { - this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysecOid}); + this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysec.oid}); this.clearFixedOrClassifyForm('codefixedsec'); this.$message({ type: "success", @@ -1380,10 +1392,13 @@ window.console.log(error); }); }else { - this.codeClassifyForm.codeClassifySecOid = this.codefixedsecOrCodeclassifysecOid; - console.log(this.codeClassifyForm); + if(!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)){ + return; + } + this.codeClassifyForm.codeClassifySecOid = this.codefixedsecOrCodeclassifysec.oid; + // console.log(this.codeClassifyForm); addSaveCodeClassifyValue(this.codeClassifyForm).then(() => { - this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid}); + this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysec.oid}); this.clearFixedOrClassifyForm('codeclassifyvaluesec'); this.$message({ type: "success", @@ -1397,7 +1412,7 @@ }); } }, - //娓呯┖鐮佸�艰〃鍗� + /** 娓呯┖鐮佸�艰〃鍗� */ clearFixedOrClassifyForm(condition){ //鐐瑰嚮鍙栨秷鏃舵竻绌鸿〃鍗曚笌褰撳墠閫変腑鐨勭爜鍊硷紝骞剁鐢ㄦ寜閽� this.selectedFixedOrCodeclassifyValue = ''; @@ -1413,19 +1428,34 @@ this.codeClassifyForm = this.$options.data().codeClassifyForm; } }, - //淇敼鐮佸�� + /** 娣诲姞鎴栦慨鏀圭爜鍊间箣鍓嶅鐮佸�奸暱搴︽牴鎹鍒欒繘琛屾牎楠� */ + tipsCodeSecValueMessage(id){ + if(id.trim() == ''){ + this.$message.warning("鐮佸�间笉鑳戒负绌猴紒"); + return false; + } + if(id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength ){ + this.$message.warning("鐮佸�奸暱搴︿笉鑳藉ぇ浜�" + this.codefixedsecOrCodeclassifysec.codeSecLength); + return false; + } + return true; + }, + /** 淇敼鐮佸�� */ editCodeSecValue(condition){ if(condition=='codefixedsec'){ - //浠ュ墠鏄洿鎺ユ妸褰撳墠閫変腑琛岀殑鎵�鏈夋暟鎹兘杩涜鎻愪氦锛屼絾鍏跺疄鍙渶瑕佷紶杈撲竴浜涙瘮瑕佸弬鏁板嵆鍙紝杩欏効鍋氫簡淇敼锛岄渶瑕佺┛鍏朵粬鍙傛暟鐨勮鑷娣诲姞 + if(!this.tipsCodeSecValueMessage(this.codeFixdForm.id)){ + return; + } + //浠ュ墠鏄洿鎺ユ妸褰撳墠閫変腑琛岀殑鎵�鏈夋暟鎹兘杩涜鎻愪氦锛屼絾鍏跺疄鍙渶瑕佷紶杈撲竴浜涘繀瑕佸弬鏁板嵆鍙紝杩欏効鍋氫簡淇敼锛岄渶瑕佷紶鍏朵粬鍙傛暟鐨勮鑷娣诲姞 let editData = { - "oid": this.selectedFixedOrCodeclassifyValue.oid, - "ts": new Date().getTime(), - "description": this.codeFixdForm.description, - "id": this.codeFixdForm.id, - "codeFixedSecOid": this.selectedFixedOrCodeclassifyValue.codefixedsecoid + "oid": this.selectedFixedOrCodeclassifyValue.oid, + "ts": new Date().getTime(), + "description": this.codeFixdForm.description, + "id": this.codeFixdForm.id, + "codeFixedSecOid": this.selectedFixedOrCodeclassifyValue.codefixedsecoid } editCodeFixedValue(editData).then(() => { - this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysecOid}) + this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysec.oid}) this.$message({ type: "success", message: "鎿嶄綔鎴愬姛!" @@ -1434,9 +1464,17 @@ window.console.log(error); }); }else { + if(!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)){ + return; + } this.codeClassifyForm.oid = this.selectedFixedOrCodeclassifyValue.attributes.oid; + // 鍒嗙被鐮佹锛屽瓙鍒嗙被鍜岀埗鍒嗙被涔嬮棿涓嶈兘鐩镐簰鏇存敼 + if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysec.oid,this.codeClassifyForm.codeClassifySecOid)){ + return; + } + this.$delete(this.codeClassifyForm,"parentClassifyValueOid"); editCodeClassifyValue(this.codeClassifyForm).then(() => { - this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid}) + this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysec.oid}) this.$message({ type: "success", message: "鎿嶄綔鎴愬姛!" @@ -1445,10 +1483,10 @@ window.console.log(error); }); } - + }, - //鍒犻櫎鐮佸�� - delCodeSecValue(condition){ + /** 鍒犻櫎鐮佸�� */ + delCodeSecValue(condition){ //鍥哄畾鐮佹鐮佸�煎垹闄� if(condition == 'codefixedsec'){ //console.log(this.selectedFixedOrCodeclassifyValue.oid); @@ -1463,7 +1501,7 @@ }) .then(() => { this.selectedFixedOrCodeclassifyValue = ''; - this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysecOid}) + this.loadFixedValueTableData({"oid":this.codefixedsecOrCodeclassifysec.oid}) this.clearFixedOrClassifyForm('codefixedsec'); this.$message({ type: "success", @@ -1471,6 +1509,9 @@ }); }); }else{ + if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysec.oid,this.codeClassifyForm.codeClassifySecOid)){ + return; + } //鍒嗙被鐮佹鐮佸�煎垹闄� this.$confirm("鏄惁鍒犻櫎杩欐潯鏁版嵁锛熷鏋滆寮曠敤灏嗕笉鑳借鍒犻櫎锛�", { confirmButtonText: "纭畾", @@ -1483,17 +1524,16 @@ }) .then(() => { this.selectedFixedOrCodeclassifyValue = ''; - this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid}) + this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysec.oid}) this.clearFixedOrClassifyForm('codeclassifyvalue'); this.$message({ type: "success", message: "鎿嶄綔鎴愬姛!" }); }); - } - + } }, - //瀵瑰浐瀹氱爜鍊艰〃杩涜锛氫笂绉汇�佷笅绉汇�佺Щ闄ゆ搷浣� + /** 瀵瑰浐瀹氱爜鍊艰〃杩涜锛氫笂绉汇�佷笅绉汇�佺Щ闄ゆ搷浣�*/ codeFixedValueOpetion(condition,row){ //console.log(this.fixedValueData[row.$index].orderNum); const index = row.$index; @@ -1529,12 +1569,15 @@ } //console.log(this.fixedValueData); }, - //瀵瑰垎绫荤爜鍊艰〃杩涜锛氫笂绉汇�佷笅绉汇�佺Щ闄ゆ搷浣� + /** 瀵瑰垎绫荤爜鍊艰〃杩涜锛氫笂绉汇�佷笅绉汇�佺Щ闄ゆ搷浣�*/ codeClassifyValueOpetion(condition){ + if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysec.oid,this.codeClassifyForm.codeClassifySecOid)){ + return; + } //姝ゅ娑夊強鍒版繁娴呮嫹璐濋棶棰橈紝浣嗘槸鎵ц涓婁笅绉讳繚瀛樻搷浣滀箣鍚庝細閲嶆柊鍔犺浇treedata锛屾墍浠ュ奖鍝嶄笉澶� let currentTreeList = this.getCodeClassifyValueTreeData(); let saveData = []; - console.log(currentTreeList.treeList); + // console.log(currentTreeList.treeList); if(condition == 'up'){ if(currentTreeList.index-1>=0){ // 璋冩暣椤哄簭 @@ -1552,12 +1595,10 @@ saveData[0].orderNum = parseInt(saveData[0].orderNum)+1; saveData[1].orderNum = parseInt(saveData[1].orderNum)-1; this.saveCodeFixedOrClassifyValueOption('classifyValue',saveData); - } + } } - console.log(saveData); - console.log(this.classifyValueTreeData); }, - //閫変腑琚皟鏁撮『搴忕殑涓や釜鏍戠殑鑺傜偣 + /** 閫変腑琚皟鏁撮『搴忕殑涓や釜鏍戠殑鑺傜偣*/ getCodeClassifyValueTreeData(){ const currentNodeTreeData = this.selectedFixedOrCodeclassifyValue; /**鑰冭檻鍑犵鎯呭喌锛岀涓�绉嶅綋鍓嶄笂绉粅涓嬬Щ鎿嶄綔宸茬粡鏄竟鐣岋紝 @@ -1565,10 +1606,10 @@ */ //璇存槑鏄牴鑺傜偣锛岀洿鎺ユ壘鍐嶅垽鏂槸鍚︽槸杈圭晫鍊� if(currentNodeTreeData.parentId.trim() == ''){ - return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.oid,true); + return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.oid,true); }else{ //璇存槑涓嶆槸鏍硅妭鐐�,鍏堟壘鍒扮埗鑺傜偣鍐嶆壘鍒板瓙鑺傜偣,鍒ゆ柇鏄惁鏄竟鐣屽�� - return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.parentId,false); + return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.parentId,false); } }, /** @@ -1593,12 +1634,12 @@ } } }, - //涓婄Щ涓嬬Щ绛夋搷浣滅殑淇濆瓨 - saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){ + /** 涓婄Щ涓嬬Щ绛夋搷浣滅殑淇濆瓨*/ + async saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){ //淇濆瓨瀵瑰浐瀹氱爜娈电爜鍊肩殑涓婄Щ涓嬬Щ绉诲嚭绛夋搷浣� if(condition == "fixedValue"){ let data = { - "codeFixedSecOid": this.codefixedsecOrCodeclassifysecOid, + "codeFixedSecOid": this.codefixedsecOrCodeclassifysec.oid, "dtoList": JSON.stringify(this.fixedValueData), } saveOrder(data).then(() => { @@ -1613,8 +1654,8 @@ }); }else { //淇濆瓨瀵瑰垎绫荤爜鍊肩爜娈电爜鍊肩殑涓婄Щ涓嬬Щ绉诲嚭绛夋搷浣� - saveCodeClassifyValueOrder({ - "codeClassifySecOid": this.codefixedsecOrCodeclassifysecOid, + await saveCodeClassifyValueOrder({ + "codeClassifySecOid": this.codefixedsecOrCodeclassifysec.oid, "dtoList": JSON.stringify(editOrderNumdata), }).then(() => { this.$message({ @@ -1624,11 +1665,11 @@ }, error => { window.console.log(error); }); - this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid}); + this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysec.oid}); } - + }, - //鍒嗙被鐮佸�兼爲data鍔犺浇 + /** 鍒嗙被鐮佸�兼爲data鍔犺浇*/ loadClassifyValueData(row){ //console.log(row); let condtionData = { @@ -1644,7 +1685,7 @@ //console.log(res.data); }); }, - //鍒嗙被鐮佸�兼爲鍗曞嚮鏃惰Е鍙戠殑浜嬩欢 + /** 鍒嗙被鐮佸�兼爲鍗曞嚮鏃惰Е鍙戠殑浜嬩欢*/ classisyValueTreeOnodeClick(node){ //console.log(node); this.selectedFixedOrCodeclassifyValue = node; @@ -1652,18 +1693,432 @@ this.codeClassifyForm.id = node.attributes.id; this.codeClassifyForm.name = node.attributes.name; this.codeClassifyForm.parentClassifyValueOid = node.attributes.oid; - //console.log(this.codeClassifyForm); + // console.log(this.codeClassifyForm); + }, + /** + * 鍒嗙被鐮佹鐮佸�硷紝淇敼銆佸垹闄ゃ�佷笂涓嬬Щ涔嬪墠锛屾鏌ユ槸鍚︿负瀛愬垎绫诲拰鐖跺垎绫讳箣闂寸浉浜掓洿鏀� + * @currentRowClassOid 褰撳墠閫変腑琛宱id + * @updateClassOid 瑕佷慨鏀圭殑鍒嗙被鐮佸�紀id + */ + checkClassUpdate(currentRowClassOid,updateClassOid){ + if(currentRowClassOid!=updateClassOid){ + this.$message({ + type: "error", + message: "鎿嶄綔澶辫触銆愬瓙鍒嗙被涓庣埗鍒嗙被涔嬮棿涓嶈兘鐩镐簰淇敼鐮佸�笺��!" + }); + } + return currentRowClassOid!=updateClassOid; + }, + + /** 缂栫爜瑙勫垯鐩稿叧鏂规硶 */ + /** 鎵撳紑楂樼骇鏌ヨ绐楀彛 */ + openAdvancedQuery(condition){ + if(condition=='codeRule'){ + this.advancedQueryParam.options = [ + { + data: [], + title: '缂栧彿', + fieldType: 'text', + queryField: 'id', + },{ + data: [], + title: '鍚嶇О', + fieldType: 'text', + queryField: 'name', + },{ + data: [], + title: '鎻忚堪', + fieldType: 'text', + queryField: 'description', + },{ + data: [ + // { + // key: '缂栬緫涓�', + // value: 'Editing', + // }, + // { + // key: '宸插彂甯�', + // value: 'Released', + // }, + // { + // key: '鍋滅敤', + // value: 'Disabled', + // }, + ], + title: '鐘舵��', + fieldType: 'combox', + queryField: 'lcStatus', + comboxKey: 'codeSearchLCStatus', + }, + ] + }else { + this.advancedQueryParam.options = [ + { + data: [], + title: '鐮佹缂栧彿', + fieldType: 'text', + queryField: 'id', + },{ + data: [], + title: '鐮佹鍚嶇О', + fieldType: 'text', + queryField: 'name', + },{ + data: [], + title: '鎻忚堪', + fieldType: 'text', + queryField: 'description', + },{ + data: [], + title: '鐮佹绫诲瀷', + fieldType: 'combox', + queryField: 'secType', + comboxKey: 'codeSecType', + } + ] + } + this.advancedQueryParam.currentOpen = condition; + this.advancedQueryParam.advancedQuerySettingBox = true; + }, + /** 鏌ヨ浣跨敤鑼冨洿*/ + handleRange(){ + if(!this.tipsMessage(this.selectionList)){ + return; + } + this.codeRangeSettingBox = true; + this.getRangeCodeList() + }, + /** 鍔犺浇浣跨敤鑼冨洿鍒楄〃*/ + getRangeCodeList(){ + this.dialogLoading = true; + if(this.selectionList[0].oid==null){ + this.$message.error("鏈幏鍙栧埌鍙傛暟!"); + } + + listUseRange(this.selectionList[0].oid).then(res => { + this.useRangeData = res.data.data; + //console.log(this.useRangeData); + this.dialogLoading = false; + }); + }, + /** 鍒锋柊浣跨敤鑼冨洿鍒楄〃*/ + refreshUseRangeChange(){ + this.getRangeCodeList(); + }, + /** 鍚敤涓庡仠鐢�*/ + enableOrDeactivatse(oId,update){ + updateStatus({"oid":oId,"ts":new Date().getTime,"update":update}).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + }, error => { + window.console.log(error); + }); + }, + /** 鎵撳紑缂栫爜瑙勫垯鍏嬮殕瀵硅瘽妗�*/ + openCodeRuleDialog() { + if (!this.tipsMessage(this.selectionList)) { + return; + } + this.cloneSettingBox = true; + this.cloneCodeRuleForm.id = this.selectionList[0].id; + this.cloneCodeRuleForm.name = this.selectionList[0].name; + this.cloneCodeRuleForm.description = this.selectionList[0].description; + this.loadBasic({"oid": this.selectionList[0].oid}); + }, + /** 鍏嬮殕缂栫爜瑙勫垯淇濆瓨鍔熻兘*/ + saveCloneCodeRule(){ + let form = this.cloneCodeRuleForm; + if(form.id.trim()==''){ + this.$message.warning("缂栧彿涓嶈兘涓虹┖!"); + return; + } + if(form.name.trim()==''){ + this.$message.warning("鐮佸�间笉鑳戒负绌�!"); + return; + } + this.selectionList[0].oid = ''; + this.selectionList[0].id = form.id; + this.selectionList[0].name = form.name; + this.selectionList[0].description = form.description; + this.selectionList[0].createTime = new Date().getTime(); + this.selectionList[0].ts = new Date(this.selectionList[0].ts).getTime(); + this.selectionList[0].lcStatus = 'Editing'; + let data = Object.assign({}, this.selectionList[0],{elements:this.cloneData}); + clone(data).then(() => { + this.cloneSettingBox = false; + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + }, error => { + window.console.log(error); + }); + //console.log(data); + }, + /** 鎵撳紑浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�*/ + openOtherCodeRuleDialog(){ + if (!this.tipsMessage(this.selectionList)) { + return; + } + if(this.selectionList[0].lcStatus != 'Editing'){ + this.$message.warning("缂栫爜瑙勫垯宸茶寮曠敤锛屼笉鍏佽缂栬緫鎴栧垹闄�!"); + return; + } + this.cloneOtherCodeRuleSettingBox = true; + }, + //** 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨*/ + codeOtherCloneRuleRowClick(row) { + this.$refs.crudCloneCodeRuleOther.toggleSelection(); + this.selectionOtherCloneCodeRuleList = row; + this.$refs.crudCloneCodeRuleOther.setCurrentRow(row); + this.$refs.crudCloneCodeRuleOther.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.loadBasic(row); + }, + /** 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮鍩虹鐮佹瀹炵幇琛岄�夋嫨*/ + codeOtherCloneBasicRowClick(row){ + this.$refs.crudCloneCodeBasicOther.toggleSelection(); + this.selectionOtherCloneCodeBasicList = row; + this.$refs.crudCloneCodeBasicOther.setCurrentRow(row); + this.$refs.crudCloneCodeBasicOther.toggleRowSelection(row); //閫変腑褰撳墠琛� + }, + /** 浠庡叾浠栬鍒欏厠闅嗙爜娈电晫闈腑缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�*/ + selectionOtherCloneCodeRuleChange(list) { + //console.log(list); + this.selectionOtherCloneCodeRuleList = list; + this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]); + if(list == ''){ + this.basicData = []; + } + if(this.selectionOtherCloneCodeRuleList.length > 0){ + this.loadBasic(this.selectionOtherCloneCodeRuleList[list.length-1]); + } + }, + selectionOtherCloneCodeBasicChange(list){ + this.selectionOtherCloneCodeBasicList = list; + this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]); + }, + /** 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹淇℃伅*/ + saveOtherCodeBasic(){ + let oid = this.selectionList[0].oid; + let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; + if(fromDialogPkCodebasic.length <= 0){ + this.$message.warning("璇烽�夋嫨鐮佹鏁版嵁!"); + return; + } + let res = fromDialogPkCodebasic.filter((item) => { + return item.pkCodeRule == oid; + }); + if(res != ''){ + this.$message.warning("闇�瑕佸厠闅嗙殑缂栫爜瑙勫垯涓庤鍏嬮殕鐨勭紪鐮佽鍒欑浉鍚�!"); + return; + } + //console.log(res); + let oidArr = []; + fromDialogPkCodebasic.forEach(ele => { + oidArr.push(ele.oid); + }); + let data = { + "pkCodeRule": oid, + "oidArr": oidArr.join(","), + } + //console.log(data); + cloneCodeBasic(data).then(() => { + this.cloneOtherCodeRuleSettingBox = false; + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + }, error => { + window.console.log(error); + }); + }, + /** 娓呯┖鐮佸��*/ + clearAllCodeSec(){ + if(this.selectionList.length == 0){ + this.$message.warning("娌℃湁閫夋嫨鏁版嵁!"); + return; + } + if(this.selectionList.length != 1){ + this.$message.warning("姣忔鍙兘閫夋嫨涓�鏉℃暟鎹�!"); + return; + } + let currentData = this.selectionList[0]; + this.$confirm("纭畾瑕佹竻绌虹爜鍊硷紵濡傛灉娓呯┖灏嗕笉鑳借鎭㈠锛岃璋ㄦ厧锛�", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + let ts = new Date(currentData.ts).getTime(); + return clearAllCode({"oid": currentData.oid,"ts": ts}); + }) + .then(() => { + this. this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + }); + }, + /** 娣诲姞*/ + rowSave(row, done, loading) { + console.log(row); + add(row).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + done(); + }, error => { + loading(); + window.console.log(error); + }); + }, + openEdit(row){ + this.$refs.crud.rowEdit(row,row.$index); + }, + /** 淇敼*/ + rowUpdate(row, index, done, loading) { + row.ts = new Date().getTime; + update(row).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + done(); + }, error => { + loading(); + console.log(error); + }); + }, + /** 鍒犻櫎*/ + handleDelete() { + if(!this.tipsMessage(this.selectionList)){ + return; + } + this.$confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + // 鍙敮鎸佹瘡娆″崟鏉¤褰曞垹闄� + let oid = this.selectionList[0].oid; + let ts = new Date(this.selectionList[0].ts).getTime(); + return remove({oid: oid,ts: ts}); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + this.$refs.crud.toggleSelection(); + }); + }, + // 鎵撳紑淇敼*/ + beforeOpen(done, type) { + if (["edit", "view"].includes(type)) { + getDetail(this.ruleForm.oid).then(res => { + this.ruleForm = res.data.data; + }); + } + done(); + }, + searchReset() { + this.query = {}; + this.onLoad(this.page); + }, + searchChange(params, done) { + this.page.currentPage = 1; + // 澶氫釜conditionMap杩欐牱浼犲弬锛屽揩閫熸煡璇㈤粯璁ら噰鐢ㄦā绯婃煡璇� + let requestData = {}; + if(params){ + Object.keys(params).forEach(key=>{ + requestData["conditionMap"+'['+key+'_like]'] = params[key].trim(); + }); + } + this.query = requestData; + this.onLoad(this.page); + done(); + }, + /** 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�*/ + selectionChange(list) { + this.selectionList = list; + //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌�,骞剁鐢ㄧ浉鍏冲姛鑳� + if(this.selectionList.length <= 0){ + this.hideBasicTable(false); + } + if (this.selectionList.length > 0) { + this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); + this.currentCodeRuleOid = this.selectionList[list.length-1].oid; + this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus; + this.loadBasic(this.selectionList[list.length-1]); + } + }, + /** 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨*/ + codeRuleRowClick (row) { + // console.log(this.currentRuleLcStatus); + this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + + }, + selectionClear() { + this.selectionList = []; + this.$refs.crud.toggleSelection(); + }, + currentChange(currentPage){ + this.page.currentPage = currentPage; + }, + sizeChange(pageSize){ + this.page.pageSize = pageSize; + }, + refreshChange() { + this.onLoad(this.page, this.query); + }, + onLoad(page,params={}) { + this.loading = true; + gridCodeRule( + page.currentPage, + page.pageSize, + this.query + ).then(res => { + //console.log(res.data); + const data = res.data.data; + this.page.total = data.total; + this.data = data.records; + this.loading = false; + // 鏌ヨ鐨勫�间负绌烘椂锛岃灏嗙爜娈电鐞嗙浉鍏崇殑鍐呭绂佺敤 + if(data.records.length <= 0) { + this.hideBasicTable(false); + return; + } + this.loadBasic(this.data[0]) + this.$nextTick(() => { + this.$refs.crud.toggleRowSelection(this.data[0]); + this.$refs.crud.setCurrentRow(this.data[0]); + }) + this.selectionList = data.records[0]; + //this.selectionClear(); + }); }, /** 鍩虹鐮佹鐩稿叧鏂规硶 */ - //闃叉鎵撳紑杩囩紪杈戠獥鍙d箣鍚庤〃鍗曚腑瀛樺湪鍊硷紝鎵�浠ラ渶瑕佹竻绌�,骞跺垵濮嬪寲form琛ㄥ崟灞炴�� + /** 闃叉鎵撳紑杩囩紪杈戠獥鍙d箣鍚庤〃鍗曚腑瀛樺湪鍊硷紝鎵�浠ラ渶瑕佹竻绌�,骞跺垵濮嬪寲form琛ㄥ崟灞炴��*/ clearBasicAddForm(){ this.form = this.$options.data().form; // this.changeSectypeFormItems(null); }, - // 鎵撳紑鏂板绐楀彛 - addBasicCodeSec(){ + /** 鎵撳紑鏂板绐楀彛*/ + openAddBasicCodeSec(){ if(!this.tipsMessage(this.selectionList)){ return; } @@ -1674,7 +2129,7 @@ this.openBasicDialog('add',null); this.loadCodeSecType(); }, - // 鎵撳紑鏂板鎴栫紪杈戝熀纭�鐮佹瀵硅瘽妗� + /** 鎵撳紑鏂板鎴栫紪杈戝熀纭�鐮佹瀵硅瘽妗�*/ openBasicDialog(condition,row){ //console.log(row); if(condition == 'add') { @@ -1699,31 +2154,39 @@ this.changeSectypeFormItems(condition == 'add' ? null:row); this.addBasicCodeSettingBox = true; }, - // 鏂板鍩虹鐮佹 - saveOrEditBasicCode(){ + /** 鏂板鍩虹鐮佹*/ + async saveOrEditBasicCode(){ if(this.selectionList[0].oid == null || this.selectionList[0].oid == ''){ this.$message.warning('缂哄け蹇呰鍙傛暟锛岃閲嶆柊閫夋嫨缂栫爜瑙勫垯鍚庡啀璇�!'); return; - } + } this.form.pkCodeRule = this.selectionList[0].oid; if(this.form.oid == '' || this.form.oid == null){ if(this.checkForm()){ - addSave(this.form).then(() => { - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); + await addSave(this.form).then(() => { + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); }, error => { window.console.log(error); }); // 鍏抽棴瀵硅瘽妗� this.addBasicCodeSettingBox = false } - + // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇 + this.loadBasic(this.selectionList[0]); }else{ + // 鍙兘鍙傜収寮曠敤鐨勪笟鍔$被鍨嬩細鍙戠敓鏀瑰彉鎵�浠ヨ繖鍎跨洿鎺ュreferConfig鐨刯son杩涜鏀瑰彉 + if(this.form.referConfig === "coderefersec" || this.form.referConfig != undefined){ + let referConfig = JSON.parse(this.form.referConfig); + referConfig.referType = this.form.referBtmId; + referConfig.referTypeName = this.form.referBtmName; + this.form.referConfig = JSON.stringify(referConfig); + // let referValueInfo = JSON.parse(this.form.referValueInfo); + // referValueInfo.referType = this.form.referBtmId; + } editSave(this.form).then(() => { - // 鍏抽棴瀵硅瘽妗� - this.addBasicCodeSettingBox = false this.$message({ type: "success", message: "鎿嶄綔鎴愬姛!" @@ -1731,15 +2194,17 @@ }, error => { window.console.log(error); }); + this.loadBasic(this.selectionList[0]); + // 鍏抽棴瀵硅瘽妗� + this.addBasicCodeSettingBox = false } - // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇 - this.loadBasic(this.selectionList[0]); }, - // 鍥犱负elementui鐨勮〃鍗曟牎楠岃缃笉涓婃墍浠ラ噰鐢ㄥ垽鏂殑鏂瑰紡鏉ュ仛琛ㄥ崟妫�楠屾柟寮� + /** 鍥犱负elementui鐨勮〃鍗曟牎楠岃缃笉涓婃墍浠ラ噰鐢ㄥ垽鏂殑鏂瑰紡鏉ュ仛琛ㄥ崟妫�楠屾柟寮�*/ checkForm(){ let form = this.form; //console.log(form); const regNumber = /^[0-9]+\.{0,1}[0-9]*$/; //鏁板瓧鎴栧皬鏁版鍒欐牎楠� + const regPos = /^[0-9]*[1-9][0-9]*$/; //闈炶礋鏁存暟姝e垯鏍¢獙 const tipsMsg = "蹇呭~椤逛笉鑳戒负绌�"; if(form.id == ''){ this.$message.warning("(鐮佹缂栧彿)"+tipsMsg); @@ -1760,7 +2225,7 @@ //鍥哄畾鐮佹 if(form.codeSecLengthType == ''){ this.$message.warning("(鐮佹闀垮害绫诲瀷)"+tipsMsg); - this.$refs.codeSecLengthType.$el.querySelector('select').focus(); + // this.$refs.codeSecLengthType.$el.querySelector('select').focus(); return false; } if(form.codeSecLength == ''){ @@ -1781,7 +2246,7 @@ return false; } }else if(this.form.secType==='codeserialsec'){ - console.log(form.codeFillType); + //console.log(form.codeFillType); //娴佹按鐮佹 if(form.codeSecLength == ''){ this.$message.warning('(鐮佹鐨勯暱搴�)'+tipsMsg); @@ -1807,7 +2272,7 @@ this.$message.warning('(缂栫爜琛ヤ綅鏂瑰紡)'+tipsMsg); return false; } - if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparatorSelect == ''){ + if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparator == ''){ this.$message.warning('褰撹ˉ浣嶆柟寮忎负宸﹁ˉ浣嶆垨鑰呭彸琛ヤ綅鐨勬椂鍊欙紝琛ヤ綅瀛楃涓嶈兘涓虹┖'); return false; } @@ -1831,25 +2296,29 @@ this.$refs.codeFillLimit.$el.querySelector('input').focus(); return false; } - if(form.codeFillFlag == ''){ - this.$message.warning('(娴佹按鏄惁琛ョ爜)'+tipsMsg); - this.$refs.switch.$el.querySelector('input').focus(); - return false; - } + // if(form.codeFillFlag == '' || ){ + // this.$message.warning('(娴佹按鏄惁琛ョ爜)'+tipsMsg); + // return false; + // } }else if(this.form.secType==='codelevelsec'){ //灞傜骇鐮佹 if(form.codeLevelType == ''){ this.$message.warning('(灞傜骇绫诲瀷)'+tipsMsg); return false; } - if(!regNumber.test(form.codeLevelValue)){ - this.$message.warning('灞傜骇鐨勫��)鍙兘濉啓鏁板瓧'); + if(form.codeLevelType != 'code_level_min'&& !regNumber.test(form.codeLevelValue)){ + this.$message.warning('(灞傜骇鐨勫��)鍙兘濉啓鏁板瓧'); this.$refs.codeLevelValue.$el.querySelector('input').focus(); return false; } if(form.valueCutType == ''){ this.$message.warning('(瀛楃鎴彇绫诲瀷)'+tipsMsg); - this.$refs.valueCutType.$el.querySelector('select').focus(); + // this.$refs.valueCutType.$el.querySelector('select').focus(); + return false; + } + if(form.valueCutType != 'code_cut_none' && !regPos.test(form.valueCutLength)){ + this.$message.warning('(鍊兼埅鍙栭暱搴�)鍙兘濉啓姝f暣鏁�'); + this.$refs.valueCutLength.$el.querySelector('input').focus(); return false; } }else if(this.form.secType==='coderefersec'){ @@ -1903,14 +2372,15 @@ this.$message.warning('(缂栫爜琛ヤ綅鏂瑰紡)'+tipsMsg); return false; } - if(form.codeFillType != '涓嶈ˉ浣�' && form.codeFillSeparatorSelect == ''){ + // console.log(form); + if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){ this.$message.warning('褰撹ˉ浣嶆柟寮忎负宸﹁ˉ浣嶆垨鑰呭彸琛ヤ綅鐨勬椂鍊欙紝琛ヤ綅瀛楃涓嶈兘涓虹┖'); return false; } } return true; }, - // 鍒ゆ柇鏁版嵁鏄惁閫夋嫨浠ュ強鍙兘閫夋嫨鍗曟潯鏁版嵁 + /** 鍒ゆ柇鏁版嵁鏄惁閫夋嫨浠ュ強鍙兘閫夋嫨鍗曟潯鏁版嵁*/ tipsMessage(list){ if(list.length != 1){ this.$message.warning("璇烽�夋嫨涓�鏉$紪鐮佽鍒欐暟鎹�!"); @@ -1918,7 +2388,7 @@ } return true; }, - // 鍩虹鐮佹鍒犻櫎 + /** 鍩虹鐮佹鍒犻櫎*/ deleteBasicCode(){ if(!this.tipsMessage(this.selectionBasicList)){ return; @@ -1942,7 +2412,7 @@ this.$refs.crudBasic.toggleSelection(); }); }, - // 鐐瑰嚮瑙﹀彂鍔犺浇鍩虹鐮佹淇℃伅 + /** 鐐瑰嚮瑙﹀彂鍔犺浇鍩虹鐮佹淇℃伅*/ loadBasic(row){ if(this.cloneSettingBox){ this.cloneTableLoading = true; @@ -1951,17 +2421,29 @@ } // console.log(row.oid); //瀛樺偍褰撳墠鍏宠仈鐨勭紪鐮佽鍒欑浉鍏充俊鎭� - this.currentCodeRuleOid = row.oid; - this.currentRuleLcStatus = row.lcStatus; - this.sendGridCodeBasicSec({"pkCodeRule":row.oid}); + if(row!='' || row!=null){ + this.currentCodeRuleOid = row.oid; + this.currentRuleLcStatus = row.lcStatus; + this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false); + } }, - // 鍙戦�佸姞杞藉熀纭�鐮佹鐨勮姹� - sendGridCodeBasicSec(condition){ + /** 鍙戦�佸姞杞藉熀纭�鐮佹鐨勮姹�*/ + sendGridCodeBasicSec(condition,isAdancedQuery/** 鏄惁楂樼骇鏌ヨ */){ // 濡傛灉褰撳墠鍩虹鐮佹琛ㄤ腑鐨勬悳绱㈡寜閽闅愯棌锛屽氨闇�瑕佸湪姝ゅ紑鍚� if(this.selectionList.length>=0 && !this.$refs.crudBasic.option.column[0].search){ this.hideBasicTable(true); } - gridCodeBasicSec(1, -1, condition).then(res => { + let conditionMaps = {}; + if(condition && !isAdancedQuery){ + Object.keys(condition).forEach(key=>{ + conditionMaps['conditionMap['+key+']'] = condition[key].trim(); + }); + } + if(isAdancedQuery){ + condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' + ? this.selectionList[0].oid:this.currentCodeRuleOid; + } + gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => { const data = res.data.data; if(this.cloneSettingBox){ this.cloneData = data.records; @@ -1974,13 +2456,13 @@ } }); }, - // 鍩虹鐮佹閫変腑鏃惰Е鍙� + /** 鍩虹鐮佹閫変腑鏃惰Е鍙�*/ selectionBasicChange(list) { this.selectionBasicList = list; this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]); //console.log(this.selectionBasicList); }, - // 鍩虹鐮佹琚崟鍑昏〃鏍艰鏃惰Е鍙� + /** 鍩虹鐮佹琚崟鍑昏〃鏍艰鏃惰Е鍙�*/ codeBasicSecRowClick(row){ this.$refs.crudBasic.toggleSelection(); this.selectionBasicList = row; @@ -1989,29 +2471,27 @@ }, basicSearchChange(params, done){ //console.log(this.$refs.crudBasic); - this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid})); + this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}),false); done(); }, basicSearchReset(){ - this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}); + this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid},false); }, - // 涓婄Щ涓嬬Щ鍩虹鐮佹 - upOrderNum(row){ - //console.log(row.oid); + /** 涓婄Щ涓嬬Щ鍩虹鐮佹*/ + async upOrderNum(row){ if(!this.tipsMessage(this.selectionList)){ return; } - let codeRuleOid = this.selectionList[0].oid; if (this.selectionList[0].lcStatus != 'Editing') { this.$message.warning("鍙湁缂栫爜瑙勫垯鐨勭姸鎬佹槸 [缂栬緫涓璢 鐨勬椂鍊欙紝鎵嶈兘璋冩暣鐮佹椤哄簭!"); - return; + return; } if(row.oid==null || row.oid==''){ this.$message.warning("鏈幏鍙栧埌蹇呭~鍙傛暟!"); - return; + return; } - upOrderNum(row.oid).then(() => { - this.loadBasic({"oid":codeRuleOid}); + await upOrderNum(row.oid).then(() => { + this.loadBasic(this.selectionList[0]); this.$message({ type: "success", message: "鎿嶄綔鎴愬姛!" @@ -2027,11 +2507,11 @@ //console.log(this.selectionList); if (this.selectionList[0].lcStatus != 'Editing') { this.$message.warning("鍙湁缂栫爜瑙勫垯鐨勭姸鎬佹槸 [缂栬緫涓璢 鐨勬椂鍊欙紝鎵嶈兘璋冩暣鐮佹椤哄簭!"); - return; + return; } if(row.oid==null || row.oid==''){ this.$message.warning("鏈幏鍙栧埌蹇呭~鍙傛暟!"); - return; + return; } downOrderNum(row.oid).then(() => { this.loadBasic({"oid":codeRuleOid}); @@ -2041,394 +2521,58 @@ }); }) }, - // 鍩虹鐮佹鍒锋柊鏃舵煡璇� + /** 鍩虹鐮佹鍒锋柊鏃舵煡璇�*/ refreshChangeBasicSec(){ - this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid}); + this.loadBasic(this.selectionList.at(-1)); }, - // 鎿嶄綔鍩虹鐮佹涓悳绱㈡竻绌虹瓑鎸夐挳鐨勬樉绀�/闅愯棌 + /** 鎿嶄綔鍩虹鐮佹涓悳绱㈡竻绌虹瓑鎸夐挳鐨勬樉绀�/闅愯棌*/ hideBasicTable(hideBoolean){ this.$refs.crudBasic.option.refreshBtn = hideBoolean; - this.$refs.crudBasic.option.columnBtn = hideBoolean; this.$refs.crudBasic.option.column[0].search = hideBoolean; this.$refs.crudBasic.option.column[1].search = hideBoolean; - }, - - - /** 缂栫爜瑙勫垯鐩稿叧鏂规硶 */ - // 鏌ヨ浣跨敤鑼冨洿 - handleRange(){ - if(!this.tipsMessage(this.selectionList)){ - return; - } - this.codeRangeSettingBox = true; - this.getRangeCodeList() - }, - // 鍔犺浇浣跨敤鑼冨洿鍒楄〃 - getRangeCodeList(){ - this.dialogLoading = true; - if(this.selectionList[0].oid==null){ - this.$message.error("鏈幏鍙栧埌鍙傛暟!"); - } - - listUseRange(this.selectionList[0].oid).then(res => { - this.useRangeData = res.data.data; - //console.log(this.useRangeData); - this.dialogLoading = false; - }); - }, - // 鍒锋柊浣跨敤鑼冨洿鍒楄〃 - refreshUseRangeChange(){ - this.getRangeCodeList(); - }, - // 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨 - codeRuleRowClick (row) { - // 杩欏効搴旇鍙互涓嶈锛屽洜涓簍oggleRowSelection涔熶細瑙﹀彂琛岄�夋嫨鏃堕棿 - this.selectionList = row; - this.$refs.crud.toggleSelection(); - this.$refs.crud.setCurrentRow(row); - this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� - if(row!=''){ - this.loadBasic(row); - } - }, - // 鍚敤涓庡仠鐢� - enableOrDeactivatse(oId,update){ - updateStatus({"oid":oId,"ts":new Date().getTime,"update":update}).then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - }, error => { - window.console.log(error); - }); - }, - // 鎵撳紑缂栫爜瑙勫垯鍏嬮殕瀵硅瘽妗� - openCodeRuleDialog() { - if (!this.tipsMessage(this.selectionList)) { - return; - } - this.cloneSettingBox = true; - this.cloneCodeRuleForm.id = this.selectionList[0].id; - this.cloneCodeRuleForm.name = this.selectionList[0].name; - this.cloneCodeRuleForm.description = this.selectionList[0].description; - this.loadBasic({"oid": this.selectionList[0].oid}); - }, - // 鍏嬮殕缂栫爜瑙勫垯淇濆瓨鍔熻兘 - saveCloneCodeRule(){ - let form = this.cloneCodeRuleForm; - if(form.id.trim()==''){ - this.$message.warning("缂栧彿涓嶈兘涓虹┖!"); - return; - } - if(form.name.trim()==''){ - this.$message.warning("鐮佸�间笉鑳戒负绌�!"); - return; - } - this.selectionList[0].oid = ''; - this.selectionList[0].id = form.id; - this.selectionList[0].name = form.name; - this.selectionList[0].description = form.description; - this.selectionList[0].createTime = new Date().getTime(); - this.selectionList[0].ts = new Date(this.selectionList[0].ts).getTime(); - this.selectionList[0].lcStatus = 'Editing'; - let data = Object.assign({}, this.selectionList[0],{elements:this.cloneData}); - clone(data).then(() => { - this.cloneSettingBox = false; - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - }, error => { - window.console.log(error); - }); - //console.log(data); - }, - // 鎵撳紑浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗� - openOtherCodeRuleDialog(){ - if (!this.tipsMessage(this.selectionList)) { - return; - } - if(this.selectionList[0].lcStatus != 'Editing'){ - this.$message.warning("缂栫爜瑙勫垯宸茶寮曠敤锛屼笉鍏佽缂栬緫鎴栧垹闄�!"); - return; - } - this.cloneOtherCodeRuleSettingBox = true; - }, - // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨 - codeOtherCloneRuleRowClick(row) { - this.$refs.crudCloneCodeRuleOther.toggleSelection(); - this.selectionOtherCloneCodeRuleList = row; - this.$refs.crudCloneCodeRuleOther.setCurrentRow(row); - this.$refs.crudCloneCodeRuleOther.toggleRowSelection(row); //閫変腑褰撳墠琛� - this.loadBasic(row); - }, - // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹瀵硅瘽妗�-鍗曞嚮鍩虹鐮佹瀹炵幇琛岄�夋嫨 - codeOtherCloneBasicRowClick(row){ - this.$refs.crudCloneCodeBasicOther.toggleSelection(); - this.selectionOtherCloneCodeBasicList = row; - this.$refs.crudCloneCodeBasicOther.setCurrentRow(row); - this.$refs.crudCloneCodeBasicOther.toggleRowSelection(row); //閫変腑褰撳墠琛� - }, - // 浠庡叾浠栬鍒欏厠闅嗙爜娈电晫闈腑缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙� - selectionOtherCloneCodeRuleChange(list) { - //console.log(list); - this.selectionOtherCloneCodeRuleList = list; - this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]); - if(list == ''){ + if(!hideBoolean){ + this.selectionList = []; this.basicData = []; } - if(this.selectionOtherCloneCodeRuleList.length > 0){ - this.loadBasic(this.selectionOtherCloneCodeRuleList[list.length-1]); + }, + changeCutType(value){ + if (value != 'code_cut_none'){ + if(this.form.valueCutLength == ''){ + this.form.valueCutLength = 1; + } + }else{ + this.form.valueCutLength = ''; } }, - selectionOtherCloneCodeBasicChange(list){ - this.selectionOtherCloneCodeBasicList = list; - this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]); - }, - // 浠庡叾浠栫紪鐮佽鍒欎腑鍏嬮殕鐮佹淇℃伅 - saveOtherCodeBasic(){ - let oid = this.selectionList[0].oid; - let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; - if(fromDialogPkCodebasic.length <= 0){ - this.$message.warning("璇烽�夋嫨鐮佹鏁版嵁!"); - return; - } - let res = fromDialogPkCodebasic.filter((item) => { - return item.pkCodeRule == oid; - }); - if(res != ''){ - this.$message.warning("闇�瑕佸厠闅嗙殑缂栫爜瑙勫垯涓庤鍏嬮殕鐨勭紪鐮佽鍒欑浉鍚�!"); - return; - } - //console.log(res); - let oidArr = []; - fromDialogPkCodebasic.forEach(ele => { - oidArr.push(ele.id); - }); - let data = { - "pkCodeRule": oid, - "oidArr": oidArr.join(","), - } - //console.log(data); - cloneCodeBasic(data).then(() => { - this.cloneOtherCodeRuleSettingBox = false; - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - }, error => { - window.console.log(error); - }); - }, - // 娓呯┖鐮佸�� - clearAllCodeSec(){ - if(this.selectionList.length == 0){ - this.$message.warning("娌℃湁閫夋嫨鏁版嵁!"); - return; - } - if(this.selectionList.length != 1){ - this.$message.warning("姣忔鍙兘閫夋嫨涓�鏉℃暟鎹�!"); - return; - } - let currentData = this.selectionList[0]; - this.$confirm("纭畾瑕佹竻绌虹爜鍊硷紵濡傛灉娓呯┖灏嗕笉鑳借鎭㈠锛岃璋ㄦ厧锛�", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(() => { - let ts = new Date(currentData.ts).getTime(); - return clearAllCode({"oid": currentData.oid,"ts": ts}); - }) - .then(() => { - this. this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - }); - }, - // 娣诲姞 - rowSave(row, done, loading) { - add(row).then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - done(); - }, error => { - loading(); - window.console.log(error); - }); - }, - openEdit(row){ - this.$refs.crud.rowEdit(row,row.$index); - }, - // 淇敼 - rowUpdate(row, index, done, loading) { - row.ts = new Date().getTime; - update(row).then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - done(); - }, error => { - loading(); - console.log(error); - }); - }, - // 鍒犻櫎 - handleDelete() { - if(!this.tipsMessage(this.selectionList)){ - return; - } - this.$confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(() => { - // 鍙敮鎸佹瘡娆″崟鏉¤褰曞垹闄� - let oid = this.selectionList[0].oid; - let ts = new Date(this.selectionList[0].ts).getTime(); - return remove({oid: oid,ts: ts}); - }) - .then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" - }); - this.$refs.crud.toggleSelection(); - }); - }, - // 鎵撳紑淇敼 - beforeOpen(done, type) { - if (["edit", "view"].includes(type)) { - getDetail(this.ruleForm.oid).then(res => { - this.ruleForm = res.data.data; - }); - } - done(); - }, - searchReset() { - this.query = {}; - this.onLoad(this.page); - }, - searchChange(params, done) { - this.query = params; - this.page.currentPage = 1; - this.onLoad(this.page, params); - done(); - }, - // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙� - selectionChange(list) { - this.selectionList = list; - this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); - //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌� - if(list == ''){ - this.basicData = []; - this.hideBasicTable(false); - } - if(this.selectionList.length > 0){ - this.currentCodeRuleOid = this.selectionList[list.length-1].oid; - this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus; - this.loadBasic(this.selectionList[list.length-1]); - } - }, - selectionClear() { - this.selectionList = []; - this.$refs.crud.toggleSelection(); - }, - currentChange(currentPage){ - this.page.currentPage = currentPage; - }, - sizeChange(pageSize){ - this.page.pageSize = pageSize; - }, - refreshChange() { - this.onLoad(this.page, this.query); - }, - onLoad(page, params = {}) { - this.loading = true; - gridCodeRule(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { - //console.log(res.data); - const data = res.data.data; - this.page.total = data.total; - this.data = data.records; - this.loading = false; - this.loadBasic(this.data[0]) - this.$nextTick(() => { - this.$refs.crud.toggleRowSelection(this.data[0]); - this.$refs.crud.setCurrentRow(this.data[0]); - }) - this.selectionList = data.records[0]; - //this.selectionClear(); - }); - }, - /** 绗竴灞傚璇濇鐩稿叧鏂规硶 */ - // 鎵撳紑浜屽眰瀵硅瘽妗嗘柟娉� + /** 鎵撳紑浜屽眰瀵硅瘽妗嗘柟娉�*/ openAttrSelectOrGetValue(condition){ if(condition === 'attr'){ this.isShowSelectAttrOption = true; + this.loadlistClassifyLinkAttr(); }else if(condition === 'value'){ //鎵撳紑鍏紡缂栬緫妗嗭紝绗簩灞傚祵濂楀璇濇 - this.$refs.formulaEditor.isShowformulaEdit = true; + //this.$refs.formulaEditor.isShowformulaEdit = true; + this.formulaEditorParams.formulaEditorSettingBox = true; }else if(condition === 'parentClassifySecOid'){ - this.isShowParentClassifyOption = true; + this.parentClsfyParams.isShowParentClassifySettingBox = true; }else if(condition === 'referBtmId'){ - this.isShowSelectReferBtmOption = true; - this.refreshReferBtmDataChange(); + this.referBtmDialogParams.selectReferBtmSettingBox = true; + // 璋冪敤瀛愮粍浠跺埛鏂拌〃鏍兼暟鎹� + this.$refs[this.referBtmDialogParams.ref].referBtmOnLoad(); }else if(condition === 'referConfig'){ - if(func.notEmpty(this.form.referConfig) || func.notEmpty(this.form.referBtmName)){ - this.$refs.referConfigFormDialog.isShowReferConfigForm = true; - let value = { - referTypeName: this.form.referBtmName, - referType: this.form.referBtmId, - referConfig: this.form.referConfig, - } - this.$refs.referConfigFormDialog.initPageData(value); - }else{ - this.openTipsChooseOrCust(); + this.referConfigVisble = true; + this.referConfigOption = { + referBtmName: this.form.referBtmName, + referBtmId: this.form.referBtmId, + referConfig: this.form.referConfig || '', } - //this.$refs.referConfigFormDialog.onloadAttrData(); + this.$refs.referConfig.$el.querySelector('input').blur(); } }, - // 鎵撳紑鑷畾涔夊弬鐓ч厤缃垨鐩存帴閫夋嫨鍙傜収閰嶇疆鐣岄潰 - openTipsChooseOrCust(){ - this.$confirm('璇烽�夋嫨鍙傜収閰嶇疆鐨勫畾涔夋柟寮忥紵','鍙傜収閰嶇疆鐨勬柟寮�', { - distinguishCancelAndClose: true, - closeOnClickModal: false, - confirmButtonText: '鑷畾涔夊弬鐓ч厤缃�', - cancelButtonText: '鐩存帴閫夋嫨鍙傜収閰嶇疆' - }) - .then(() => { - // 鎵撳紑鑷畾鍙傜収閰嶇疆瀵硅瘽妗� - this.$refs.referConfigFormDialog.isShowReferConfigForm = true; - // 琛ㄦ牸閿欒鐨勯棶棰� - this.$refs.referConfigFormDialog.onloadAttrData(); - }) - .catch(action => { - if (action === "cancel") { - // 鎵撳紑鐩存帴閫夋嫨鍙傜収閰嶇疆瀵硅瘽妗� - this.$refs.referConfigCrudDialog.isShowReferConfigCrud = true; - this.$refs.referConfigCrudDialog.referConfigOnload(); - } - //console.log(action); - }); - // 璁╁弬鐓ч厤缃緭鍏ユ澶卞幓鐒︾偣锛屽惁鍒欒鎻愮ず妗嗘棤娉曡鍏抽棴 - this.$refs.referConfig.$el.querySelector('input').blur(); - }, - // 鐐瑰嚮杈撳叆妗嗙殑脳鍙凤紝娓呯┖杈撳叆妗嗕腑鐨勫唴瀹� + /** 鐐瑰嚮杈撳叆妗嗙殑脳鍙凤紝娓呯┖杈撳叆妗嗕腑鐨勫唴瀹�*/ clearAttrDataByIcon(condition){ if(condition === 'attr'){ this.form.referAttributeName = ''; @@ -2447,16 +2591,16 @@ this.form.referConfig = ''; } }, - // 琛ヤ綅鏃剁殑瀛楃锛屽疄鐜板彲杈撳彲閫� + /** 琛ヤ綅鏃剁殑瀛楃锛屽疄鐜板彲杈撳彲閫�*/ inputSelectBlur(e){ - if (e.target.value) { - this.form.codeFillSeparatorSelect = e.target.value; + if (e.target.value) { + this.form.codeFillSeparator = e.target.value; } }, - // 鐮佹绫诲瀷鏀瑰彉鏃讹紝澧炲姞瀵瑰簲鐨刦orm琛ㄥ崟涓殑灞炴�� - changeSectypeFormItems(row){ - //console.log(row); - if(this.sectypeList.length==0){ + /** 鐮佹绫诲瀷鏀瑰彉鏃讹紝澧炲姞瀵瑰簲鐨刦orm琛ㄥ崟涓殑灞炴��*/ + changeSectypeFormItems(row){ + //console.log(row); + if(this.enumParam.secTypeList.length==0){ this.loadCodeSecType(); } if(row != null){ @@ -2510,9 +2654,9 @@ codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'', //鐮佹鐨勯暱搴� serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1, //娴佹按鍙疯捣濮嬪�� serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1, //娴佹按鐨勬闀� - codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //缂栫爜琛ヤ綅鏂瑰紡 - codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //琛ヤ綅鏃剁殑瀛楃锛岄�変腑鐨勪笅鎷夋鐨勪笅鏍� - codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0, //琛ヤ綅鏃剁殑瀛楃 + codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //缂栫爜琛ヤ綅鏂瑰紡 + // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //琛ヤ綅鏃剁殑瀛楃锛岄�変腑鐨勪笅鎷夋鐨勪笅鏍� + codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //琛ヤ綅鏃剁殑瀛楃 codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'', //濉厖闀垮害 codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'', //娴佹按涓婇檺 codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ? true:false :false, //娴佹按鏄惁琛ョ爜 @@ -2538,6 +2682,7 @@ referBtmId: row!=null&&row.referBtmId != '' ? row.referBtmId:'', //鍙傜収寮曠敤鐨勪笟鍔$被鍨嬶紝鐨刬d referBtmName: row!=null&&row.referBtmName != '' ? row.referBtmName:'', //鍙傜収寮曠敤鐨勪笟鍔$被鍨� referConfig: row!=null&&row.referConfig != '' ? row.referConfig:'', //鍙傜収閰嶇疆 + referValueInfo: row!=null&&row.referValueInfo != '' ? row.referValueInfo:'', //鍙傜収閰嶇疆 }); }else if(this.form.secType==='codedatesec'){ //鏃ユ湡鐮佹 @@ -2559,51 +2704,64 @@ //鍙彉鐮佹 this.form = Object.assign({}, this.form,{ codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'', //鐮佹鐨勯暱搴� - codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //缂栫爜閮ㄤ綅鏂瑰紡锛屾灇涓炬煡璇� - codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //閫変腑鐨勮ˉ浣嶆椂鐨勫瓧绗︾殑涓嬫爣 - codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夋煡璇� + codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //缂栫爜閮ㄤ綅鏂瑰紡锛屾灇涓炬煡璇� + // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //閫変腑鐨勮ˉ浣嶆椂鐨勫瓧绗︾殑涓嬫爣 + codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //琛ヤ綅鏃剁殑瀛楃锛屽彲杈撳彲閫夋煡璇� }); this.loadCodeFillType(); this.loadCodeFillSeparator(); } // console.log(this.form); }, - //鏋氫妇鍜屽彲杈撳彲閫夊唴瀹规煡璇� + /** 绗竴娆¤姹傜殑鏋氫妇鏁版嵁鏀剧紦瀛�*/ + getLocalStorageEnum(enumKey){ + let enumCach = JSON.parse(localStorage.getItem(enumKey)); + if(enumCach == null) { + getDictionary({code: enumKey}).then(res=>{ + enumCach = res.data.data; + localStorage.setItem(enumKey,JSON.stringify(res.data.data)); + }) + } + return enumCach; + }, + /** 缁熶竴鍔犺浇鎵�鏈夋灇涓炬煡璇紝涓昏鏄负閬垮厤鍒囨崲鐮佹绫诲瀷鏃惰繕鏈姞杞藉畬鎴愮殑鎯呭喌*/ + loadTotalEnum(){ + this.loadCodeSecType(); + this.loadCodeSecLength(); + this.loadCodeFillType(); + this.loadCodeFillSeparator(); + this.loadCodeLevelType(); + this.loadCodeCutType(); + this.loadCodeGetValueType(); + }, + /** 鏋氫妇鍜屽彲杈撳彲閫夊唴瀹规煡璇� */ loadCodeSecType(){ - getDictionary({code: "codeBasicSecType"}).then(res=>{ - this.sectypeList = res.data.data; - }) + this.enumParam.secTypeList = this.getLocalStorageEnum("codeSecType"); this.loadCodeSecLength(); }, loadCodeSecLength(){ - getDictionary({code: "codeSecLength"}).then(res=>{ - this.codeSecLengthType = res.data.data; - }) + this.enumParam.codeSecLengthType = this.getLocalStorageEnum("codeSecLength"); }, loadCodeFillType(){ - getDictionary({code: "codeFillType"}).then(res=>{ - this.codeFillType = res.data.data; - }) + this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType"); }, loadCodeFillSeparator(){ - getDictionary({code: "codeFillSeparator"}).then(res=>{ - this.codeFillSeparator = res.data.data; - }) + let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); + if(enumCach == null) { + getDictionary("codeFillSeparator").then(res=>{ + this.enumParam.codeFillSeparator = res.data.data; + localStorage.setItem(key,JSON.stringify(res.data.data)); + }) + } }, loadCodeLevelType(){ - getDictionary({code: "codeLevelType"}).then(res=>{ - this.codeLevelType = res.data.data; - }) + this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType"); }, loadCodeCutType(){ - getDictionary({code: "codeCutType"}).then(res=>{ - this.codeCutType = res.data.data; - }) + this.enumParam.codeCutType = this.getLocalStorageEnum("codeCutType"); }, loadCodeGetValueType(){ - getDictionary({code: "codeGetValueType"}).then(res=>{ - this.codeGetValueType = res.data.data; - }) + this.enumParam.codeGetValueType = this.getLocalStorageEnum("codeGetValueType"); }, } @@ -2620,7 +2778,7 @@ .code-rule-crud > .avue-crud__pagination { padding: 14px 0 2px 20px; } - + .clone-input-textarea > .el-form-item__content { width: 495px; } @@ -2640,7 +2798,7 @@ .other-clone-coderule-crud > .el-card> .el-card__body > .avue-crud__menu { display: none!important; } - + .el-table--small .el-table__cell { padding: 3px 0; } @@ -2665,11 +2823,11 @@ } .el-card__body > .treeBox { - height: 50vh; + height: 56vh; } .el-col-5 > .box { - height: 55vh; + height: 56vh; } .operator_,filter, .layui-btn{ @@ -2682,8 +2840,8 @@ .left > .el-form-item > .el-form-item__content > .el-input-number > .el-input > .el-input__inner { width:120px; - } - + } + .el-col>.el-card > .el-card__header { background: rgb(213 231 239); border-radius: inherit; @@ -2692,6 +2850,7 @@ /** 鏂板鐮佹 */ .add-basicsec-total { width: 100%; + padding: 20px 0 0 0; } .add-basicsec-total .el-input__inner,.add-basicsec-total .el-textarea__inner { @@ -2737,4 +2896,8 @@ padding: 5px 10px 10px; } -</style> \ No newline at end of file + .seloption{ + margin-left: 10px; +} + +</style> -- Gitblit v1.9.3