Explorar el Código

fix:转移改为批量

liuzl hace 3 años
padre
commit
dbbd982cd1

+ 2 - 2
src/views/contract/components/DetailsCollection.vue

@@ -37,13 +37,13 @@
             <span v-else>{{ row[item.prop] }}</span>
           </template>
         </el-table-column>
-        <el-table-column align="center" fixed="right" label="操作">
+        <el-table-column align="center" fixed="right" label="操作" width="120px">
           <template slot-scope="scope">
             <el-button
               :disabled="scope.row.contractStatus == '30'"
               type="text"
               @click="$refs.collection.init(scope.row.id)">
-              新建回款
+              回款
             </el-button>
             <el-button type="text" @click="$refs.collectionPlan.init(scope.row.id)">编辑</el-button>
             <el-button type="text" @click="handleDel(scope.row, 'plan')">删除</el-button>

+ 3 - 3
src/views/contract/components/Transfer.vue

@@ -42,8 +42,8 @@
     },
     props: {
       contractId: {
-        type: Number,
-        default: 0,
+        type: Array,
+        default: () => [],
       },
       usersList: {
         type: Array,
@@ -103,10 +103,10 @@
         if (res.code == 200) this.$message.success(res.msg)
         else return
         this.handleClose()
+        this.$emit('transferSave')
       },
       handleClose() {
         this.innerVisible = false
-        this.$emit('transferSave')
         this.userForm = {
           inchargeId: 0,
           inchargeName: '',

+ 2 - 2
src/views/contract/detail.vue

@@ -15,7 +15,7 @@
           <h3>
             {{ details.contractName }}
             <span>
-              <el-button type="primary" @click="handleTransfer">转移</el-button>
+              <el-button icon="el-icon-refresh" @click="handleTransfer">转移</el-button>
             </span>
           </h3>
         </div>
@@ -70,7 +70,7 @@
     <!-- 新增编辑客户弹窗 -->
     <Edit ref="edit" @contractSave="init" />
     <!-- 转移合同 -->
-    <Transfer ref="transfer" :contract-id="id" @transferSave="init" />
+    <Transfer ref="transfer" :contract-id="[id]" @transferSave="init" />
   </div>
 </template>
 

+ 6 - 7
src/views/contract/index.vue

@@ -42,6 +42,7 @@
       </vab-query-form-top-panel>
       <vab-query-form-left-panel :span="12">
         <el-button icon="el-icon-plus" type="primary" @click="handleEdit()">新建</el-button>
+        <el-button icon="el-icon-refresh" type="primary" @click="handleTransfer()">转移</el-button>
         <el-button icon="el-icon-delete" type="danger" @click="handleDelete()">删除</el-button>
       </vab-query-form-left-panel>
       <vab-query-form-right-panel :span="12">
@@ -79,11 +80,10 @@
           <span v-else>{{ row[item.prop] }}</span>
         </template>
       </el-table-column>
-      <el-table-column align="center" fixed="right" label="操作" width="120px">
+      <el-table-column align="center" fixed="right" label="操作" width="90px">
         <template slot-scope="scope">
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
           <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
-          <el-button type="text" @click="handleTransfer(scope.row)">转移</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -123,7 +123,7 @@
           { id: 2, label: '已拒绝' },
           { id: 3, label: '已通过' },
         ],
-        contractId: 0, //当前合同id
+        contractId: [], //当前合同id
         listLoading: false,
         layout: 'total, sizes, prev, pager, next, jumper',
         list: [],
@@ -294,15 +294,14 @@
       },
       // 转移合同
       handleTransfer(row) {
-        this.contractId = row.id
+        this.contractId = row ? [row.id] : this.selectRows
+        if (!this.contractId[0]) return this.$baseMessage('请先选择转移的数据', 'warning')
         this.$refs.transfer.open()
       },
       // 合同删除
       handleDelete(row = null) {
         let ids = row ? [row.id] : this.selectRows
-        if (!ids[0]) {
-          return
-        }
+        if (!ids[0]) return this.$baseMessage('请先选择删除的数据', 'warning')
         this.$confirm('确认删除?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',