|
|
|
@ -5,15 +5,15 @@ |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="48"> |
|
|
|
|
<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-col> |
|
|
|
|
</a-row> |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="48"> |
|
|
|
|
<!-- <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-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-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> |
|
|
|
|
<j-tree-select v-model="model.clothsTypeId" |
|
|
|
|
dict="zy_cloths_type,type_name,id" |
|
|
|
@ -28,7 +28,7 @@ |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="478"> |
|
|
|
|
<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-col> |
|
|
|
|
</a-row> |
|
|
|
@ -36,17 +36,17 @@ |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="48"> |
|
|
|
|
<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-col> |
|
|
|
|
</a-row> |
|
|
|
|
<!-- <a-row>--> |
|
|
|
|
<!-- <a-col :span="48">--> |
|
|
|
|
<!-- <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-row>--> |
|
|
|
|
<!--<a-row>--> |
|
|
|
|
<!-- <a-col :span="48">--> |
|
|
|
|
<!-- <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-row>--> |
|
|
|
|
|
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="48"> |
|
|
|
@ -66,55 +66,44 @@ |
|
|
|
|
</a-row> |
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="48"> |
|
|
|
|
<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-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-row> |
|
|
|
|
<a-row> |
|
|
|
|
<!-- <a-col :span="24">--> |
|
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
|
<!-- <j-select-depart v-model="model.enterpriseId" />--> |
|
|
|
|
<!-- </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="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="enterpriseId">--> |
|
|
|
|
<!-- <j-select-depart v-model="model.enterpriseId" />--> |
|
|
|
|
<!-- </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-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
|
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>--> |
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
<!--<a-col :span="24">--> |
|
|
|
|
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> |
|
|
|
|
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>--> |
|
|
|
|
<!-- </a-form-model-item>--> |
|
|
|
|
<!--</a-col>--> |
|
|
|
|
|
|
|
|
|
</a-row> |
|
|
|
|
</a-form-model> |
|
|
|
@ -124,143 +113,142 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage' |
|
|
|
|
import { validateDuplicateValue } from '@/utils/util' |
|
|
|
|
import JTreeSelect from '@/components/jeecg/JTreeSelect' |
|
|
|
|
import {httpAction, getAction} from '@/api/manage' |
|
|
|
|
import {validateDuplicateValue} from '@/utils/util' |
|
|
|
|
import JTreeSelect from '@/components/jeecg/JTreeSelect' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'ZyClothsComponentForm', |
|
|
|
|
components: { |
|
|
|
|
JTreeSelect |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
|
//表单禁用 |
|
|
|
|
disabled: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
required: false |
|
|
|
|
export default { |
|
|
|
|
name: 'ZyClothsComponentForm', |
|
|
|
|
components: { |
|
|
|
|
JTreeSelect |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
|
//表单禁用 |
|
|
|
|
disabled: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: 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 { |
|
|
|
|
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" |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
//备份model原始值 |
|
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async getNumberClothsComponentList() { |
|
|
|
|
//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) => { |
|
|
|
|
if (res.code !== 200) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '未查询到数据!' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
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: { |
|
|
|
|
formDisabled(){ |
|
|
|
|
return this.disabled |
|
|
|
|
}, |
|
|
|
|
// 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); |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
//备份model原始值 |
|
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
|
edit(record) { |
|
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
this.visible = true; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async getNumberClothsComponentList() { |
|
|
|
|
//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) => { |
|
|
|
|
if (res.code !== 200) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '未查询到数据!' |
|
|
|
|
}); |
|
|
|
|
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'; |
|
|
|
|
} |
|
|
|
|
this.model.nums = res.result |
|
|
|
|
//console.log('res.result') |
|
|
|
|
//console.log(res.result) |
|
|
|
|
//this.confirmLoading = false |
|
|
|
|
// if (this.data.length === 0) { |
|
|
|
|
// this.data.push(res.result) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
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) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
that.$message.success(res.message); |
|
|
|
|
that.$emit('ok'); |
|
|
|
|
} else { |
|
|
|
|
that.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
httpAction(httpurl,this.model,method).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
that.$message.success(res.message); |
|
|
|
|
that.$emit('ok'); |
|
|
|
|
}else{ |
|
|
|
|
that.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
that.confirmLoading = false; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
that.confirmLoading = false; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style scoped> |
|
|
|
|
.ant-form-item{ |
|
|
|
|
margin-bottom: 16px; |
|
|
|
|
} |
|
|
|
|
.ant-form-item { |
|
|
|
|
margin-bottom: 16px; |
|
|
|
|
} |
|
|
|
|
</style> |