|
@@ -84,10 +84,11 @@ export default {
|
|
|
defaultData.render = (h, { row, index, column }) => {
|
|
|
return this.editIndex == index?(
|
|
|
<div class="redbordererr">
|
|
|
- <el-form-item prop={`tableData.${index}.types`} rules={[{required: true, message: '工单类型不能为空', trigger: 'blur'}]}>
|
|
|
- <el-select value-key="orderSmallTypeText" value={row.types} placeholder="请选择"
|
|
|
+ <el-form-item prop={`tableData.${index}.type`} rules={[{required: true, message: '工单类型不能为空', trigger: 'blur'}]}>
|
|
|
+ <el-select value={{orderSmallTypeText:row.typeName,id: row.type}} value-key="id" placeholder="请选择"
|
|
|
onInput={(val)=>{
|
|
|
- row.types=val
|
|
|
+ row.type = val.id
|
|
|
+ row.typeName = val.orderSmallTypeText
|
|
|
}}>
|
|
|
{
|
|
|
this.typeList.map((item, index) => {
|
|
@@ -104,11 +105,14 @@ export default {
|
|
|
defaultData.render = (h, { row, index, column }) => {
|
|
|
return this.editIndex == index?(
|
|
|
<div class="redbordererr">
|
|
|
- <el-form-item prop={`tableData.${index}.parentCategory`} rules={[{required: true, message: '产品大类不能为空', trigger: 'blur'}]}>
|
|
|
- <el-select value={row.parentCategory} value-key="name" placeholder="请选择"
|
|
|
+ <el-form-item prop={`tableData.${index}.parentCategoryId`} rules={[{required: true, message: '产品大类不能为空', trigger: 'blur'}]}>
|
|
|
+ <el-select value={{categoryId:row.parentCategoryId,name: row.parentCategoryName}} value-key="categoryId" placeholder="请选择"
|
|
|
onInput={(val)=>{
|
|
|
- row.parentCategory=val
|
|
|
- this.smallList = [...[{name: '通用', categoryId: 0}],...val.children]
|
|
|
+ row.parentCategoryId=val.categoryId
|
|
|
+ row.parentCategoryName=val.name
|
|
|
+ row.categoryName = ''
|
|
|
+ row.categoryId = ''
|
|
|
+ this.smallList = [...[{name: '通用', categoryId: '0'}],...(val.children?val.children:[])]
|
|
|
}}>
|
|
|
{
|
|
|
this.mainList.map((item, index) => {
|
|
@@ -125,10 +129,11 @@ export default {
|
|
|
defaultData.render = (h, { row, index, column }) => {
|
|
|
return this.editIndex == index? (
|
|
|
<div class="redbordererr">
|
|
|
- <el-form-item prop={`tableData.${index}.category`} rules={[{required: true, message: '产品小类不能为空', trigger: 'blur'}]}>
|
|
|
- <el-select value={row.category} value-key="name" placeholder="请选择"
|
|
|
+ <el-form-item prop={`tableData.${index}.categoryId`} rules={[{required: true, message: '产品小类不能为空', trigger: 'blur'}]}>
|
|
|
+ <el-select value={{categoryId: row.categoryId,name: row.categoryName}} value-key="categoryId" placeholder="请选择"
|
|
|
onInput={(val)=>{
|
|
|
- row.category=val
|
|
|
+ row.categoryName=val.name
|
|
|
+ row.categoryId=val.categoryId
|
|
|
}}>
|
|
|
{
|
|
|
this.smallList.map((item, index) => {
|
|
@@ -201,14 +206,9 @@ export default {
|
|
|
this.$refs.pageRef.tableForm().validate((valid) => {
|
|
|
if (valid) {
|
|
|
if(this.editIndex != index){
|
|
|
- row = Object.assign(row,{
|
|
|
- types: {orderSmallTypeText: row.typeName,id: row.type},
|
|
|
- parentCategory: {name: row.parentCategoryName,categoryId: row.parentCategoryId},
|
|
|
- category: {name: row.categoryName,categoryId: row.categoryId},
|
|
|
- })
|
|
|
this.mainList.forEach(item =>{
|
|
|
if(item.categoryId == row.parentCategoryId){
|
|
|
- this.smallList = [...[{name: '通用', categoryId: 0}],...item.children]
|
|
|
+ this.smallList = [...[{name: '通用', categoryId: '0'}],...(item.children?item.children:[])]
|
|
|
}
|
|
|
})
|
|
|
this.editIndex = index
|
|
@@ -254,7 +254,8 @@ export default {
|
|
|
},
|
|
|
getMainList(){
|
|
|
getMainList({type: 2}).then(res => {
|
|
|
- this.mainList = [...[{name: '通用', categoryId: 0}],...res.data]
|
|
|
+ this.mainList = [...[{name: '通用', categoryId: '0'}],...res.data]
|
|
|
+ console.log(this.mainList)
|
|
|
})
|
|
|
},
|
|
|
getTypeList(){
|
|
@@ -268,9 +269,12 @@ export default {
|
|
|
this.editIndex = 0
|
|
|
this.$refs.pageRef.insertionData(0,{
|
|
|
settleNormType: 'INSTALL',
|
|
|
- types: '',
|
|
|
- parentCategory: '',
|
|
|
- category: '',
|
|
|
+ typeName: '',
|
|
|
+ type: '',
|
|
|
+ categoryName: '',
|
|
|
+ categoryId: '',
|
|
|
+ parentCategoryName: '',
|
|
|
+ parentCategoryId: '',
|
|
|
label: '',
|
|
|
normAmount: '',
|
|
|
remark: ''
|
|
@@ -287,12 +291,12 @@ export default {
|
|
|
add(row){
|
|
|
add({
|
|
|
settleNormType: 'INSTALL',
|
|
|
- typeName: row.types.orderSmallTypeText,
|
|
|
- type: row.types.id,
|
|
|
- parentCategoryName: row.parentCategory.name,
|
|
|
- parentCategoryId: row.parentCategory.categoryId,
|
|
|
- categoryName: row.category.name,
|
|
|
- categoryId: row.category.categoryId,
|
|
|
+ typeName: row.typeName,
|
|
|
+ type: row.type,
|
|
|
+ parentCategoryName: row.parentCategoryName,
|
|
|
+ parentCategoryId: row.parentCategoryId,
|
|
|
+ categoryName: row.categoryName,
|
|
|
+ categoryId: row.categoryId,
|
|
|
label: row.label,
|
|
|
normAmount: row.normAmount,
|
|
|
remark: row.remark
|
|
@@ -308,12 +312,12 @@ export default {
|
|
|
edit({
|
|
|
id: row.id,
|
|
|
settleNormType: 'INSTALL',
|
|
|
- typeName: row.types.orderSmallTypeText,
|
|
|
- type: row.types.id,
|
|
|
- parentCategoryName: row.parentCategory.name,
|
|
|
- parentCategoryId: row.parentCategory.categoryId,
|
|
|
- categoryName: row.category.name,
|
|
|
- categoryId: row.category.categoryId,
|
|
|
+ typeName: row.typeName,
|
|
|
+ type: row.type,
|
|
|
+ parentCategoryName: row.parentCategoryName,
|
|
|
+ parentCategoryId: row.parentCategoryId,
|
|
|
+ categoryName: row.categoryName,
|
|
|
+ categoryId: row.categoryId,
|
|
|
label: row.label,
|
|
|
normAmount: row.normAmount,
|
|
|
remark: row.remark
|