|
@@ -1,5 +1,5 @@
|
|
|
import { goodsMaterialDetail } from '@/api/commercialMaterial.js'
|
|
|
-import { required } from '@/components/template/rules_verify.js'
|
|
|
+import { required, diyRequired } from '@/components/template/rules_verify.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
return [
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '品牌',
|
|
|
+ label: '*品牌',
|
|
|
prop: 'brandId',
|
|
|
propName: 'brandName',
|
|
|
width: 160
|
|
@@ -23,7 +23,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`items.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -56,7 +62,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '商品大类',
|
|
|
+ label: '*商品大类',
|
|
|
prop: 'mainId',
|
|
|
propName: 'mainName',
|
|
|
width: 160
|
|
@@ -68,7 +74,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`items.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -104,7 +116,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '商品小类',
|
|
|
+ label: '*商品小类',
|
|
|
prop: 'smallId',
|
|
|
propName: 'smallName',
|
|
|
width: 160
|
|
@@ -116,7 +128,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`items.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -154,7 +172,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '商品名称',
|
|
|
+ label: '*商品名称',
|
|
|
prop: 'goodsMaterialId',
|
|
|
propName: 'goodsMaterialName',
|
|
|
width: 160
|
|
@@ -166,7 +184,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`items.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -223,7 +247,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '物料类型',
|
|
|
+ label: '*物料类型',
|
|
|
prop: 'goodsMaterialItemType',
|
|
|
width: 160
|
|
|
},
|
|
@@ -234,7 +258,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -269,7 +299,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '物料名称',
|
|
|
+ label: '*物料名称',
|
|
|
prop: 'goodsMaterialItemId',
|
|
|
propName: 'goodsMaterialItemName',
|
|
|
width: 160
|
|
@@ -281,7 +311,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-select
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -353,7 +389,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '条码',
|
|
|
+ label: '*条码',
|
|
|
prop: 'code',
|
|
|
width: 160
|
|
|
},
|
|
@@ -364,7 +400,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-input
|
|
|
value={row[column.columnAttributes.prop]}
|
|
@@ -382,7 +424,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '数量',
|
|
|
+ label: '*数量',
|
|
|
prop: 'codeQty',
|
|
|
width: 160
|
|
|
},
|
|
@@ -393,7 +435,13 @@ export default {
|
|
|
label=""
|
|
|
lebel-width="0px"
|
|
|
prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
|
|
|
- rules={required}
|
|
|
+ rules={[diyRequired.bind(this)((rule, value)=>{
|
|
|
+ if(this.logs){
|
|
|
+ this.logs.push({index:index, errMsg:`${column.columnAttributes.label}不能为空`})
|
|
|
+ }
|
|
|
+ this?.tishicuowu?.()
|
|
|
+ return new Error('必须填写')
|
|
|
+ })]}
|
|
|
>
|
|
|
<el-input
|
|
|
value={row[column.columnAttributes.prop]}
|