|
@@ -390,7 +390,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
...(() => {
|
|
|
- if (this.formDialogType < 2) {
|
|
|
+
|
|
|
+ if (this.formDialogType < 2 && !~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)) {
|
|
|
return [
|
|
|
{
|
|
|
columnAttributes: {
|
|
@@ -401,57 +402,70 @@ export default {
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return (
|
|
|
<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>
|
|
|
- ]
|
|
|
- : !!~['SAVE'].indexOf(this.formData.status)
|
|
|
- ? this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id }, () => { }, () => {
|
|
|
- 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: {} }))
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ ) : null,
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ onClick={() => {
|
|
|
+ this.delGoodsInfo(row, index)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ ]}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } else if (this.formDialogType < 2 && !!~['SAVE'].indexOf(this.formData.status) && this.joinCode) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ fixed: 'right',
|
|
|
+ width: 140
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return (
|
|
|
+ <div style="padding:0 6px" class="operation-btns">
|
|
|
+ {this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id }, () => { }, () => {
|
|
|
+ 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: {} }))
|
|
|
+ })
|
|
|
})
|
|
|
- : null}
|
|
|
+ }
|
|
|
+ })}
|
|
|
</div>
|
|
|
)
|
|
|
}
|