|
|
@@ -50,7 +50,7 @@
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button style="margin-bottom: 22px;" @click="handleDeleteRow(form.oaPurchaseObjs[scope.$index])"
|
|
|
+ <el-button :disabled="form.oaPurchaseObjs.length > 1 ? false : true" style="margin-bottom: 22px;" @click="handleDeleteRow(scope.$index)"
|
|
|
type="text" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -137,7 +137,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetail, create, reCommit, save, deleteById, closeById } from "@/api/oa/receive"
|
|
|
+import { getDetail, create, reCommit, save, deleteById, closeById } from "@/api/oa/purchase"
|
|
|
import { getDate } from "@/utils/dateUtils";
|
|
|
import { getUserProfile } from "@/api/system/user";
|
|
|
import { listDept } from "@/api/system/dept";
|
|
|
@@ -247,7 +247,6 @@ export default {
|
|
|
addRow() {
|
|
|
let index = this.form.oaPurchaseObjs.length;
|
|
|
this.form.oaPurchaseObjs.push({
|
|
|
- key: index,
|
|
|
name: '',
|
|
|
amount: '',
|
|
|
money: '',
|
|
|
@@ -258,13 +257,8 @@ export default {
|
|
|
* 删除行
|
|
|
* @param row
|
|
|
*/
|
|
|
- handleDeleteRow(row) {
|
|
|
- let datas = this.form.oaPurchaseObjs;
|
|
|
- for (var i = 0; i < datas.length; i++) {
|
|
|
- if (datas[i].key == row.key) {
|
|
|
- datas.splice(i, 1);
|
|
|
- }
|
|
|
- }
|
|
|
+ handleDeleteRow(index) {
|
|
|
+ this.form.oaPurchaseObjs.splice(index, 1);
|
|
|
let arr = this.form.oaPurchaseObjs;
|
|
|
this.form.sunMoney = this.sum(arr);
|
|
|
},
|