|
|
@ -5,15 +5,15 @@ |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> |
|
|
|
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> |
|
|
|
<j-select-depart v-model="model.enterpriseId" /> |
|
|
|
<j-select-depart v-model="model.enterpriseId"/> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-col :span="48"> |
|
|
|
<!-- <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">--> |
|
|
|
<!-- <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">--> |
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />--> |
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<a-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> |
|
|
|
<a-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> |
|
|
|
<j-tree-select v-model="model.clothsTypeId" |
|
|
|
<j-tree-select v-model="model.clothsTypeId" |
|
|
|
dict="zy_cloths_type,type_name,id" |
|
|
|
dict="zy_cloths_type,type_name,id" |
|
|
@ -28,7 +28,7 @@ |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="478"> |
|
|
|
<a-col :span="478"> |
|
|
|
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums"> |
|
|
|
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums"> |
|
|
|
<a-input v-model="model.nums" placeholder="请输入编号" disabled=""></a-input> |
|
|
|
<a-input v-model="model.nums" placeholder="请输入编号" disabled=""></a-input> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
@ -36,17 +36,17 @@ |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName"> |
|
|
|
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName"> |
|
|
|
<a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input> |
|
|
|
<a-input v-model="model.partsName" placeholder="请输入部件名称"></a-input> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
<!-- <a-row>--> |
|
|
|
<!--<a-row>--> |
|
|
|
<!-- <a-col :span="48">--> |
|
|
|
<!-- <a-col :span="48">--> |
|
|
|
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">--> |
|
|
|
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">--> |
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />--> |
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-col>--> |
|
|
|
<!-- </a-col>--> |
|
|
|
<!-- </a-row>--> |
|
|
|
<!--</a-row>--> |
|
|
|
|
|
|
|
|
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-col :span="48"> |
|
|
@ -66,55 +66,44 @@ |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-col :span="48"> |
|
|
|
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl"> |
|
|
|
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl"> |
|
|
|
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload> |
|
|
|
<j-image-upload isMultiple v-model="model.pictureUrl"></j-image-upload> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
<a-row> |
|
|
|
<a-row> |
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
<!--<a-col :span="24">--> |
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
<!-- <j-select-depart v-model="model.enterpriseId" />--> |
|
|
|
<!-- <j-select-depart v-model="model.enterpriseId" />--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-col>--> |
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">--> |
|
|
|
|
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">--> |
|
|
|
|
|
|
|
<!-- <a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">--> |
|
|
|
|
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">--> |
|
|
|
|
|
|
|
<!-- <a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">--> |
|
|
|
|
|
|
|
<!-- <a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">--> |
|
|
|
|
|
|
|
<!-- <j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--<a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">--> |
|
|
|
|
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
<!--<a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">--> |
|
|
|
|
|
|
|
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
<!--<a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">--> |
|
|
|
|
|
|
|
<!-- <a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
<!--<a-col :span="24">--> |
|
|
|
|
|
|
|
<!-- <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">--> |
|
|
|
|
|
|
|
<!-- <j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>--> |
|
|
|
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
<!--<a-col :span="24">--> |
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>--> |
|
|
|
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
<!-- </a-col>--> |
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
|
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
</a-form-model> |
|
|
|
</a-form-model> |
|
|
@ -124,143 +113,142 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage' |
|
|
|
import {httpAction, getAction} from '@/api/manage' |
|
|
|
import { validateDuplicateValue } from '@/utils/util' |
|
|
|
import {validateDuplicateValue} from '@/utils/util' |
|
|
|
import JTreeSelect from '@/components/jeecg/JTreeSelect' |
|
|
|
import JTreeSelect from '@/components/jeecg/JTreeSelect' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'ZyClothsComponentForm', |
|
|
|
name: 'ZyClothsComponentForm', |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
JTreeSelect |
|
|
|
JTreeSelect |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
//表单禁用 |
|
|
|
//表单禁用 |
|
|
|
disabled: { |
|
|
|
disabled: { |
|
|
|
type: Boolean, |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
default: false, |
|
|
|
required: false |
|
|
|
required: false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data() { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
model: { |
|
|
|
|
|
|
|
nums: '', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
labelCol: { |
|
|
|
|
|
|
|
xs: {span: 24}, |
|
|
|
|
|
|
|
sm: {span: 4}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
wrapperCol: { |
|
|
|
|
|
|
|
xs: {span: 24}, |
|
|
|
|
|
|
|
sm: {span: 16}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
confirmLoading: false, |
|
|
|
|
|
|
|
validatorRules: { |
|
|
|
|
|
|
|
// nums: [ |
|
|
|
|
|
|
|
// { required: true, message: '请输入编号!'}, |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
clothsTypeId: [ |
|
|
|
|
|
|
|
{required: true, message: '请选择服装类型!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
partsName: [ |
|
|
|
|
|
|
|
{required: true, message: '请输入部件名称!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
// modularId: [ |
|
|
|
|
|
|
|
// { required: true, message: '请选择模块!'}, |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
modularType: [ |
|
|
|
|
|
|
|
{required: true, message: '请选择制衣模块类型!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
url: { |
|
|
|
|
|
|
|
add: "/base/zyClothsComponent/add", |
|
|
|
|
|
|
|
edit: "/base/zyClothsComponent/edit", |
|
|
|
|
|
|
|
queryById: "/base/zyClothsComponent/queryById", |
|
|
|
|
|
|
|
//编号 |
|
|
|
|
|
|
|
sort: "/base/zyClothsComponent/sort" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
formDisabled() { |
|
|
|
|
|
|
|
return this.disabled |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
}, |
|
|
|
return { |
|
|
|
created() { |
|
|
|
model:{ |
|
|
|
//备份model原始值 |
|
|
|
nums: '', |
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
labelCol: { |
|
|
|
methods: { |
|
|
|
xs: { span: 24 }, |
|
|
|
async getNumberClothsComponentList() { |
|
|
|
sm: { span: 4 }, |
|
|
|
//const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsComponent/sort?id=' + this.model.clothsTypeId) |
|
|
|
}, |
|
|
|
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { |
|
|
|
wrapperCol: { |
|
|
|
if (res.code !== 200) { |
|
|
|
xs: { span: 24 }, |
|
|
|
this.$message({ |
|
|
|
sm: { span: 16 }, |
|
|
|
type: 'error', |
|
|
|
}, |
|
|
|
message: '未查询到数据!' |
|
|
|
confirmLoading: false, |
|
|
|
}); |
|
|
|
validatorRules: { |
|
|
|
|
|
|
|
// nums: [ |
|
|
|
|
|
|
|
// { required: true, message: '请输入编号!'}, |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
clothsTypeId: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择服装类型!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
partsName: [ |
|
|
|
|
|
|
|
{ required: true, message: '请输入部件名称!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
// modularId: [ |
|
|
|
|
|
|
|
// { required: true, message: '请选择模块!'}, |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
modularType: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择制衣模块类型!'}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
url: { |
|
|
|
|
|
|
|
add: "/base/zyClothsComponent/add", |
|
|
|
|
|
|
|
edit: "/base/zyClothsComponent/edit", |
|
|
|
|
|
|
|
queryById: "/base/zyClothsComponent/queryById", |
|
|
|
|
|
|
|
//编号 |
|
|
|
|
|
|
|
sort: "/base/zyClothsComponent/sort" |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.model.nums = res.result; |
|
|
|
|
|
|
|
console.log("制衣部件 编号: " + this.model.nums); |
|
|
|
|
|
|
|
//console.log('res.result') |
|
|
|
|
|
|
|
//console.log(res.result) |
|
|
|
|
|
|
|
//this.confirmLoading = false |
|
|
|
|
|
|
|
// if (this.data.length === 0) { |
|
|
|
|
|
|
|
// this.data.push(res.result) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// bianHao() { |
|
|
|
formDisabled(){ |
|
|
|
// getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { |
|
|
|
return this.disabled |
|
|
|
// let number = res.result; |
|
|
|
}, |
|
|
|
// console.log("制衣部件List id " + this.model.clothsTypeId) |
|
|
|
|
|
|
|
// console.log("制衣部件List 编号 " +number) |
|
|
|
|
|
|
|
// this.model.nums = number; |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
add() { |
|
|
|
|
|
|
|
this.edit(this.modelDefault); |
|
|
|
}, |
|
|
|
}, |
|
|
|
created () { |
|
|
|
edit(record) { |
|
|
|
//备份model原始值 |
|
|
|
this.model = Object.assign({}, record); |
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
this.visible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
submitForm() { |
|
|
|
async getNumberClothsComponentList() { |
|
|
|
const that = this; |
|
|
|
//const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsComponent/sort?id=' + this.model.clothsTypeId) |
|
|
|
// 触发表单验证 |
|
|
|
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { |
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
if (res.code !== 200) { |
|
|
|
if (valid) { |
|
|
|
this.$message({ |
|
|
|
that.confirmLoading = true; |
|
|
|
type: 'error', |
|
|
|
let httpurl = ''; |
|
|
|
message: '未查询到数据!' |
|
|
|
let method = ''; |
|
|
|
}); |
|
|
|
if (!this.model.id) { |
|
|
|
|
|
|
|
httpurl += this.url.add; |
|
|
|
|
|
|
|
method = 'post'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
httpurl += this.url.edit; |
|
|
|
|
|
|
|
method = 'put'; |
|
|
|
} |
|
|
|
} |
|
|
|
this.model.nums = res.result |
|
|
|
httpAction(httpurl, this.model, method).then((res) => { |
|
|
|
//console.log('res.result') |
|
|
|
if (res.success) { |
|
|
|
//console.log(res.result) |
|
|
|
that.$message.success(res.message); |
|
|
|
//this.confirmLoading = false |
|
|
|
that.$emit('ok'); |
|
|
|
// if (this.data.length === 0) { |
|
|
|
} else { |
|
|
|
// this.data.push(res.result) |
|
|
|
that.$message.warning(res.message); |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("制衣部件 编号: "+this.model.nums); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// bianHao() { |
|
|
|
|
|
|
|
// getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { |
|
|
|
|
|
|
|
// let number = res.result; |
|
|
|
|
|
|
|
// console.log("制衣部件List id " + this.model.clothsTypeId) |
|
|
|
|
|
|
|
// console.log("制衣部件List 编号 " +number) |
|
|
|
|
|
|
|
// this.model.nums = number; |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
add () { |
|
|
|
|
|
|
|
this.edit(this.modelDefault); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
edit (record) { |
|
|
|
|
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
|
|
|
this.visible = true; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
submitForm () { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
// 触发表单验证 |
|
|
|
|
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
that.confirmLoading = true; |
|
|
|
|
|
|
|
let httpurl = ''; |
|
|
|
|
|
|
|
let method = ''; |
|
|
|
|
|
|
|
if(!this.model.id){ |
|
|
|
|
|
|
|
httpurl+=this.url.add; |
|
|
|
|
|
|
|
method = 'post'; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
httpurl+=this.url.edit; |
|
|
|
|
|
|
|
method = 'put'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
httpAction(httpurl,this.model,method).then((res)=>{ |
|
|
|
}).finally(() => { |
|
|
|
if(res.success){ |
|
|
|
that.confirmLoading = false; |
|
|
|
that.$message.success(res.message); |
|
|
|
}) |
|
|
|
that.$emit('ok'); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
that.$message.warning(res.message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
|
|
that.confirmLoading = false; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
|
.ant-form-item{ |
|
|
|
.ant-form-item { |
|
|
|
margin-bottom: 16px; |
|
|
|
margin-bottom: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |