From a5453cb3440e4536b5d5dc5e74e48df482836065 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 08 十二月 2023 12:08:33 +0800 Subject: [PATCH] 码段新增和修改时限制层级类型为最小层级时,层级的值不可输入,并且校验只能输入数字 --- Source/UBCS-WEB/src/views/code/code.vue | 288 ++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 173 insertions(+), 115 deletions(-) diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue index e5f4d23..7a37895 100644 --- a/Source/UBCS-WEB/src/views/code/code.vue +++ b/Source/UBCS-WEB/src/views/code/code.vue @@ -220,107 +220,107 @@ <!-- 鍩虹鐮佹灞曠ず鍖哄煙 --> <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> <!-- 鐮佹鐮佸�肩鐞嗗璇濇 --> @@ -592,7 +592,7 @@ > <!-- 绗竴灞傚璇濇,娣诲姞鐮佹淇℃伅瀵硅瘽妗嗕腑鐨勫唴瀹� --> <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" @@ -888,11 +888,11 @@ <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> @@ -911,6 +911,7 @@ v-model="form.codeLevelType" :disabled="basicSecOnlyRead" placeholder="璇烽�夋嫨" + @change="changeLevelType" > <el-option v-for="item in enumParam.codeLevelType" @@ -929,6 +930,7 @@ ref="codeLevelValue" v-model.number="form.codeLevelValue" :readonly="basicSecOnlyRead" + :disabled="form.codeLevelType != 'code_level_special'" ></el-input> </el-form-item> <el-form-item @@ -1028,9 +1030,9 @@ <!-- 鏃ユ湡鐮佹 --> <div v-show="form.secType === 'codedatesec' ? true : false"> <el-form-item - prop="Dateformat" :label-width="rightFormLabelWidth" label="鏃ユ湡鏍煎紡:" + prop="Dateformat" > <el-input ref="codeDateFormatStr" @@ -1348,7 +1350,7 @@ import vciWebRefer from "../../components/refer/vciWebRefer"; export default { - components: { vciWebRefer }, + components: {vciWebRefer}, data() { return { rules: { @@ -1357,7 +1359,28 @@ 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', + 'yy-MM', + 'yyMM', + 'yyyy-MM', + 'yyyyMM', + 'yy-MM-dd', + 'yyMMdd', + 'yyyy-MM-dd', + 'yyyyMMdd', + 'yyyy-MM-dd HH:mm:ss', + 'yy-MM-dd HH:mm:ss', + 'HH:mm:ss', + 'yyyyMMdd HH:mm:ss', + 'yyMMdd HH:mm:ss', + 'yyyy-MM-dd HHmmss', + 'yy-MM-dd HHmmss', + 'yyyyMMdd HHmmss', + 'yyMMdd HHmmss', + 'HHmmss' + ]; if (!Formats.includes(this.form.codeDateFormatStr)) { return callback(new Error('璇疯緭鍏ユ纭棩鏈熸牸寮忥紝渚嬪yyyy-MM-dd锛堝苟鍖哄垎澶у皬鍐欙級锛�')); } @@ -1366,19 +1389,19 @@ } ] }, - 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', @@ -1720,8 +1743,8 @@ }, 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 || ""; @@ -2313,6 +2336,7 @@ }, /** 涓婄Щ涓嬬Щ绛夋搷浣滅殑淇濆瓨*/ async saveCodeFixedOrClassifyValueOption(condition, editOrderNumdata) { + //淇濆瓨瀵瑰浐瀹氱爜娈电爜鍊肩殑涓婄Щ涓嬬Щ绉诲嚭绛夋搷浣� if (condition == "fixedValue") { let data = { @@ -2448,6 +2472,8 @@ }, { data: [], + + title: "鎻忚堪", fieldType: "text", queryField: "description", @@ -2508,8 +2534,8 @@ /** 鍙戝竷缂栫爜瑙勫垯 */ async enableOrDeactivatse(oid, update) { if (update === "release") { - this.releadDisabled = true; // 閬垮厤鐢ㄦ埛閲嶅鐐瑰嚮鎸夐挳 + this.releadDisabled = true; await checkLikeCodeRule(oid) .then((res) => { //console.log(res) @@ -2784,7 +2810,7 @@ } //console.log(this.form); //涓篺orm缁戝畾鍊� - this.changeSectypeFormItems(condition == "add" ? null:row); + this.changeSectypeFormItems(condition == "add" ? null : row); this.addBasicCodeSettingBox = true; }, /** 鏂板鍩虹鐮佹*/ @@ -2808,7 +2834,7 @@ type: "success", message: "鎿嶄綔鎴愬姛!", }); - console.log(this.form) + // console.log(this.form) // 鍏抽棴瀵硅瘽妗� this.addBasicCodeSettingBox = false; // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇 @@ -3014,6 +3040,32 @@ this.$refs.codeDateFormatStr.$el.querySelector("input").focus(); return false; } + const Formats = [ + 'yy', + 'yyyy', + 'yy-MM', + 'yyMM', + 'yyyy-MM', + 'yyyyMM', + 'yy-MM-dd', + 'yyMMdd', + 'yyyy-MM-dd', + 'yyyyMMdd', + 'yyyy-MM-dd HH:mm:ss', + 'yy-MM-dd HH:mm:ss', + 'HH:mm:ss', + 'yyyyMMdd HH:mm:ss', + 'yyMMdd HH:mm:ss', + 'yyyy-MM-dd HHmmss', + 'yy-MM-dd HHmmss', + 'yyyyMMdd HHmmss', + 'yyMMdd HHmmss', + 'HHmmss' + ]; + if (!Formats.includes(this.form.codeDateFormatStr)) { + this.$message.warning('璇锋鏌ユ棩鏈熸牸寮忥紒'); + return; + } } else if (this.form.secType === "codeclassifysec") { //鍒嗙被鐮佹 if (form.codeSecLengthType == "") { @@ -3059,6 +3111,12 @@ } return true; }, + /** 灞傜骇鐮佹閫夋嫨涓烘渶灏忓眰绾ф椂娓呯┖灞傜骇鐨勫�� */ + changeLevelType(){ + if(this.form.codeLevelType === 'code_level_min'){ + this.form.codeLevelValue = ''; + } + }, /** 鍒ゆ柇鏁版嵁鏄惁閫夋嫨浠ュ強鍙兘閫夋嫨鍗曟潯鏁版嵁*/ tipsMessage(list) { if (list.length != 1) { -- Gitblit v1.9.3