|
@@ -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 {
|
|
@@ -20,25 +25,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={this.orderInfo.isCj ? [] : []}>
|
|
|
|
- <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.orderBrands.find(item => item.value == val)
|
|
|
|
- row.brandName = data.label
|
|
|
|
- } else {
|
|
|
|
- row.brandName = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {this.orderBrands.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={this.orderInfo.isCj ? [] : []}
|
|
|
|
+ >
|
|
|
|
+ <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.orderBrands.find(item => item.value == val)
|
|
|
|
+ row.brandName = data.label
|
|
|
|
+ } else {
|
|
|
|
+ row.brandName = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.orderBrands.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>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -47,29 +66,43 @@ 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={this.orderInfo.isCj ? [] : 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.classifyList.find(item => item.categoryId == val)
|
|
|
|
- row.mainName = data.name
|
|
|
|
- row.imgUrl = data.imgUrl
|
|
|
|
- } else {
|
|
|
|
- row.mainName = ""
|
|
|
|
- row.imgUrl = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {this.classifyList.map((item, index_) => <el-option key={index_} label={item.name} value={item.categoryId}></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={this.orderInfo.isCj ? [] : 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.classifyList.find(item => item.categoryId == val)
|
|
|
|
+ row.mainName = data.name
|
|
|
|
+ row.imgUrl = data.imgUrl
|
|
|
|
+ } else {
|
|
|
|
+ row.mainName = ''
|
|
|
|
+ row.imgUrl = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.classifyList.map((item, index_) => (
|
|
|
|
+ <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
|
|
|
|
+ ))}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row.mainName}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -78,25 +111,41 @@ 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={this.orderInfo.isCj ? [] : []}>
|
|
|
|
- <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.classifyListLv2.find(item => item.categoryId == val)
|
|
|
|
- row.smallName = data.name
|
|
|
|
- } else {
|
|
|
|
- row.smallName = ""
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- placeholder="请选择">
|
|
|
|
- {this.classifyListLv2.filter(item => item.parentId === row.mainId).map((item, index_) => <el-option key={index_} label={item.name} value={item.categoryId}></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={this.orderInfo.isCj ? [] : []}
|
|
|
|
+ >
|
|
|
|
+ <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.classifyListLv2.find(item => item.categoryId == val)
|
|
|
|
+ row.smallName = data.name
|
|
|
|
+ } else {
|
|
|
|
+ row.smallName = ''
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ {this.classifyListLv2
|
|
|
|
+ .filter(item => item.parentId === row.mainId)
|
|
|
|
+ .map((item, index_) => (
|
|
|
|
+ <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
|
|
|
|
+ ))}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ ) : (
|
|
|
|
+ <div style="padding-left:10px">{row.smallName}</div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -105,17 +154,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>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -124,17 +182,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>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -143,17 +206,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={this.orderInfo.isCj ? [] : 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={this.orderInfo.isCj ? [] : 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>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -162,17 +235,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>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
},
|
|
},
|
|
...(() => {
|
|
...(() => {
|
|
@@ -180,22 +258,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(row, index)
|
|
|
|
- }}>删除</el-button>
|
|
|
|
- {this.isEditIndex == index && <el-button type="text" onClick={() => {
|
|
|
|
- this.eidtProduct(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(row, index)
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ {this.isEditIndex == index && (
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.eidtProduct(row, index)
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 确定
|
|
|
|
+ </el-button>
|
|
|
|
+ )}
|
|
|
|
+ {this.isEditIndex == -1 && (
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.isEditIndex = index
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
]
|
|
]
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
@@ -203,74 +302,89 @@ export default {
|
|
]
|
|
]
|
|
},
|
|
},
|
|
product() {
|
|
product() {
|
|
- 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(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(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}
|
|
|
|
- table-data={this.orderInfo.orderProducts}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 新增
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ ) : null}
|
|
|
|
+ <zj-table columns={this.productColumns} table-data={this.orderInfo.orderProducts} />
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }]
|
|
|
|
- },
|
|
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
// 获取品牌
|
|
// 获取品牌
|
|
- getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "BRAND" }] }).then(res => {
|
|
|
|
|
|
+ getDataDictionary({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ params: [
|
|
|
|
+ { param: 'a.status', compare: '=', value: 'ON' },
|
|
|
|
+ { param: 'a.dict_type', compare: '=', value: 'BRAND' }
|
|
|
|
+ ]
|
|
|
|
+ }).then(res => {
|
|
this.orderBrands = res.data.records.map(item => ({
|
|
this.orderBrands = res.data.records.map(item => ({
|
|
value: item.dictCode,
|
|
value: item.dictCode,
|
|
label: item.dictValue
|
|
label: item.dictValue
|
|
@@ -285,7 +399,7 @@ export default {
|
|
return {
|
|
return {
|
|
...data
|
|
...data
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
this.classifyListLv2 = classifyListLv2
|
|
this.classifyListLv2 = classifyListLv2
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -294,9 +408,7 @@ export default {
|
|
return [
|
|
return [
|
|
...(() => {
|
|
...(() => {
|
|
if (bool) {
|
|
if (bool) {
|
|
- return [
|
|
|
|
- `orderProducts`,
|
|
|
|
- ]
|
|
|
|
|
|
+ return [`orderProducts`]
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
})(),
|
|
})(),
|
|
@@ -308,7 +420,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 []
|
|
@@ -320,7 +432,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 || []
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -329,20 +441,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(this.isEditIndex), (v) => {
|
|
|
|
|
|
+ this.appointVerify(this.getVfyKey(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()
|
|
this.getOrderBaseProduct()
|
|
this.getOrderBaseLogList()
|
|
this.getOrderBaseLogList()
|
|
@@ -354,7 +467,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
delProduct(row, index) {
|
|
delProduct(row, index) {
|
|
- this.appointVerify(this.getVfyKey(this.isEditIndex), (v) => {
|
|
|
|
|
|
+ this.appointVerify(this.getVfyKey(this.isEditIndex), v => {
|
|
if (v && this.id && row.id) {
|
|
if (v && this.id && row.id) {
|
|
orderBaseProductDelete({
|
|
orderBaseProductDelete({
|
|
orderProductId: row.id
|
|
orderProductId: row.id
|
|
@@ -367,5 +480,5 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|