| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openProductEdit('edit', scope.row);">编辑</el-button> |
| | | <el-button v-if="!scope.row.editFlag" link type="primary" size="small" @click="openProductEdit(scope.row);">编辑</el-button> |
| | | <el-button v-else link type="primary" size="small" @click="openProductEdit(scope.row);">保存</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | productData.value = form.value.productDtoList |
| | | }) |
| | | } |
| | | // currentId.value = row.id; |
| | | // getSalesLedgerWithProducts({id: row.id}).then(res => { |
| | | // form.value = {...res} |
| | | // productData.value = form.value.productData |
| | | // }) |
| | | // } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // 提交表单 |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | form.value.productDtoList = productData; |
| | | form.value.productDtoList = proxy.HaveJson(productData.value) |
| | | form.value.productDtoList.forEach(item => { |
| | | item.id = '' |
| | | }) |
| | | delete form.value.productData |
| | | invoiceRegistrationSaveOrUpdate(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功") |
| | | closeDia() |
| | |
| | | dialogFormVisible.value = false |
| | | } |
| | | // 打开产品弹框 |
| | | const openProductEdit = (type, row) => { |
| | | const openProductEdit = (row) => { |
| | | const index = productData.value.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | productData.value[index].editFlag = !productData.value[index].editFlag |
| | |
| | | customerId: res.customerId, |
| | | } |
| | | productData.value = form.value.productData.map(item => { |
| | | item.id = "" |
| | | item.editFlag = false |
| | | return item |
| | | }) |