فهرست منبع

配件销售单里的收款

caojunjie 2 سال پیش
والد
کامیت
d413c98ad6
1فایلهای تغییر یافته به همراه79 افزوده شده و 50 حذف شده
  1. 79 50
      src/views/salesOrder/detailsPage.vue

+ 79 - 50
src/views/salesOrder/detailsPage.vue

@@ -14,7 +14,7 @@
           </el-button>
             <!--<el-button type="primary" size="small" v-if="form.confirmStatus == 1" @click="newAddfun">新建销售单-->
             <!--</el-button>-->
-            <el-button type="warning" size="small" v-if="form.confirmStatus == 1" @click.stop="clickPayment">收款
+            <el-button type="warning" size="small" :disabled="form.purchaseAmount == form.settlmentAmount" v-if="form.confirmStatus == 1" @click.stop="clickPayment">收款
             </el-button>
           <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
           </el-button>
@@ -66,7 +66,9 @@
                 <el-input-number v-model="form.memberBalance" :disabled="detailData.status == 1"
                                  placeholder="请输入" size="small" :controls="false"
                                  @change="memberchange"></el-input-number>
-                <span style="margin-left: 10px">余额:{{balanceAmounts}}</span>
+                <span style="margin-left: 10px;border: 1px solid #E4E7ED;padding: 6px;border-radius: 4px">
+                    余额:{{balanceAmounts}}
+                </span>
             </template>
         </avue-form>
         <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
@@ -149,37 +151,37 @@
     </el-dialog>
 
       <!--付款的弹窗-->
-      <!--<el-dialog-->
-      <!--    title="付款"-->
-      <!--    :visible.sync="paymentVisible"-->
-      <!--    append-to-body-->
-      <!--    :close-on-click-modal="false"-->
-      <!--    :destroy-on-close="true"-->
-      <!--    :close-on-press-escape="false"-->
-      <!--    v-dialog-drag-->
-      <!--    width="40%"-->
-      <!--    :before-close="paymentClose">-->
-      <!--    <div>-->
-      <!--        <el-form ref="form" label-width="100px" size="mini">-->
-      <!--            <el-form-item label="总支付金额">-->
-      <!--                {{form.purchaseAmount}}-->
-      <!--            </el-form-item>-->
-      <!--            <el-form-item label="会员卡余额">-->
-      <!--                {{balanceAmounts}}-->
-      <!--            </el-form-item>-->
-      <!--            <el-form-item label="会员卡支付金额">-->
-      <!--                <el-input type="number" v-model="form.memberBalance" @change="memberBalancechange"></el-input>-->
-      <!--            </el-form-item>-->
-      <!--            <el-form-item label="现金支付金额">-->
-      <!--                <el-input type="number" v-model="form.wechatpayAmount"></el-input>-->
-      <!--            </el-form-item>-->
-      <!--        </el-form>-->
-      <!--    </div>-->
-      <!--    <span slot="footer" class="dialog-footer">-->
-      <!--        <el-button @click="paymentVisible = false">取 消</el-button>-->
-      <!--        <el-button type="primary" @click="paymentVisible = false">确 定</el-button>-->
-      <!--    </span>-->
-      <!--</el-dialog>-->
+      <el-dialog
+          title="收款"
+          :visible.sync="paymentVisible"
+          append-to-body
+          :close-on-click-modal="false"
+          :destroy-on-close="true"
+          :close-on-press-escape="false"
+          v-dialog-drag
+          width="35%"
+          :before-close="paymentClose">
+          <div>
+              <div>本次收款需要支付金额为{{this.form.currentAmount}}</div>
+              <div style="display: flex;align-items: center;margin-top: 20px">
+                  <div style="margin-right: 10px">支付账户:</div>
+                  <div>
+                      <el-select v-model="form.account" size="small" placeholder="请选择">
+                          <el-option
+                              v-for="item in accountdata"
+                              :key="item.dictKey"
+                              :label="item.dictValue"
+                              :value="item.dictKey">
+                          </el-option>
+                      </el-select>
+                  </div>
+              </div>
+          </div>
+          <span slot="footer" class="dialog-footer">
+              <el-button @click="paymentVisible = false">取 消</el-button>
+              <el-button type="primary" @click="querenfun">确 定</el-button>
+          </span>
+      </el-dialog>
   </div>
 </template>
 
@@ -208,6 +210,8 @@ export default {
   name: "index",
   data() {
     return {
+        // 收款账户
+        accountdata:[],
         // 付款的弹窗开启和关闭
         paymentVisible:false,
       checkDialog: false,
@@ -518,6 +522,7 @@ export default {
       storageoptions: [],
         // 会员卡余额
         balanceAmounts:0,
+
     };
   },
   props: {
@@ -623,26 +628,46 @@ export default {
       },
       // 收款点击事件
       clickPayment(){
-          // 和删除一样的接口 显示要收款的现金
-          this.$confirm(`本次收款需要支付金额为${this.form.currentAmount}`, '提示', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-          }).then(()=>{
-              let form = {
-                  ...this.form,
-                  orderFilesList: this.orderFilesList
-              }
-              collectPayment(form).then(res=>{
-                  console.log(res,632)
-              })
+          // // 和删除一样的接口 显示要收款的现金
+          // this.$prompt(`本次收款需要支付金额为${this.form.currentAmount}`, '提示', {
+          //     confirmButtonText: '确定',
+          //     cancelButtonText: '取消',
+          //     inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
+          //     inputType:'select',
+          //     inputErrorMessage: '请选择收款账户',
+          //     type: 'warning'
+          // }).then(()=>{
+          //
+          //     let form = {
+          //         ...this.form,
+          //         orderFilesList: this.orderFilesList
+          //     }
+          //     collectPayment(form).then(res=>{
+          //         this.$message.success('收款成功');
+          //         this.getDetail(this.detailData.id);
+          //     })
+          // })
+          this.getWorkDicts("account").then(res => {
+              this.accountdata = res.data.data;
+          });
+          this.paymentVisible = true
+      },
+      // 收款弹窗的确认
+      querenfun(){
+          let form = {
+              ...this.form,
+              orderFilesList: this.orderFilesList
+          }
+          collectPayment(form).then(res=>{
+              this.$message.success('收款成功');
+              this.getDetail(this.detailData.id);
+              this.paymentClose = false
           })
-          // this.paymentVisible = true
       },
       // // 付款弹窗的关闭
-      // paymentClose(){
-      //     this.paymentVisible = false
-      // },
+      paymentClose(){
+          this.paymentVisible = false
+      },
     //打开审核
     openCheckDialog() {
       this.checkData = this.detailData.check;
@@ -734,6 +759,8 @@ export default {
       getDetails({ id: id })
         .then(res => {
           this.form = res.data.data;
+          // // 深拷贝会员卡金额
+          // this.jsonmemberBalance = JSON.parse(JSON.stringify(this.form.memberBalance))
           this.data = res.data.data.orderItemsList;
           this.settlementList = res.data.data.settlementList;
           this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
@@ -880,6 +907,8 @@ export default {
               this.option2.disabled = true;
               this.$refs.crud.refreshTable();
               this.$refs.feeInfo.refreshTable();
+
+              this.getDetail(this.form.id);
             })
             .finally(() => {
               this.loadingBtn = false;