aXin-0810 1 anno fa
parent
commit
1ccbc2fbfb

+ 52 - 0
src/api/merchandisePurchaseReturn.js

@@ -47,3 +47,55 @@ export function goodsPurchaseRetCodeListExport(data, name) {
     name
   })
 }
+
+export function goodsPurchaseRetAdd(data) {
+  return request({
+    url: `/goods/purchase/ret/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetSubmit(params) {
+  return request({
+    url: `/goods/purchase/ret/submit`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetConfirm(params) {
+  return request({
+    url: `/goods/purchase/ret/confirm`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetDetail(params) {
+  return request({
+    url: `/goods/purchase/ret/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetItemImportCode(data) {
+  return handleImport('/goods/purchase/ret/item/import/code', data.formdata, data.id || '')
+}
+
+export function goodsPurchaseRetItemAddCode(data) {
+  return request({
+    url: `/goods/purchase/ret/item/add/code`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetItemDelCode(params) {
+  return request({
+    url: `/goods/purchase/ret/item/del/code`,
+    method: 'post',
+    params
+  })
+}

+ 5 - 3
src/views/salesPurchasing/goodsPurchasedStored/index.vue

@@ -13,7 +13,7 @@
     key="pageType"
   >
     <div slot="moreSearch">
-      <el-radio-group v-model="pageType" size="mini" @input="radioGroup">
+      <el-radio-group v-model="pageType" size="mini" @input="changePageType">
         <el-radio-button label="list">列表</el-radio-button>
         <el-radio-button label="goodsder">商品明细</el-radio-button>
         <el-radio-button label="codeder">条码明细</el-radio-button>
@@ -74,9 +74,10 @@ import form_ty from '../mixins/form_ty'
 import storage_table from '../mixins/storage_table'
 import storage_goods from '../mixins/storage_goods'
 import storage_codes from '../mixins/storage_codes'
+import common from '../mixins/common'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin, operation_mixin, form_ty, storage_table, storage_goods, storage_codes],
+  mixins: [import_mixin, operation_mixin, form_ty, storage_table, storage_goods, storage_codes, common],
   data() {
     return {
       pageType: 'list',
@@ -158,7 +159,7 @@ export default {
     }
   },
   methods: {
-    radioGroup() {
+    changePageType() {
       this.goods_material_id = ''
     },
     // 列表请求函数
@@ -219,6 +220,7 @@ export default {
       this.$data.formData = this.$options.data().formData
       this.formDialog = false
       this.formDialogType = 0
+      this.activeName = 'goodsInfo'
     },
     // 操作按钮
     operation() {

+ 125 - 9
src/views/salesPurchasing/merchandisePurchaseReturn/index.vue

@@ -9,6 +9,7 @@
     :moreParameters="moreParameters"
     :column-parsing="columnParsing"
     :exportList="exportList"
+    :operation="operation()"
     key="pageType"
   >
     <div slot="moreSearch">
@@ -63,14 +64,20 @@ import {
   goodsPurchaseRetItemList,
   goodsPurchaseRetItemListExport,
   goodsPurchaseRetCodeList,
-  goodsPurchaseRetCodeListExport
+  goodsPurchaseRetCodeListExport,
+  goodsPurchaseRetAdd,
+  goodsPurchaseRetSubmit,
+  goodsPurchaseRetConfirm,
+  goodsPurchaseRetDetail
 } from '@/api/merchandisePurchaseReturn.js'
 import form_ty from '../mixins/form_ty'
 import out_storage_table from '../mixins/out_storage_table'
 import out_storage_goods from '../mixins/out_storage_goods'
+import out_storage_codes from '../mixins/out_storage_codes'
+import common from '../mixins/common'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin, operation_mixin, form_ty, out_storage_table, out_storage_goods],
+  mixins: [import_mixin, operation_mixin, form_ty, out_storage_table, out_storage_goods, out_storage_codes, common],
   data() {
     return {
       pageType: 'list',
@@ -103,8 +110,8 @@ export default {
         status: '',
         submitBy: '',
         submitTime: '',
-        totalAmount: 0,
-        totalQty: 0,
+        totalAmount: '',
+        totalQty: '',
         venderId: '',
         venderName: '',
         codeInfoList: []
@@ -150,6 +157,9 @@ export default {
     }
   },
   methods: {
+    changePageType() {
+      this.goods_material_id = ''
+    },
     // 列表请求函数
     getList(p, cb) {
       if (this.pageType == 'list') {
@@ -157,7 +167,14 @@ export default {
       } else if (this.pageType == 'goodsder') {
         return goodsPurchaseRetItemList(p)
       } else if (this.pageType == 'codeder') {
-        return goodsPurchaseRetCodeList(p)
+        if (this.goods_material_id) {
+          return goodsPurchaseRetCodeList({
+            ...p,
+            params: [...p.params, { param: 'b.goods_material_id', compare: '=', value: this.goods_material_id }]
+          })
+        } else {
+          return goodsPurchaseRetCodeList(p)
+        }
       }
     },
     // 列表导出函数
@@ -181,17 +198,113 @@ export default {
     // 打开创建弹窗
     openForm() {
       this.getGysList()
+      this.getCgrkOrder()
+    },
+    // 打开详情弹窗
+    openDetailForm(row, type) {
+      goodsPurchaseRetDetail({ id: row.id }).then(res => {
+        Object.assign(this.formData, res.data, {
+          fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+          items: res.data.items.map(item => ({ ...item, details: {} }))
+        })
+        this.formDialogType = type
+        this.openForm()
+        this.formDialog = true
+      })
     },
-    changePageType() {},
     handleClose() {
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
       this.formDialog = false
+      this.formDialogType = 0
+      this.activeName = 'goodsInfo'
+    },
+    // 操作按钮
+    operation() {
+      if (this.pageType == 'list') {
+        return this.operationBtn({
+          edit: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'SAVE'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 1)
+            }
+          },
+          detail: {
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 2)
+            }
+          },
+          shenhe: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'WAIT'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 3)
+            }
+          }
+        })
+      } else if (this.pageType == 'goodsder') {
+        return this.operationBtn({
+          codeDetail: {
+            click: ({ row, index, column }) => {
+              this.goods_material_id = row.goodsMaterialId
+              this.pageType = 'codeder'
+            }
+          }
+        })
+      } else if (this.pageType == 'codeder') {
+        return undefined
+      }
     },
     // 保存
-    save() {},
+    save() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          goodsPurchaseRetAdd({
+            ...this.formData,
+            items: this.formData.items,
+            fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+            codeInfoList: undefined
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '保存成功'
+            })
+            this.handleClose()
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    },
     // 提交
-    submit() {},
+    submit() {
+      goodsPurchaseRetSubmit({
+        id: this.formData.id
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '提交成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    },
     // 审核
-    examine() {}
+    examine() {
+      goodsPurchaseRetConfirm({
+        id: this.formData.id,
+        statusEnum: 'OK'
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '审核成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    }
   }
 }
 </script>
@@ -200,4 +313,7 @@ export default {
 .tab {
   padding: 20px 20px 0 20px;
 }
+::v-deep .teshudeshangchuananniu {
+  color: #409eff !important;
+}
 </style>

+ 567 - 0
src/views/salesPurchasing/mixins/common.js

@@ -0,0 +1,567 @@
+import { goodsMaterialDetail } from '@/api/commercialMaterial.js'
+import { required } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1
+    }
+  },
+  computed: {
+    storage_codes() {
+      return [
+        {
+          columnAttributes: {
+            label: '品牌',
+            prop: 'brandId',
+            propName: 'brandName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 0)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(this.formData.items, {
+                          value: 'brandId',
+                          label: 'brandName'
+                        }).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(this.formData.items, { value: 'brandId', label: '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:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品大类',
+            prop: 'mainId',
+            propName: 'mainName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 1)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(
+                          this.formData.items.filter(item => item.brandId === row.brandId),
+                          { value: 'mainId', label: 'mainName' }
+                        ).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(item => item.brandId === row.brandId),
+                      { value: 'mainId', label: 'mainName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品小类',
+            prop: 'smallId',
+            propName: 'smallName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 2)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(
+                          this.formData.items.filter(
+                            item => item.brandId === row.brandId && item.mainId === row.mainId
+                          ),
+                          { value: 'smallId', label: 'smallName' }
+                        ).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(item => item.brandId === row.brandId && item.mainId === row.mainId),
+                      { value: 'smallId', label: 'smallName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品名称',
+            prop: 'goodsMaterialId',
+            propName: 'goodsMaterialName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 3)
+                      if (val) {
+                        var data = this.arrQC(
+                          this.formData.items.filter(
+                            item =>
+                              item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                          ),
+                          { value: 'goodsMaterialId', label: 'goodsMaterialName' }
+                        ).find(item => item.value == val)
+                        this.getGoodsDetl(data?.data, res => {}, 'goodsMaterialId')
+                        row[column.columnAttributes.propName] = data.label
+                        row['specsName'] = data?.data?.specsName
+                        row['goodsPurchaseItemId'] = data?.data?.id
+                        row['goodsPurchaseRetItemId'] = data?.data?.id
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                        row['specsName'] = ''
+                        row['goodsPurchaseItemId'] = ''
+                        row['goodsPurchaseRetItemId'] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(
+                        item =>
+                          item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                      ),
+                      { value: 'goodsMaterialId', label: 'goodsMaterialName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specsName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料类型',
+            prop: 'goodsMaterialItemType',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 4)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {[
+                      { value: 'INSIDE', label: '内机' },
+                      { value: 'OUT', label: '外机' },
+                      { value: 'PARTS', label: '配件' }
+                    ].map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">
+                {[
+                  { value: 'INSIDE', label: '内机' },
+                  { value: 'OUT', label: '外机' },
+                  { value: 'PARTS', label: '配件' }
+                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料名称',
+            prop: 'goodsMaterialItemId',
+            propName: 'goodsMaterialItemName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 5)
+                      if (val) {
+                        var data = (
+                          this.formData.items.find(
+                            item =>
+                              item.brandId === row.brandId &&
+                              item.mainId === row.mainId &&
+                              item.smallId === row.smallId &&
+                              item.goodsMaterialId === row.goodsMaterialId
+                          )?.details?.items || []
+                        )
+                          .filter(item => item.type == row.goodsMaterialItemType)
+                          .find(item => item.id == val)
+                        row[column.columnAttributes.propName] = data.name
+                        row['uniqueCode'] = data.uniqueCode
+                        row['codeQty'] = data.uniqueCode == 'YES' ? 1 : ''
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                        row['uniqueCode'] = ''
+                        row['codeQty'] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {(
+                      this.formData.items.find(
+                        item =>
+                          item.brandId === row.brandId &&
+                          item.mainId === row.mainId &&
+                          item.smallId === row.smallId &&
+                          item.goodsMaterialId === row.goodsMaterialId
+                      )?.details?.items || []
+                    )
+                      .filter(item => item.type == row.goodsMaterialItemType)
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.id}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否一物一码',
+            prop: 'uniqueCode',
+            width: 120
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="padding:0 6px">
+                {[
+                  { value: 'YES', label: '是' },
+                  { value: 'NO', label: '否' }
+                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '条码',
+            prop: 'code',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'codeQty',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index && row.uniqueCode == 'NO' ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        ...(() => {
+          if (this.formDialogType < 2) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      {this.formDialogType == 0
+                        ? null
+                        : this.formDialogType == 1
+                        ? [
+                            this.isEditIndex == index ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  this.addCode(row)
+                                }}
+                              >
+                                保存
+                              </el-button>
+                            ) : null,
+                            this.isEditIndex == -1 ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  this.getGoodsDetl(
+                                    this.formData.items.find(
+                                      item =>
+                                        item.brandId === row.brandId &&
+                                        item.mainId === row.mainId &&
+                                        item.smallId === row.smallId &&
+                                        item.goodsMaterialId === row.goodsMaterialId
+                                    ),
+                                    res => {
+                                      this.isEditIndex = index
+                                    },
+                                    'goodsMaterialId'
+                                  )
+                                }}
+                              >
+                                编辑
+                              </el-button>
+                            ) : null,
+                            <el-button
+                              type="text"
+                              onClick={() => {
+                                this.delCode(row, index)
+                              }}
+                            >
+                              删除
+                            </el-button>
+                          ]
+                        : null}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    }
+  },
+  methods: {
+    // 获取商品详情
+    getGoodsDetl(row, cb, key = 'id') {
+      if (!row?.details?.id) {
+        goodsMaterialDetail({ id: row[key] }).then(res => {
+          Object.assign(row.details, res.data || {})
+          cb(row.details)
+        })
+      } else {
+        cb(row.details)
+      }
+    },
+    arrQC(list, qz = { label: '', value: '' }) {
+      var obj = {}
+      for (var item of list) {
+        obj[item[qz?.value || 'value']] = item
+      }
+      return Object.keys(obj).map(key => {
+        return {
+          data: obj[key],
+          value: key,
+          label: obj[key][qz?.label || 'label']
+        }
+      })
+    },
+    shanchuCodejichu(row, num) {
+      if (num <= 0) {
+        row.mainId = ''
+        row.mainName = ''
+      }
+      if (num <= 1) {
+        row.smallId = ''
+        row.smallName = ''
+      }
+      if (num <= 2) {
+        row.goodsMaterialId = ''
+        row.goodsMaterialName = ''
+        row.goodsPurchaseItemId = ''
+        row.goodsPurchaseRetItemId = ''
+        row.specsName = ''
+      }
+      if (num <= 3) {
+        row.goodsMaterialItemType = ''
+      }
+      if (num <= 4) {
+        row.goodsMaterialItemId = ''
+        row.goodsMaterialItemName = ''
+        row.codeQty = ''
+      }
+      if (num <= 5) {
+        row.uniqueCode = ''
+        row.code = ''
+      }
+    },
+    getCodeVfyKey() {
+      return [
+        `codeInfoList.${this.isEditIndex}.brandId`,
+        `codeInfoList.${this.isEditIndex}.mainId`,
+        `codeInfoList.${this.isEditIndex}.smallId`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialId`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialItemType`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialItemId`,
+        `codeInfoList.${this.isEditIndex}.code`,
+        `codeInfoList.${this.isEditIndex}.codeQty`
+      ]
+    },
+    eidtCodeItems() {
+      // try {
+      //   this.formData.codeInfoList.map((item, index) => {
+      //     this.formData.codeInfoList.map((item2, index2) => {
+      //       if (
+      //         index !== index2 &&
+      //         `${item.brandId}_${item.mainId}_${item.smallId}_${item.goodsMaterialId}_${item.goodsMaterialItemType}_${item.goodsMaterialItemId}` ==
+      //           `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}_${item2.goodsMaterialItemType}_${item2.goodsMaterialItemId}`
+      //       ) {
+      //         throw new Error('')
+      //       }
+      //     })
+      //   })
+      // } catch (error) {
+      //   this.$message.warning('重复')
+      //   return false
+      // }
+      return true
+    }
+  }
+}

+ 76 - 0
src/views/salesPurchasing/mixins/out_storage_codes.js

@@ -0,0 +1,76 @@
+import {
+  goodsPurchaseRetCodeList,
+  goodsPurchaseRetItemAddCode,
+  goodsPurchaseRetItemDelCode
+} from '@/api/merchandisePurchaseReturn.js'
+export default {
+  data() {
+    return {}
+  },
+  methods: {
+    getGoodsPurchaseRetCodeList() {
+      if (this.formData.id) {
+        goodsPurchaseRetCodeList({
+          pageNum: 1,
+          pageSize: -1,
+          params: [{ param: 'c.goods_purchase_ret_id', compare: '=', value: this.formData.id }]
+        }).then(res => {
+          this.formData.codeInfoList = res.data.records
+          console.log(this.formData.codeInfoList)
+        })
+      }
+    },
+    // 添加条码信息
+    addCodeInfo() {
+      this.formData.codeInfoList.unshift({
+        brandId: '',
+        brandName: '',
+        mainId: '',
+        mainName: '',
+        smallId: '',
+        smallName: '',
+        goodsMaterialId: '',
+        goodsMaterialName: '',
+        specsName: '',
+        goodsMaterialItemType: '',
+        goodsMaterialItemId: '',
+        goodsMaterialItemName: '',
+        uniqueCode: '',
+        code: '',
+        codeQty: '',
+        goodsPurchaseRetItemId: '',
+        goodsPurchaseRetId: this.formData.id
+      })
+      this.isEditIndex = 0
+    },
+    addCode(row) {
+      if (this.isEditIndex > -1) {
+        this.$refs.formRef.validateField(this.getCodeVfyKey(), (valid, invalidFields, errLabels) => {
+          if (valid && this.eidtCodeItems()) {
+            goodsPurchaseRetItemAddCode({
+              codeList: [{ ...row }]
+            }).then(res => {
+              this.isEditIndex = -1
+              this.getGoodsPurchaseRetCodeList()
+            })
+          }
+        })
+      }
+    },
+    delCode(row, index) {
+      if (row.id) {
+        goodsPurchaseRetItemDelCode({
+          codeId: row.id,
+          id: row.goodsPurchaseRetId
+        }).then(res => {
+          this.getGoodsPurchaseRetCodeList()
+        })
+      } else {
+        this.formData?.codeInfoList?.splice(index, 1)
+        if (index == this.isEditIndex) {
+          this.isEditIndex = -1
+        }
+      }
+    }
+  }
+}

+ 2 - 3
src/views/salesPurchasing/mixins/out_storage_goods.js

@@ -1,4 +1,5 @@
 import { required } from '@/components/template/rules_verify.js'
+import { goodsPurchaseRetItemImportCode } from '@/api/merchandisePurchaseReturn.js'
 export default {
   data() {
     return {}
@@ -50,7 +51,6 @@ export default {
             return <div style="padding:0 6px">{{ C: '整套', I: '单个' }[row[column.columnAttributes.prop]] || ''}</div>
           }
         },
-        // --------------------
         {
           columnAttributes: {
             label: '退货数量',
@@ -143,7 +143,6 @@ export default {
             width: 160
           }
         },
-        // ------------------
         {
           columnAttributes: {
             label: '采购数量',
@@ -211,7 +210,7 @@ export default {
                           删除
                         </el-button>
                       ) : !!~['SAVE'].indexOf(this.formData.status) ? (
-                        this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id })
+                        this.importButton(goodsPurchaseRetItemImportCode, '导入条码', { purchaseRetItemId: row.id })
                       ) : null}
                     </div>
                   )

+ 19 - 19
src/views/salesPurchasing/mixins/out_storage_table.js

@@ -1,4 +1,4 @@
-import { goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
+import { goodsPurchaseRetDetail } from '@/api/merchandisePurchaseReturn.js'
 import { commonTemplateDownload } from '@/api/common.js'
 export default {
   data() {
@@ -48,7 +48,7 @@ export default {
                         </div>
                       ) : null,
                       <zj-table
-                        columns={[]}
+                        columns={this.storage_codes}
                         tableData={this.formData.codeInfoList}
                         tableAttributes={{
                           size: 'mini',
@@ -69,16 +69,16 @@ export default {
       this.isEditIndex = -1
       if (newVal == 'codeInfo') {
         // 获取单据下的条码
-        // this.getGoodsPurchaseCodeList()
+        this.getGoodsPurchaseRetCodeList()
       } else {
         if (this.formData.id) {
           // 更新表单信息
-          // goodsPurchaseDetail({ id: this.formData.id }).then(res => {
-          //   Object.assign(this.formData, res.data, {
-          //     fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
-          //     items: res.data.items.map(item => ({ ...item, details: {} }))
-          //   })
-          // })
+          goodsPurchaseRetDetail({ id: this.formData.id }).then(res => {
+            Object.assign(this.formData, res.data, {
+              fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+              items: res.data.items.map(item => ({ ...item, details: {} }))
+            })
+          })
         }
         // 清空条码数据列表
         this.formData.codeInfoList = []
@@ -87,16 +87,16 @@ export default {
   },
   methods: {
     domlMban() {
-      // commonTemplateDownload({ name: '商品采购条码模板.xlsx' }, `${this.$route.meta.title}`)
-      //   .then(res => {
-      //     this.$message({
-      //       message: '下载成功',
-      //       type: 'success'
-      //     })
-      //   })
-      //   .catch(err => {
-      //     this.$message.error('下载失败')
-      //   })
+      commonTemplateDownload({ name: '商品采购条码模板.xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
     }
   }
 }

+ 1 - 543
src/views/salesPurchasing/mixins/storage_codes.js

@@ -1,4 +1,3 @@
-import { required } from '@/components/template/rules_verify.js'
 import {
   goodsPurchaseItemAddCode,
   goodsPurchaseCodeList,
@@ -8,477 +7,8 @@ export default {
   data() {
     return {}
   },
-  computed: {
-    storage_codes() {
-      return [
-        {
-          columnAttributes: {
-            label: '品牌',
-            prop: 'brandId',
-            propName: 'brandName',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`items.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 0)
-                      if (val) {
-                        row[column.columnAttributes.propName] = this.arrQC(this.formData.items, {
-                          value: 'brandId',
-                          label: 'brandName'
-                        }).find(item => item.value == val).label
-                      } else {
-                        row[column.columnAttributes.propName] = ''
-                      }
-                    }}
-                    placeholder="请选择"
-                  >
-                    {this.arrQC(this.formData.items, { value: 'brandId', label: '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:0 6px">{row[column.columnAttributes.propName]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '商品大类',
-            prop: 'mainId',
-            propName: 'mainName',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`items.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 1)
-                      if (val) {
-                        row[column.columnAttributes.propName] = this.arrQC(
-                          this.formData.items.filter(item => item.brandId === row.brandId),
-                          { value: 'mainId', label: 'mainName' }
-                        ).find(item => item.value == val).label
-                      } else {
-                        row[column.columnAttributes.propName] = ''
-                      }
-                    }}
-                    placeholder="请选择"
-                  >
-                    {this.arrQC(
-                      this.formData.items.filter(item => item.brandId === row.brandId),
-                      { value: 'mainId', label: 'mainName' }
-                    ).map((item, index_) => (
-                      <el-option key={index_} label={item.label} value={item.value}></el-option>
-                    ))}
-                  </el-select>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '商品小类',
-            prop: 'smallId',
-            propName: 'smallName',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`items.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 2)
-                      if (val) {
-                        row[column.columnAttributes.propName] = this.arrQC(
-                          this.formData.items.filter(
-                            item => item.brandId === row.brandId && item.mainId === row.mainId
-                          ),
-                          { value: 'smallId', label: 'smallName' }
-                        ).find(item => item.value == val).label
-                      } else {
-                        row[column.columnAttributes.propName] = ''
-                      }
-                    }}
-                    placeholder="请选择"
-                  >
-                    {this.arrQC(
-                      this.formData.items.filter(item => item.brandId === row.brandId && item.mainId === row.mainId),
-                      { value: 'smallId', label: 'smallName' }
-                    ).map((item, index_) => (
-                      <el-option key={index_} label={item.label} value={item.value}></el-option>
-                    ))}
-                  </el-select>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '商品名称',
-            prop: 'goodsMaterialId',
-            propName: 'goodsMaterialName',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`items.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 3)
-                      if (val) {
-                        var data = this.arrQC(
-                          this.formData.items.filter(
-                            item =>
-                              item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
-                          ),
-                          { value: 'goodsMaterialId', label: 'goodsMaterialName' }
-                        ).find(item => item.value == val)
-                        this.getGoodsDetl(data?.data, res => {}, 'goodsMaterialId')
-                        row[column.columnAttributes.propName] = data.label
-                        row['specsName'] = data?.data?.specsName
-                        row['goodsPurchaseItemId'] = data?.data?.id
-                      } else {
-                        row[column.columnAttributes.propName] = ''
-                        row['specsName'] = ''
-                        row['goodsPurchaseItemId'] = ''
-                      }
-                    }}
-                    placeholder="请选择"
-                  >
-                    {this.arrQC(
-                      this.formData.items.filter(
-                        item =>
-                          item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
-                      ),
-                      { value: 'goodsMaterialId', label: 'goodsMaterialName' }
-                    ).map((item, index_) => (
-                      <el-option key={index_} label={item.label} value={item.value}></el-option>
-                    ))}
-                  </el-select>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '规格型号',
-            prop: 'specsName',
-            width: 120
-          }
-        },
-        {
-          columnAttributes: {
-            label: '物料类型',
-            prop: 'goodsMaterialItemType',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 4)
-                    }}
-                    placeholder="请选择"
-                  >
-                    {[
-                      { value: 'INSIDE', label: '内机' },
-                      { value: 'OUT', label: '外机' },
-                      { value: 'PARTS', label: '配件' }
-                    ].map((item, index_) => (
-                      <el-option key={index_} label={item.label} value={item.value}></el-option>
-                    ))}
-                  </el-select>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">
-                {[
-                  { value: 'INSIDE', label: '内机' },
-                  { value: 'OUT', label: '外机' },
-                  { value: 'PARTS', label: '配件' }
-                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
-              </div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '物料名称',
-            prop: 'goodsMaterialItemId',
-            propName: 'goodsMaterialItemName',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-select
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    onChange={val => {
-                      this.shanchuCodejichu(row, 5)
-                      if (val) {
-                        var data = (
-                          this.formData.items.find(
-                            item =>
-                              item.brandId === row.brandId &&
-                              item.mainId === row.mainId &&
-                              item.smallId === row.smallId &&
-                              item.goodsMaterialId === row.goodsMaterialId
-                          )?.details?.items || []
-                        )
-                          .filter(item => item.type == row.goodsMaterialItemType)
-                          .find(item => item.id == val)
-                        row[column.columnAttributes.propName] = data.name
-                        row['uniqueCode'] = data.uniqueCode
-                        row['codeQty'] = data.uniqueCode == 'YES' ? 1 : ''
-                      } else {
-                        row[column.columnAttributes.propName] = ''
-                        row['uniqueCode'] = ''
-                        row['codeQty'] = ''
-                      }
-                    }}
-                    placeholder="请选择"
-                  >
-                    {(
-                      this.formData.items.find(
-                        item =>
-                          item.brandId === row.brandId &&
-                          item.mainId === row.mainId &&
-                          item.smallId === row.smallId &&
-                          item.goodsMaterialId === row.goodsMaterialId
-                      )?.details?.items || []
-                    )
-                      .filter(item => item.type == row.goodsMaterialItemType)
-                      .map((item, index_) => (
-                        <el-option key={index_} label={item.name} value={item.id}></el-option>
-                      ))}
-                  </el-select>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '是否一物一码',
-            prop: 'uniqueCode',
-            width: 120
-          },
-          render: (h, { row, column, index }) => {
-            return (
-              <div style="padding:0 6px">
-                {[
-                  { value: 'YES', label: '是' },
-                  { value: 'NO', label: '否' }
-                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
-              </div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '条码',
-            prop: 'code',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-input
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    placeholder="请输入"
-                  ></el-input>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '数量',
-            prop: 'codeQty',
-            width: 160
-          },
-          render: (h, { row, column, index }) => {
-            return this.isEditIndex == index && row.uniqueCode == 'NO' ? (
-              <div class="redbordererr">
-                <el-form-item
-                  label=""
-                  lebel-width="0px"
-                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
-                  rules={required}
-                >
-                  <el-input
-                    value={row[column.columnAttributes.prop]}
-                    onInput={val => {
-                      row[column.columnAttributes.prop] = val
-                    }}
-                    placeholder="请输入"
-                  ></el-input>
-                </el-form-item>
-              </div>
-            ) : (
-              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
-            )
-          }
-        },
-        ...(() => {
-          if (this.formDialogType < 2) {
-            return [
-              {
-                columnAttributes: {
-                  label: '操作',
-                  fixed: 'right',
-                  width: 140
-                },
-                render: (h, { row, column, index }) => {
-                  return (
-                    <div style="padding:0 6px" class="operation-btns">
-                      {this.formDialogType == 0
-                        ? null
-                        : this.formDialogType == 1
-                        ? [
-                            this.isEditIndex == index ? (
-                              <el-button
-                                type="text"
-                                onClick={() => {
-                                  this.addCode(row)
-                                }}
-                              >
-                                保存
-                              </el-button>
-                            ) : null,
-                            this.isEditIndex == -1 ? (
-                              <el-button
-                                type="text"
-                                onClick={() => {
-                                  this.getGoodsDetl(
-                                    this.formData.items.find(
-                                      item =>
-                                        item.brandId === row.brandId &&
-                                        item.mainId === row.mainId &&
-                                        item.smallId === row.smallId &&
-                                        item.goodsMaterialId === row.goodsMaterialId
-                                    ),
-                                    res => {
-                                      this.isEditIndex = index
-                                    },
-                                    'goodsMaterialId'
-                                  )
-                                }}
-                              >
-                                编辑
-                              </el-button>
-                            ) : null,
-                            <el-button
-                              type="text"
-                              onClick={() => {
-                                this.delCode(row, index)
-                              }}
-                            >
-                              删除
-                            </el-button>
-                          ]
-                        : null}
-                    </div>
-                  )
-                }
-              }
-            ]
-          }
-          return []
-        })()
-      ]
-    }
-  },
   methods: {
+    // 获取条码列表
     getGoodsPurchaseCodeList() {
       if (this.formData.id) {
         goodsPurchaseCodeList({
@@ -490,78 +20,6 @@ export default {
         })
       }
     },
-    arrQC(list, qz = { label: '', value: '' }) {
-      var obj = {}
-      for (var item of list) {
-        obj[item[qz?.value || 'value']] = item
-      }
-      return Object.keys(obj).map(key => {
-        return {
-          data: obj[key],
-          value: key,
-          label: obj[key][qz?.label || 'label']
-        }
-      })
-    },
-    shanchuCodejichu(row, num) {
-      if (num <= 0) {
-        row.mainId = ''
-        row.mainName = ''
-      }
-      if (num <= 1) {
-        row.smallId = ''
-        row.smallName = ''
-      }
-      if (num <= 2) {
-        row.goodsMaterialId = ''
-        row.goodsMaterialName = ''
-        row.goodsPurchaseItemId = ''
-        row.specsName = ''
-      }
-      if (num <= 3) {
-        row.goodsMaterialItemType = ''
-      }
-      if (num <= 4) {
-        row.goodsMaterialItemId = ''
-        row.goodsMaterialItemName = ''
-        row.codeQty = ''
-      }
-      if (num <= 5) {
-        row.uniqueCode = ''
-        row.code = ''
-      }
-    },
-    getCodeVfyKey() {
-      return [
-        `codeInfoList.${this.isEditIndex}.brandId`,
-        `codeInfoList.${this.isEditIndex}.mainId`,
-        `codeInfoList.${this.isEditIndex}.smallId`,
-        `codeInfoList.${this.isEditIndex}.goodsMaterialId`,
-        `codeInfoList.${this.isEditIndex}.goodsMaterialItemType`,
-        `codeInfoList.${this.isEditIndex}.goodsMaterialItemId`,
-        `codeInfoList.${this.isEditIndex}.code`,
-        `codeInfoList.${this.isEditIndex}.codeQty`
-      ]
-    },
-    eidtCodeItems() {
-      // try {
-      //   this.formData.codeInfoList.map((item, index) => {
-      //     this.formData.codeInfoList.map((item2, index2) => {
-      //       if (
-      //         index !== index2 &&
-      //         `${item.brandId}_${item.mainId}_${item.smallId}_${item.goodsMaterialId}_${item.goodsMaterialItemType}_${item.goodsMaterialItemId}` ==
-      //           `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}_${item2.goodsMaterialItemType}_${item2.goodsMaterialItemId}`
-      //       ) {
-      //         throw new Error('')
-      //       }
-      //     })
-      //   })
-      // } catch (error) {
-      //   this.$message.warning('重复')
-      //   return false
-      // }
-      return true
-    },
     // 添加条码信息
     addCodeInfo() {
       this.formData.codeInfoList.unshift({

+ 2 - 13
src/views/salesPurchasing/mixins/storage_goods.js

@@ -1,15 +1,14 @@
 import { required } from '@/components/template/rules_verify.js'
 import { getBrandList } from '@/api/miniapp'
 import { getClassifyList } from '@/api/goods'
-import { goodsMaterialList, goodsMaterialDetail } from '@/api/commercialMaterial.js'
+import { goodsMaterialList } from '@/api/commercialMaterial.js'
 import { goodsPurchaseItemImportCode } from '@/api/goodsPurchasedStored.js'
 export default {
   data() {
     return {
       brandList: [],
       ClassifyList: [],
-      goodsMaterialList: [],
-      isEditIndex: -1
+      goodsMaterialList: []
     }
   },
   computed: {
@@ -467,16 +466,6 @@ export default {
         row.stockQty = ''
       }
     },
-    getGoodsDetl(row, cb, key = 'id') {
-      if (!row?.details?.id) {
-        goodsMaterialDetail({ id: row[key] }).then(res => {
-          Object.assign(row.details, res.data || {})
-          cb(row.details)
-        })
-      } else {
-        cb(row.details)
-      }
-    },
     getVfyKey(index, bool = true) {
       return [
         ...(() => {