Bläddra i källkod

提现管理修改

pengyh 1 år sedan
förälder
incheckning
2d50ae9e46

+ 40 - 20
src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue

@@ -45,7 +45,7 @@
 						<td class="bold" align="center">开户银行</td>
 						<td>{{formData.bank}}</td>
 						<td class="bold" align="center">开户支行</td>
-						<td>{{formData.bankRow}}</td>
+						<td>{{formData.subBank}}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">持卡人</td>
@@ -60,9 +60,9 @@
 						<td colspan="5">{{formData.remark}}</td>
 					</tr>
 					<tr>
-						<td class="bold" align="center">转账凭证</td>
-						<td colspan="5">
-							<el-image style="width: 80px;height: 80px" :preview-src-list="[formData.certImg]" :src="formData.certImg" fit="fit"></el-image>
+						<td class="bold" align="center"><span style="color: red;">*</span>转账凭证</td>
+						<td colspan="5" style="width: 80px;height: 80px">
+							<ImageUpload :fileList="formData.certImg" :limit="1" :isEdit="formData.status == 0" />
 						</td>
 					</tr>
 				</table>
@@ -76,9 +76,9 @@
 						<tr>
 							<th class="bold" align="center">订单单号</th>
 							<th class="bold" align="center">订单类型</th>
-							<th class="bold" align="center">收费类型</th>
+							<!-- <th class="bold" align="center">收费类型</th> -->
 							<th class="bold" align="center">数量</th>
-							<th class="bold" align="center">单价</th>
+							<!-- <th class="bold" align="center">单价</th> -->
 							<th class="bold" align="center">订单金额</th>
 							<th class="bold" align="center">销售类型</th>
 							<th class="bold" align="center">师傅分账金额</th>
@@ -89,19 +89,19 @@
 						<tr v-for="(item,index) in formData.withdrawalOrderItems" :key="index">
 							<td align="center">{{item.id}}</td>
 							<td align="center">{{item.goodsType == 'M'?'辅材':'配件'}}</td>
-							<td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td>
+							<!-- <td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td> -->
 							<td align="center">{{item.num}}</td>
-							<td align="center">{{item.goodsAmount}}</td>
-							<td align="center">{{item.totalAmount}}</td>
+							<!-- <td align="center">{{item.goodsAmount}}</td> -->
+							<td align="center">{{item.totalPrice}}</td>
 							<td align="center">{{item.settlementType == 'OWN'?'自由':item.settlementType == 'OUT'?'外购':''}}</td>
 							<td align="center">{{item.workerAmount}}</td>
 							<td align="center">{{item.websitAmount}}</td>
 						</tr>
+						<!-- <tr>
+							<td style="color: #ffffff;">隐身</td><td></td><td></td><td></td><td></td><td></td><td></td>
+						</tr> -->
 						<tr>
-							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
-						</tr>
-						<tr>
-							<td align="center">总计</td><td></td><td></td><td></td></td><td>
+							<td align="center">总计</td><td></td></td><td>
 							<td align="center">{{totalAmount || 0}}</td><td></td>
 							<td align="center">{{workerAmount || 0}}</td>
 							<td align="center">{{websitAmount || 0}}</td>
@@ -111,7 +111,7 @@
 			</el-card>
 		  <div slot="footer" class="dialog-footer">
 			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
-			<el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id, formData.certImg)">设为已发</el-button>
+			<el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id)">设为已发</el-button>
 		  </div>
 		</el-dialog>
 	</template-page>
@@ -149,7 +149,7 @@ export default {
 		status: '',
 		totalAmount: 0,
 		workerAmount: 0,
-		websitAmount: 0,
+		websitAmount: 0
     }
   },
   computed: {
@@ -203,9 +203,11 @@ export default {
 			this.workerAmount = 0
 			this.websitAmount = 0
 		    getDetail({ id: row.id }).then(res => {
-		      Object.assign(this.formData, res.data)
+		      Object.assign(this.formData, res.data,{
+				  certImg:res.data?.certImg ? res.data?.certImg?.split(",").map(item=>({url:item})) : []
+			  })
 			  res.data.withdrawalOrderItems.forEach(item=>{
-			  	this.totalAmount += item.totalAmount
+			  	this.totalAmount += item.totalPrice
 			  	this.workerAmount += item.workerAmount
 			  	this.websitAmount += item.websitAmount
 			  })
@@ -214,21 +216,39 @@ export default {
 		    })
 		  }}>查看</el-button>
 		  {row.status == 0? <el-button type="text" onClick={() => {
-		  	this.update(row.id, row.certImg)
+		  	this.totalAmount = 0
+		  	this.workerAmount = 0
+		  	this.websitAmount = 0
+		  	getDetail({ id: row.id }).then(res => {
+		  	  Object.assign(this.formData, res.data,{
+				  certImg:res.data?.certImg ? res.data?.certImg?.split(",").map(item=>({url:item})) : []
+			  })
+		  	  res.data.withdrawalOrderItems.forEach(item=>{
+		  	  	this.totalAmount += item.totalPrice
+		  	  	this.workerAmount += item.workerAmount
+		  	  	this.websitAmount += item.websitAmount
+		  	  })
+		  	  this.formDialogType = 1
+		  	  this.openForm()
+		  	})
 		  }}>设为已发</el-button>:null}
 		  
         </div>
       )
     },
-	update(id, certImg){
+	update(id){
+		if(this.formData.certImg.length == 0){
+			return this.$message.warning('请先上传转账凭证!');
+		}
 		this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
 			confirmButtonText: '确定',
 			cancelButtonText: '取消',
 			type: 'warning'
 		}).then(() => {
-			update({ id, certImg }).then(res => {
+			update({ id, certImg: this.formData.certImg.map(item=>item.url).join(",") }).then(res => {
 			  if (res.code == 200) {
 			  	this.$message({ type: 'success', message: '设为已发放成功!' })
+				this.formDialog = false
 			  	this.$refs.pageRef.refreshList()
 			  } else {
 			  	this.$message.error(res.msg);