Commit 207768f4 authored by ztf's avatar ztf

修改详情页改编号、升版等组件

parent e5898697
......@@ -27,9 +27,9 @@ export default {
type: Object,
default: () => {}
},
dictionariesKey: {
type: {
type: String,
default: () => ''
default: () => null
},
scope: {
type: Object,
......@@ -43,6 +43,11 @@ export default {
},
computed: {},
watch: {
// item(newVal) {
// if (newVal) {
// this.getTypeDictionaries(newVal.key, this.value)
// }
// }
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
......@@ -62,6 +67,10 @@ export default {
})
this.getTypeDictionaries(dictCode, obj)
console.log('obj', obj)
return
} else if (this.item) {
const dictCode = this.item.key.includes('type') ? 'ApplicantType' : 'DesignPhase'
this.getTypeDictionaries(dictCode, this.value)
}
},
methods: {
......
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-13 16:59:49
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-19 17:00:52
* @LastEditTime: 2024-08-22 15:09:44
-->
<template>
<div class="TerminateInternalInterface">
......@@ -16,7 +16,7 @@
/>
<div class="btns">
<el-button type="primary" class="submitBTN" :disabled="!isDisable" @click="tosubmit">确定</el-button>
<el-button type="primary" @click="$emit('cancel')">取消</el-button>
<el-button @click="$emit('cancel')">取消</el-button>
</div>
</div>
</template>
......
<!--
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-16 10:01:47
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-22 13:43:58
-->
<template>
<dee-form
v-dee-loading="loading"
:form="form"
:form-data="propFormData"
:rules="rules"
:form-buttons="formButtons"
form-btn-position="center"
@on-submit="submit"
@on-cancel="close"
/>
<div class="modifyNumber-container">
<el-input
v-model="value"
:rows="2"
type="textarea"
placeholder="请输入新编号"
/>
<div class="btns">
<el-button type="primary" class="submitBTN" :disabled="!isDisable" @click="tosubmit">确定</el-button>
<el-button type="" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
......@@ -17,116 +26,71 @@ export default {
name: 'ModifyNumber',
componentName: '改编号',
props: {
dialogShow: {
type: Boolean,
default: () => false
},
node: {
// businessTab: {
// type: Object,
// default: () => null
// },
basicData: {
type: Object,
default: () => {}
},
businessTab: {
type: Object,
default: () => null
}
},
data() {
return {
loading: false,
propFormData: [{
split: 3,
data: [
{
key: 'number',
width: 3,
component: {
name: 'el-input',
type: 'textarea',
rows: '2',
placeholder: '请输入新编号'
}
}
]
}],
formButtons: [
{
'text': '确定',
'type': 'submit',
'component': {
'type': 'primary'
}
},
{
'text': '取消',
'type': 'cancel',
'component': {
}
}
],
rules: {
},
form: {}
value: ''
}
},
watch: {
dialogShow: {
immediate: true,
handler: function(flag) {
if (flag) {
this.init()
} else {
this.clear()
}
}
computed: {
isDisable() {
return this.value
}
},
watch: {
},
// 生命周期 - 创建完成(访问当前this实例)
created() {},
// 生命周期 - 挂载完成(访问DOM元素)
mounted() {},
mounted() {
},
methods: {
submit() {
if (this.loading) {
return
}
this.loading = true
get(`/${this.modelName}/version/reNameNumber/${this.form.id}`, { name: this.form.name, number: this.form.number }).then(res => {
this.$emit('close')
this.refresh(res.items)
}).filnally(() => {
this.loading = false
tosubmit() {
get(`/DxDocument/version/reNameNumber/${this.basicData.id}`, { name: this.basicData.name, number: this.value }).then(res => {
this.$emit('cancel')
this.$emit('completeEven')
// this.refresh(res.items)
})
},
refresh(items) {
if (!this.businessTab || !items) {
return
}
const id = items.id
const subTypeName = items.subTypeName
const modelName = this.$utils.getModelName4dxClassName(items)
const newlink = {
path: `/generalDetail/${id}/${subTypeName}/${modelName}`
}
this.businessTab.reload({ type: 'updateVersion', id: items.id }, newlink)
},
close() {
this.$emit('close')
},
init() {
if (this.node && this.node.id) {
this.form.id = this.node.id
this.form.phaseState = this.node.phaseState || ''
}
},
clear() {
this.form = {}
// refresh(items) {
// const id = items.id
// const subTypeName = items.subTypeName
// const modelName = this.$utils.getModelName4dxClassName(items)
// const newlink = {
// path: `/generalDetail/${id}/${subTypeName}/${modelName}`
// }
// this.businessTab.reload({ type: 'updateVersion', id: items.id }, newlink)
// },
handleCancel() {
this.value = ''
this.$emit('cancel')
}
}
}
</script>
<style lang='scss' scoped>
.modifyNumber-container{
height: 80%;
.FeatureTypicalcom{
height: calc(100% - 50px);
}
.btns{
margin-top: 20px;
display: flex;
justify-content: center;
.submitBTN{
margin-right: 25px;
}
}
}
<style lang="scss">
</style>
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-07-31 14:50:38
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-13 15:05:20
* @LastEditTime: 2024-08-23 09:56:57
-->
<template>
<dee-form
......@@ -93,7 +93,7 @@ export default {
}
],
rules: {
deleteType: [
phaseState: [
{ required: true, message: '请选择阶段', trigger: 'change' }
],
changeReason: [
......@@ -111,6 +111,7 @@ export default {
immediate: true,
handler: function(val) {
if (val) {
console.log('init')
this.init()
} else {
this.clear()
......@@ -128,29 +129,31 @@ export default {
return
}
this.loading = true
post(`/DxDocument/ext/version/${this.form.id}/revise`, this.form).then(res => {
post(`/DxDocument/ext/version/${this.basicData.id}/revise`, this.form).then(res => {
this.$emit('cancel')
this.refresh(res.items)
this.$emit('completeEven')
}).filnally(() => {
this.loading = false
})
},
refresh(items) {
if (!this.businessTab || !items) {
return
}
const id = items.id
const subTypeName = items.subTypeName
const modelName = this.$utils.getModelName4dxClassName(items)
const newlink = {
path: `/generalDetail/${id}/${subTypeName}/${modelName}`
}
this.businessTab.reload({ type: 'updateVersion', id: items.id }, newlink)
},
// refresh(items) {
// if (!this.businessTab || !items) {
// return
// }
// const id = items.id
// const subTypeName = items.subTypeName
// const modelName = this.$utils.getModelName4dxClassName(items)
// const newlink = {
// path: `/generalDetail/${id}/${subTypeName}/${modelName}`
// }
// this.businessTab.reload({ type: 'updateVersion', id: items.id }, newlink)
// },
cancel() {
this.form = {}
this.$emit('cancel')
},
init() {
console.log('this.basicData', this.basicData)
if (this.basicData && this.basicData.id) {
this.form.id = this.basicData.id
this.form.phaseState = this.basicData.phaseState || ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment