sunlupeng 1 year ago
parent
commit
869905ea12

+ 1 - 1
src/views/oa/purchase/DataList.vue

@@ -83,7 +83,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getListData,exportList }  from "@/api/oa/receive"
+import { getListData,exportList }  from "@/api/oa/purchase"
 import detail from "./detail.vue";
 import detail from "./detail.vue";
 import edit from "./edit.vue";
 import edit from "./edit.vue";
 import Treeselect from "@riophae/vue-treeselect";
 import Treeselect from "@riophae/vue-treeselect";

+ 1 - 1
src/views/oa/purchase/detail.vue

@@ -148,7 +148,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getDetail, agree, disagree, revocation } from "@/api/oa/receive"
+import { getDetail, agree, disagree, revocation } from "@/api/oa/purchase"
 import { getDate } from "@/utils/dateUtils";
 import { getDate } from "@/utils/dateUtils";
 export default {
 export default {
   props: {
   props: {

+ 4 - 10
src/views/oa/purchase/edit.vue

@@ -50,7 +50,7 @@
 
 
         <el-table-column fixed="right" label="操作" width="80">
         <el-table-column fixed="right" label="操作" width="80">
           <template slot-scope="scope">
           <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>
               type="text" size="small">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -137,7 +137,7 @@
 </template>
 </template>
 
 
 <script>
 <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 { getDate } from "@/utils/dateUtils";
 import { getUserProfile } from "@/api/system/user";
 import { getUserProfile } from "@/api/system/user";
 import { listDept } from "@/api/system/dept";
 import { listDept } from "@/api/system/dept";
@@ -247,7 +247,6 @@ export default {
     addRow() {
     addRow() {
       let index = this.form.oaPurchaseObjs.length;
       let index = this.form.oaPurchaseObjs.length;
       this.form.oaPurchaseObjs.push({
       this.form.oaPurchaseObjs.push({
-        key: index,
         name: '',
         name: '',
         amount: '',
         amount: '',
         money: '',
         money: '',
@@ -258,13 +257,8 @@ export default {
      * 删除行
      * 删除行
      * @param row
      * @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;
       let arr = this.form.oaPurchaseObjs;
         this.form.sunMoney = this.sum(arr);
         this.form.sunMoney = this.sum(arr);
     },
     },

+ 3 - 9
src/views/oa/receive/edit.vue

@@ -55,7 +55,7 @@
 
 
         <el-table-column fixed="right" label="操作" width="80">
         <el-table-column fixed="right" label="操作" width="80">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-button style="margin-bottom: 22px;" @click="handleDeleteRow(form.oaReceiveObjs[scope.$index])"
+            <el-button :disabled="form.oaReceiveObjs.length > 1 ? false : true" style="margin-bottom: 22px;" @click="handleDeleteRow(scope.$index)"
               type="text" size="small">删除</el-button>
               type="text" size="small">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -232,7 +232,6 @@ export default {
     addRow() {
     addRow() {
       let index = this.form.oaReceiveObjs.length;
       let index = this.form.oaReceiveObjs.length;
       this.form.oaReceiveObjs.push({
       this.form.oaReceiveObjs.push({
-        key: index,
         name: '',
         name: '',
         amount: '',
         amount: '',
         config: '',
         config: '',
@@ -243,13 +242,8 @@ export default {
      * 删除行
      * 删除行
      * @param row
      * @param row
      */
      */
-    handleDeleteRow(row) {
-      let datas = this.form.oaReceiveObjs;
-      for (var i = 0; i < datas.length; i++) {
-        if (datas[i].key == row.key) {
-          datas.splice(i, 1);
-        }
-      }
+    handleDeleteRow(index) {
+      this.form.oaReceiveObjs.splice(index, 1);
     },
     },
     getDateStar(ms) {
     getDateStar(ms) {
       return getDate(ms);
       return getDate(ms);