|
@@ -1,7 +1,12 @@
|
|
import { getClassifyList } from '@/api/goods'
|
|
import { getClassifyList } from '@/api/goods'
|
|
import { getDataDictionary } from '@/api/dataDictionary.js'
|
|
import { getDataDictionary } from '@/api/dataDictionary.js'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
-import { orderBaseProductList, orderBaseProductAdd, orderBaseProductUpdate, orderBaseProductDelete } from "@/api/workOrderPool.js"
|
|
|
|
|
|
+import {
|
|
|
|
+ orderBaseProductList,
|
|
|
|
+ orderBaseProductAdd,
|
|
|
|
+ orderBaseProductUpdate,
|
|
|
|
+ orderBaseProductDelete
|
|
|
|
+} from '@/api/workOrderPool.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -18,25 +23,39 @@ export default {
|
|
prop: 'brandId'
|
|
prop: 'brandId'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
|
- <el-select
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- onChange={(val) => {
|
|
|
|
- if (val) {
|
|
|
|
- var data = this.huoquweiyi('brandId', 'brandName').find(item => item.value == val)
|
|
|
|
- row.brandName = data.label
|
|
|
|
- } else {
|
|
|
|
- row.brandName = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {this.huoquweiyi('brandId', 'brandName').map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row.brandName}</div>
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item
|
|
|
|
+ label=""
|
|
|
|
+ label-width="0px"
|
|
|
|
+ prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
|
|
|
|
+ rules={required}
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ onChange={val => {
|
|
|
|
+ if (val) {
|
|
|
|
+ var data = this.huoquweiyi('brandId', 'brandName').find(item => item.value == val)
|
|
|
|
+ row.brandName = data.label
|
|
|
|
+ } else {
|
|
|
|
+ row.brandName = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.huoquweiyi('brandId', 'brandName').map((item, index_) => (
|
|
|
|
+ <el-option key={index_} label={item.label} value={item.value}></el-option>
|
|
|
|
+ ))}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row.brandName}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -45,33 +64,53 @@ export default {
|
|
prop: 'mainId'
|
|
prop: 'mainId'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
|
- <el-select
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- onChange={(val) => {
|
|
|
|
- row.smallId = ""
|
|
|
|
- row.smallName = ""
|
|
|
|
- if (val) {
|
|
|
|
- var data = this.huoquweiyi('mainId', 'mainName').filter(item => {
|
|
|
|
- return !!this.productList_wb.filter(v => v.mainId == item.value).find(v2 => v2.brandId == row.brandId)
|
|
|
|
- }).find(item => item.value == val)
|
|
|
|
- row.mainName = data.label
|
|
|
|
- } else {
|
|
|
|
- row.mainName = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {
|
|
|
|
- this.huoquweiyi('mainId', 'mainName').filter(item => {
|
|
|
|
- return !!this.productList_wb.filter(v => v.mainId == item.value).find(v2 => v2.brandId == row.brandId)
|
|
|
|
- }).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)
|
|
|
|
- }
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row.mainName}</div>
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item
|
|
|
|
+ label=""
|
|
|
|
+ label-width="0px"
|
|
|
|
+ prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
|
|
|
|
+ rules={required}
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ onChange={val => {
|
|
|
|
+ row.smallId = ''
|
|
|
|
+ row.smallName = ''
|
|
|
|
+ if (val) {
|
|
|
|
+ var data = this.huoquweiyi('mainId', 'mainName')
|
|
|
|
+ .filter(item => {
|
|
|
|
+ return !!this.productList_wb
|
|
|
|
+ .filter(v => v.mainId == item.value)
|
|
|
|
+ .find(v2 => v2.brandId == row.brandId)
|
|
|
|
+ })
|
|
|
|
+ .find(item => item.value == val)
|
|
|
|
+ row.mainName = data.label
|
|
|
|
+ } else {
|
|
|
|
+ row.mainName = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.huoquweiyi('mainId', 'mainName')
|
|
|
|
+ .filter(item => {
|
|
|
|
+ return !!this.productList_wb
|
|
|
|
+ .filter(v => v.mainId == item.value)
|
|
|
|
+ .find(v2 => v2.brandId == row.brandId)
|
|
|
|
+ })
|
|
|
|
+ .map((item, index_) => (
|
|
|
|
+ <el-option key={index_} label={item.label} value={item.value}></el-option>
|
|
|
|
+ ))}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row.mainName}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -80,33 +119,53 @@ export default {
|
|
prop: 'smallId'
|
|
prop: 'smallId'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
|
- <el-select
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- onChange={(val) => {
|
|
|
|
- if (val) {
|
|
|
|
- var data = this.huoquweiyi('smallId', 'smallName', "smallImg").filter(item => {
|
|
|
|
- return !!this.productList_wb.filter(v => v.smallId == item.value).find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
|
|
|
|
- }).find(item => item.value == val)
|
|
|
|
- row.smallName = data.label
|
|
|
|
- row.imgUrl = data.smallImg
|
|
|
|
- } else {
|
|
|
|
- row.smallName = ""
|
|
|
|
- row.imgUrl = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {
|
|
|
|
- this.huoquweiyi('smallId', 'smallName', "smallImg").filter(item => {
|
|
|
|
- return !!this.productList_wb.filter(v => v.smallId == item.value).find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
|
|
|
|
- }).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)
|
|
|
|
- }
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row.smallName}</div>
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item
|
|
|
|
+ label=""
|
|
|
|
+ label-width="0px"
|
|
|
|
+ prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
|
|
|
|
+ rules={required}
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ onChange={val => {
|
|
|
|
+ if (val) {
|
|
|
|
+ var data = this.huoquweiyi('smallId', 'smallName', 'smallImg')
|
|
|
|
+ .filter(item => {
|
|
|
|
+ return !!this.productList_wb
|
|
|
|
+ .filter(v => v.smallId == item.value)
|
|
|
|
+ .find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
|
|
|
|
+ })
|
|
|
|
+ .find(item => item.value == val)
|
|
|
|
+ row.smallName = data.label
|
|
|
|
+ row.imgUrl = data.smallImg
|
|
|
|
+ } else {
|
|
|
|
+ row.smallName = ''
|
|
|
|
+ row.imgUrl = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.huoquweiyi('smallId', 'smallName', 'smallImg')
|
|
|
|
+ .filter(item => {
|
|
|
|
+ return !!this.productList_wb
|
|
|
|
+ .filter(v => v.smallId == item.value)
|
|
|
|
+ .find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
|
|
|
|
+ })
|
|
|
|
+ .map((item, index_) => (
|
|
|
|
+ <el-option key={index_} label={item.label} value={item.value}></el-option>
|
|
|
|
+ ))}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row.smallName}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -115,17 +174,26 @@ export default {
|
|
prop: 'productName'
|
|
prop: 'productName'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`}>
|
|
|
|
- <el-input
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item
|
|
|
|
+ label=""
|
|
|
|
+ label-width="0px"
|
|
|
|
+ prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
|
|
>
|
|
>
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -134,17 +202,22 @@ export default {
|
|
prop: 'insideCode'
|
|
prop: 'insideCode'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px">
|
|
|
|
- <el-input
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- >
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
|
+ <el-input
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -153,17 +226,27 @@ export default {
|
|
prop: 'num'
|
|
prop: 'num'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
|
- <el-input
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item
|
|
|
|
+ label=""
|
|
|
|
+ label-width="0px"
|
|
|
|
+ prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
|
|
|
|
+ rules={required}
|
|
>
|
|
>
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -172,17 +255,22 @@ export default {
|
|
prop: 'remark'
|
|
prop: 'remark'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return this.isEditIndex == index ? <div class="redbordererr">
|
|
|
|
- <el-form-item label="" label-width="0px">
|
|
|
|
- <el-input
|
|
|
|
- disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- >
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
|
|
+ return this.isEditIndex == index ? (
|
|
|
|
+ <div class="redbordererr">
|
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
|
+ <el-input
|
|
|
|
+ disabled={!this.formOptions.orderProducts.isEdit}
|
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
|
+ onInput={val => {
|
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
...(() => {
|
|
...(() => {
|
|
@@ -190,22 +278,43 @@ export default {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
columnAttributes: {
|
|
columnAttributes: {
|
|
- label: '操作',
|
|
|
|
|
|
+ label: '操作'
|
|
},
|
|
},
|
|
render: (h, { row, column, index }) => {
|
|
render: (h, { row, column, index }) => {
|
|
- return <div style="padding-left:10px">
|
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
|
- this.delProduct_wb(row, index)
|
|
|
|
- }}>删除</el-button>
|
|
|
|
- {this.isEditIndex == index && <el-button type="text" onClick={() => {
|
|
|
|
- this.eidtProduct_wb(row, index)
|
|
|
|
- }}>确定</el-button>}
|
|
|
|
- {this.isEditIndex == -1 && <el-button type="text" onClick={() => {
|
|
|
|
- this.isEditIndex = index
|
|
|
|
- }}>编辑</el-button>}
|
|
|
|
- </div>
|
|
|
|
|
|
+ return (
|
|
|
|
+ <div style="padding-left:10px">
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.delProduct_wb(row, index)
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ {this.isEditIndex == index && (
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.eidtProduct_wb(row, index)
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 确定
|
|
|
|
+ </el-button>
|
|
|
|
+ )}
|
|
|
|
+ {this.isEditIndex == -1 && (
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.isEditIndex = index
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
]
|
|
]
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
@@ -213,70 +322,78 @@ export default {
|
|
]
|
|
]
|
|
},
|
|
},
|
|
product_wb() {
|
|
product_wb() {
|
|
- return [{
|
|
|
|
- isShow: this.formOptions.orderProducts.isShow,
|
|
|
|
- name: 'slot-component',
|
|
|
|
- md: 24,
|
|
|
|
- formItemAttributes: {
|
|
|
|
- label: '',
|
|
|
|
- 'label-width': '0px',
|
|
|
|
- prop: 'orderProducts',
|
|
|
|
- errLabel: '产品信息',
|
|
|
|
- rules: this.formOptions.orderProducts.isRules
|
|
|
|
- },
|
|
|
|
- render: (h, { props }) => {
|
|
|
|
- return (
|
|
|
|
- <div>
|
|
|
|
- {this.formOptions.orderProducts.isEdit ? <div>
|
|
|
|
- <el-button size="mini" type="primary" onClick={() => {
|
|
|
|
- this.appointVerify(this.getVfyKey_wb(this.isEditIndex, false), (v) => {
|
|
|
|
- if (v) {
|
|
|
|
- try {
|
|
|
|
- this.orderInfo.orderProducts.map((item, index_) => {
|
|
|
|
- var row = this.orderInfo.orderProducts[index_ + 1]
|
|
|
|
- if (row) {
|
|
|
|
- if (
|
|
|
|
- `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` == `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}`
|
|
|
|
- ) {
|
|
|
|
- throw new Error('');
|
|
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ isShow: this.formOptions.orderProducts.isShow,
|
|
|
|
+ name: 'slot-component',
|
|
|
|
+ md: 24,
|
|
|
|
+ formItemAttributes: {
|
|
|
|
+ label: '',
|
|
|
|
+ 'label-width': '0px',
|
|
|
|
+ prop: 'orderProducts',
|
|
|
|
+ errLabel: '产品信息',
|
|
|
|
+ rules: this.formOptions.orderProducts.isRules
|
|
|
|
+ },
|
|
|
|
+ render: (h, { props }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ {this.formOptions.orderProducts.isEdit ? (
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.appointVerify(this.getVfyKey_wb(this.isEditIndex, false), v => {
|
|
|
|
+ if (v) {
|
|
|
|
+ try {
|
|
|
|
+ this.orderInfo.orderProducts.map((item, index_) => {
|
|
|
|
+ var row = this.orderInfo.orderProducts[index_ + 1]
|
|
|
|
+ if (row) {
|
|
|
|
+ if (
|
|
|
|
+ `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
|
|
|
|
+ `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}`
|
|
|
|
+ ) {
|
|
|
|
+ throw new Error('')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.warning('产品机型重复')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
+ this.isEditIndex = 0
|
|
|
|
+ this.orderInfo.orderProducts.unshift({
|
|
|
|
+ brandId: '',
|
|
|
|
+ brandName: '',
|
|
|
|
+ createBy: '',
|
|
|
|
+ createTime: '',
|
|
|
|
+ mainId: '',
|
|
|
|
+ mainName: '',
|
|
|
|
+ num: '',
|
|
|
|
+ insideCode: '',
|
|
|
|
+ orderBaseId: this.id || '',
|
|
|
|
+ productId: '',
|
|
|
|
+ productName: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ smallId: '',
|
|
|
|
+ smallName: '',
|
|
|
|
+ imgUrl: ''
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- } catch (error) {
|
|
|
|
- this.$message.warning('产品机型重复')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- this.isEditIndex = 0
|
|
|
|
- this.orderInfo.orderProducts.unshift({
|
|
|
|
- "brandId": "",
|
|
|
|
- "brandName": "",
|
|
|
|
- "createBy": "",
|
|
|
|
- "createTime": "",
|
|
|
|
- "mainId": "",
|
|
|
|
- "mainName": "",
|
|
|
|
- "num": "",
|
|
|
|
- "insideCode": "",
|
|
|
|
- "orderBaseId": this.id || '',
|
|
|
|
- "productId": "",
|
|
|
|
- "productName": "",
|
|
|
|
- "remark": "",
|
|
|
|
- "smallId": "",
|
|
|
|
- "smallName": "",
|
|
|
|
- "imgUrl": ""
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }}>新增</el-button>
|
|
|
|
- </div> : null}
|
|
|
|
- <zj-table
|
|
|
|
- columns={this.productColumns_wb}
|
|
|
|
- table-data={this.orderInfo.orderProducts}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 新增
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ ) : null}
|
|
|
|
+ <zj-table columns={this.productColumns_wb} table-data={this.orderInfo.orderProducts} />
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }]
|
|
|
|
- },
|
|
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
huoquweiyi(value, label, ...keys) {
|
|
huoquweiyi(value, label, ...keys) {
|
|
@@ -300,9 +417,7 @@ export default {
|
|
return [
|
|
return [
|
|
...(() => {
|
|
...(() => {
|
|
if (bool) {
|
|
if (bool) {
|
|
- return [
|
|
|
|
- `orderProducts`,
|
|
|
|
- ]
|
|
|
|
|
|
+ return [`orderProducts`]
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
})(),
|
|
})(),
|
|
@@ -314,7 +429,7 @@ export default {
|
|
`orderProducts.${index}.smallId`,
|
|
`orderProducts.${index}.smallId`,
|
|
`orderProducts.${index}.productName`,
|
|
`orderProducts.${index}.productName`,
|
|
`orderProducts.${index}.num`,
|
|
`orderProducts.${index}.num`,
|
|
- `orderProducts.${index}.remark`,
|
|
|
|
|
|
+ `orderProducts.${index}.remark`
|
|
]
|
|
]
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
@@ -326,7 +441,7 @@ export default {
|
|
if (this.id) {
|
|
if (this.id) {
|
|
orderBaseProductList({
|
|
orderBaseProductList({
|
|
orderBaseId: this.id
|
|
orderBaseId: this.id
|
|
- }).then((res) => {
|
|
|
|
|
|
+ }).then(res => {
|
|
this.orderInfo.orderProducts = res.data || []
|
|
this.orderInfo.orderProducts = res.data || []
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -335,20 +450,21 @@ export default {
|
|
try {
|
|
try {
|
|
this.orderInfo.orderProducts.map((item, index_) => {
|
|
this.orderInfo.orderProducts.map((item, index_) => {
|
|
if (
|
|
if (
|
|
- `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` == `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}` &&
|
|
|
|
|
|
+ `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
|
|
|
|
+ `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}` &&
|
|
index_ != index
|
|
index_ != index
|
|
) {
|
|
) {
|
|
- throw new Error('');
|
|
|
|
|
|
+ throw new Error('')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.$message.warning('产品机型重复')
|
|
this.$message.warning('产品机型重复')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.appointVerify(this.getVfyKey_wb(this.isEditIndex), (v) => {
|
|
|
|
|
|
+ this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
|
|
if (v) {
|
|
if (v) {
|
|
if (this.id) {
|
|
if (this.id) {
|
|
- [orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
|
|
|
|
|
|
+ ;[orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
|
|
this.isEditIndex = -1
|
|
this.isEditIndex = -1
|
|
this.getOrderBaseProduct_wb()
|
|
this.getOrderBaseProduct_wb()
|
|
this.getOrderBaseLogList()
|
|
this.getOrderBaseLogList()
|
|
@@ -360,7 +476,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
delProduct_wb(row, index) {
|
|
delProduct_wb(row, index) {
|
|
- this.appointVerify(this.getVfyKey_wb(this.isEditIndex), (v) => {
|
|
|
|
|
|
+ this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
|
|
if (v && this.id && row.id) {
|
|
if (v && this.id && row.id) {
|
|
orderBaseProductDelete({
|
|
orderBaseProductDelete({
|
|
orderProductId: row.id
|
|
orderProductId: row.id
|
|
@@ -373,5 +489,5 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|