From c56a6893b203f38b54311ec50d4a4bbaa16c67a0 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 24 十月 2023 14:39:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/views/code/codeApply.vue | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 161 insertions(+), 4 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/code/codeApply.vue b/Source/UBCS-WEB/src/views/code/codeApply.vue
index 0475372..c9df49d 100644
--- a/Source/UBCS-WEB/src/views/code/codeApply.vue
+++ b/Source/UBCS-WEB/src/views/code/codeApply.vue
@@ -18,6 +18,7 @@
key="masterForm" data-key="masterForm"
v-bind="$attrs"
:type="type"
+ :LoadingStatus="status"
:TreeValue="TreeValue"
:eventList="eventList"
ref="FormTemplate"
@@ -35,8 +36,15 @@
@getFormData="getCodeApplyFormData"
@referConfigDataUpdate="referConfigDataUpdate"
></FormTemplate>
+ <el-button
+ @click="submit()"
+ type="primary"
+ size="small"
+ style="float: right"
+ >淇濆瓨</el-button>
</el-tab-pane>
</el-tabs>
+
</div>
</basic-container>
</el-col>
@@ -44,15 +52,48 @@
</template>
<script>
-import {getAuthTree,getUsedTemplateByClassifyOid,getCodeRule} from '@/api/code/codeApply.js'
+import {getAuthTree,getUsedTemplateByClassifyOid,getCodeRule,addSaveCode} from '@/api/code/codeApply.js'
export default {
name: "codeApply",
components: { FormTemplate: () => import('@/components/FormTemplate/FormTemplate') },
data() {
return {
+ defaultKeys: [
+ "oid",
+ "id",
+ "name",
+ "description",
+ "revisionoid",
+ "nameoid",
+ "btmname",
+ "lastr",
+ "firstr",
+ "lastv",
+ "firstv",
+ "creator",
+ "createtime",
+ "lastModifier",
+ "lastmodifytime",
+ "revisionrule",
+ "revisionseq",
+ "revisionvalue",
+ "versionrule",
+ "versionseq",
+ "versionvalue",
+ "lcstatus",
+ "ts",
+ "owner",
+ "checkinby",
+ "checkintime",
+ "checkoutby",
+ "checkouttime",
+ "copyfromversion",
+ "secretgrade",
+ ],
codeClassifyOid:'',
type:'add',
+ status:'code',
TreeValue:'',
dialogVisible:true,
setForm:{},
@@ -61,6 +102,8 @@
activeName: "codeApply",
showCodeApply: false,
eventList:[],
+ showResembleQuery:false,
+ hasResemble:false,
form: {},
TreeData:[],
TreeOption: {
@@ -110,6 +153,106 @@
this.getTreeData()
},
methods:{
+ async submit() {
+ // 杩涜琛ㄥ崟鏍¢獙
+ const formValidate = await this.$refs.FormTemplate.validate();
+ if (!formValidate) return;
+ let codeValidate = true;
+ // 杩涜鐮佸�肩敵璇锋牎楠�
+ // if (this.showCodeApply) {
+ // codeValidate = await this.$refs.CodeApply.validate();
+ // if (!codeValidate) {
+ // this.activeName = "codeApply";
+ // return false;
+ // }
+ // }
+ let resembleQueryList = [];
+ if (this.showResembleQuery && this.$refs.resembleQueryRef) {
+ // 杩涜鐩镐技椤规煡璇�
+ resembleQueryList = await this.$refs.resembleQueryRef.resembleQuery(
+ this.form
+ );
+ }
+ if (resembleQueryList.length > 0) {
+ await this.$confirm(
+ `璇ョ墿鏂欏凡鏈�${resembleQueryList.length}鏉$浉浼兼暟鎹紝鏄惁缁х画淇濆瓨锛焋,
+ "闇�瑕佹偍纭",
+ {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }
+ );
+ }
+ // 鎺掗櫎涓�浜涘瓧娈�
+ const noData = [
+ "jiliangdwname",
+ "materialtypeText",
+ "morengongysname",
+ "$caigouwl",
+ "$xiaoshouwl",
+ "$shifoupihaoguanli",
+ "lcstatus_text",
+ "hesuanfenleiname",
+ "$kucunwl",
+ "oldcode",
+ "lastmodifier"
+ ];
+ let resForm = {};
+ const { defaultValue, formValue } = this.getDefaultValueAndFormValues(
+ this.form
+ );
+ noData.forEach((item) => {
+ this.$delete(formValue, item);
+ });
+ const keys = Object.keys(formValue);
+ keys.forEach((item, index) => {
+ keys.forEach((itm, idx) => {
+ if ((item === ('$' + itm)) && idx !== index) {
+ this.$delete(formValue, keys[index]);
+ }
+ })
+ });
+
+ resForm.data = formValue;
+ resForm = Object.assign({}, resForm, defaultValue);
+ resForm.secDTOList = this.secVOList.map((item) => {
+ return {
+ secOid: item.oid,
+ secValue: this.codeApplyForm[item.oid],
+ };
+ });
+ resForm.codeClassifyOid = this.codeClassifyOid;
+ resForm.codeRuleOid = this.codeRuleOid;
+ resForm.templateOid = this.templateOid;
+ // this.$emit("submit", resForm);
+ addSaveCode(resForm).then(res => {
+ this.$nextTick(() => {
+ this.addvisible = false;
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.onLoad()
+ })
+ })
+ console.log(resForm)
+ },
+ getDefaultValueAndFormValues(form) {
+ let defaultValue = {};
+ let formValue = {};
+ for (const key in form) {
+ if (Object.hasOwnProperty.call(form, key)) {
+ const element = form[key];
+ if (this.defaultKeys.includes(key)) {
+ defaultValue[key] = element;
+ } else {
+ formValue[key] = element;
+ }
+ }
+ }
+ return {
+ defaultValue,
+ formValue,
+ };
+ },
getFormData(form) {
this.form = form;
},
@@ -139,14 +282,28 @@
});
},
nodeClick(row){
- // console.log(row)
+ console.log(row)
this.TreeValue=row.text.split(" ")[0].trim();
this.codeClassifyOid = row.oid;
getUsedTemplateByClassifyOid({ 'codeClassifyOid': this.codeClassifyOid,templateOid:' 97e979919a1f1dca67290e85fee22688' }).then((res) => {
console.log('===res',res)
- if (res.data.code === 200) {
+ if (res.status === 200) {
+ this.hasResemble =
+ res.data.resembleTableVO &&
+ res.data.resembleTableVO.cols &&
+ res.data.resembleTableVO.cols.length > 0;
+ this.resembleTableColumn = res.data.resembleTableVO.cols || [];
+ if (this.hasResemble) {
+ this.activeName = "resembleQuery";
+ this.showResembleQuery = true;
+ } else {
+ this.showResembleQuery = false;
+ }
this.$nextTick(() => {
- this.eventList=res.data.data.attributes
+ this.$refs.FormTemplate.templateRender(
+ res.data.formDefineVO.items
+ );
+ this.eventList=res.data.templateVO.attributes
// this.$refs.FormTemplate.$emit('eventList', res.data.templateVO.attributes);
if (Object.keys(this.setForm).length > 0) {
this.$refs.FormTemplate.form = this.setForm;
--
Gitblit v1.9.3