|
|
@@ -53,7 +53,7 @@
|
|
|
header="编码配置"
|
|
|
body-style="padding: 22px 22px 0 22px;"
|
|
|
>
|
|
|
- <myTable ref="myTable"></myTable>
|
|
|
+ <myTable ref="myTable" :codeConfigurationList="codeConfigurationList"></myTable>
|
|
|
</el-card>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -71,7 +71,6 @@ export default {
|
|
|
components:{
|
|
|
myTable
|
|
|
},
|
|
|
- watch: {},
|
|
|
data() {
|
|
|
return {
|
|
|
addRoleDialog: false,
|
|
|
@@ -85,6 +84,8 @@ export default {
|
|
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
code: [{ required: true, message: '请输入编码', trigger: 'blur' }]
|
|
|
},
|
|
|
+ codeConfigurationList:[],
|
|
|
+ openType:'add',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -94,10 +95,17 @@ export default {
|
|
|
open(type,row) {
|
|
|
if(type == 'add'){
|
|
|
this.dialogTitle = '新建编码规则'
|
|
|
+ this.codeConfigurationList = []
|
|
|
}else if(type == 'edit'){
|
|
|
this.dialogTitle = '编辑编码规则'
|
|
|
+ getCodeDetail(row.id).then(res=>{
|
|
|
+ this.addForm = {...res}
|
|
|
+ if(this.addForm.codeConfigurationList) delete this.addForm.codeConfigurationList
|
|
|
+ this.codeConfigurationList = res.codeConfigurationList
|
|
|
+ })
|
|
|
}
|
|
|
this.addRoleDialog = true;
|
|
|
+ this.openType = type
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.restForm();
|
|
|
@@ -125,14 +133,29 @@ export default {
|
|
|
})
|
|
|
Promise.all([a1, a2]).then(() => {
|
|
|
const codeConfigurationList = this.$refs.myTable.getTableValue()
|
|
|
+ // codeConfigurationList.map(item=>{
|
|
|
+ // item.type = item.type.code
|
|
|
+ // })
|
|
|
let par = {
|
|
|
code: this.addForm.code,
|
|
|
name: this.addForm.name,
|
|
|
remark: this.addForm.remark,
|
|
|
- codeConfigurationList:codeConfigurationList
|
|
|
+ codeConfigurationList:codeConfigurationList,
|
|
|
+ codeManageTreeId: 1
|
|
|
};
|
|
|
- saveNew(par).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ if(this.openType == 'edit'){
|
|
|
+ par.id = this.addForm.id
|
|
|
+ }
|
|
|
+ saveNew(par).then(res => {
|
|
|
+ console.log('res',res)
|
|
|
+ this.loading = false;
|
|
|
+ this.addRoleDialog = false
|
|
|
+ this.$message.success(res);
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.message);
|
|
|
});
|
|
|
})
|
|
|
|