|
@@ -2,7 +2,8 @@ import { required } from '@/components/template/rules_verify.js'
|
|
|
import { getBrandList } from '@/api/miniapp'
|
|
|
import { getClassifyList } from '@/api/goods'
|
|
|
import { goodsMaterialList } from '@/api/commercialMaterial.js'
|
|
|
-import { goodsPurchaseItemImportCode } from '@/api/goodsPurchasedStored.js'
|
|
|
+import { goodsPurchaseItemImportCode, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -402,44 +403,44 @@ export default {
|
|
|
<div style="padding:0 6px" class="operation-btns">
|
|
|
{!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)
|
|
|
? [
|
|
|
- this.isEditIndex == index ? (
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- onClick={() => {
|
|
|
- this.$refs.formRef.validateField(
|
|
|
- this.getVfyKey(this.isEditIndex),
|
|
|
- (valid, invalidFields, errLabels) => {
|
|
|
- if (valid && this.eidtItems()) {
|
|
|
- this.isEditIndex = -1
|
|
|
- }
|
|
|
+ this.isEditIndex == index ? (
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ onClick={() => {
|
|
|
+ this.$refs.formRef.validateField(
|
|
|
+ this.getVfyKey(this.isEditIndex),
|
|
|
+ (valid, invalidFields, errLabels) => {
|
|
|
+ if (valid && this.eidtItems()) {
|
|
|
+ this.isEditIndex = -1
|
|
|
}
|
|
|
- )
|
|
|
- }}
|
|
|
- >
|
|
|
- 保存
|
|
|
- </el-button>
|
|
|
- ) : null,
|
|
|
- this.isEditIndex == -1 ? (
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- onClick={() => {
|
|
|
- this.isEditIndex = index
|
|
|
- }}
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- ) : null,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ ) : null,
|
|
|
+ this.isEditIndex == -1 ? (
|
|
|
<el-button
|
|
|
type="text"
|
|
|
onClick={() => {
|
|
|
- this.delGoodsInfo(row, index)
|
|
|
+ this.isEditIndex = index
|
|
|
}}
|
|
|
>
|
|
|
- 删除
|
|
|
+ 编辑
|
|
|
</el-button>
|
|
|
- ]
|
|
|
+ ) : null,
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ onClick={() => {
|
|
|
+ this.delGoodsInfo(row, index)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ ]
|
|
|
: !!~['SAVE'].indexOf(this.formData.status)
|
|
|
- ? this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id }, ()=>{}, ()=>{
|
|
|
+ ? this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id }, () => { }, () => {
|
|
|
if (this.formData.id) {
|
|
|
// 更新表单信息
|
|
|
goodsPurchaseDetail({ id: this.formData.id }).then(res => {
|
|
@@ -450,7 +451,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- : null}
|
|
|
+ : null}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
@@ -533,7 +534,7 @@ export default {
|
|
|
if (
|
|
|
index !== index2 &&
|
|
|
`${item.brandId}_${item.mainId}_${item.smallId}_${item.goodsMaterialId}` ==
|
|
|
- `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}`
|
|
|
+ `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}`
|
|
|
) {
|
|
|
throw new Error('')
|
|
|
}
|