Browse Source

前端sdy

zhongtianhaoyuan 3 years ago
parent
commit
35dcef47d2
1 changed files with 123 additions and 164 deletions
  1. 123 164
      src/views/houseSelfCollect/paymentManagement.vue

+ 123 - 164
src/views/houseSelfCollect/paymentManagement.vue

@@ -8,6 +8,7 @@
         <ws-button type="primary"  @click="screen()">全部</ws-button>
         <ws-button type="primary"  @click="screen()">全部</ws-button>
         <ws-button type="primary" @click="reject" v-if="isShowAdopt">驳回</ws-button>
         <ws-button type="primary" @click="reject" v-if="isShowAdopt">驳回</ws-button>
         <ws-button type="primary" @click="adopt" v-if="isShowAdopt">通过</ws-button>
         <ws-button type="primary" @click="adopt" v-if="isShowAdopt">通过</ws-button>
+        <ws-button type="primary" @click="adopt" v-if="isShowAdopt">审核</ws-button>
         <ws-button type="primary" @click="payment">付款</ws-button>
         <ws-button type="primary" @click="payment">付款</ws-button>
       </template>
       </template>
       <template slot="right">
       <template slot="right">
@@ -22,8 +23,7 @@
             :key="item.id"
             :key="item.id"
             :label="item.warehouseName"
             :label="item.warehouseName"
             :value="item.id"
             :value="item.id"
-          >
-          </el-option>
+          ></el-option>
         </el-select>
         </el-select>
         <div></div>
         <div></div>
         <ws-input
         <ws-input
@@ -34,8 +34,8 @@
           type="input"
           type="input"
         ></ws-input>
         ></ws-input>
         <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
         <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
-        <ws-button class="find" type="primary" @click="find()"
-          ><img
+        <ws-button class="find" type="primary" @click="find()">
+          <img
             width="16"
             width="16"
             height="16"
             height="16"
             style="
             style="
@@ -44,8 +44,9 @@
               top: 0px;
               top: 0px;
             "
             "
             src="../../../public/img/sousuo.png"
             src="../../../public/img/sousuo.png"
-            alt=""
-        /></ws-button>
+            alt
+          />
+        </ws-button>
       </template>
       </template>
     </BaseHeaderLayout>
     </BaseHeaderLayout>
     <el-table
     <el-table
@@ -56,118 +57,67 @@
       height="780"
       height="780"
       @selection-change="handleSelectionChange"
       @selection-change="handleSelectionChange"
     >
     >
-      <el-table-column
-        :selectable="selectInit"
-        type="selection"
-        width="55"
-      ></el-table-column>
+      <el-table-column :selectable="selectInit" type="selection" width="55"></el-table-column>
       <el-table-column type="index" label="序号" width="50">
       <el-table-column type="index" label="序号" width="50">
         <template scope="scope">
         <template scope="scope">
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
           <span v-else>{{ scope.$index + 1 }}</span>
           <span v-else>{{ scope.$index + 1 }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="paymentNo"
-        width="150"
-        label="编号"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="customerName"
-        label="客户"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="carNo"
-        label="车牌号"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="goodsName"
-        label="货名"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        width="80"
-        prop="type"
-        label="类型"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="tidalGrainPrice"
-        width="140"
-        label="净重单价(元/公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="solidGrainPrice"
-        width="140"
-        label="纯重单价(元/公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="netWeight"
-        width="120"
-        label="净重(公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="pureWeight"
-        width="120"
-        label="纯重(公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="amountIngPayable"
-        label="应付款(元)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="amountEdPayable"
-        label="已付款(元)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="collectionIngPayable"
-        label="更新时间"
-      ></el-table-column>
+      <el-table-column class="table_td" prop="paymentNo" width="150" label="编号"></el-table-column>
+      <el-table-column class="table_td" prop="customerName" label="客户"></el-table-column>
+      <el-table-column class="table_td" prop="carNo" label="车牌号"></el-table-column>
+      <el-table-column class="table_td" prop="goodsName" label="货名"></el-table-column>
+      <el-table-column class="table_td" width="80" prop="type" label="类型"></el-table-column>
+      <el-table-column class="table_td" prop="tidalGrainPrice" width="140" label="净重单价(元/公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="solidGrainPrice" width="140" label="纯重单价(元/公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="netWeight" width="120" label="净重(公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="pureWeight" width="120" label="纯重(公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="amountIngPayable" label="应付款(元)"></el-table-column>
+      <el-table-column class="table_td" prop="amountEdPayable" label="已付款(元)"></el-table-column>
+      <el-table-column class="table_td" prop="collectionIngPayable" label="更新时间"></el-table-column>
       <el-table-column class="table_td" prop="status" label="状态">
       <el-table-column class="table_td" prop="status" label="状态">
         <template scope="scope">
         <template scope="scope">
-          <span v-if="scope.row.approveStatus">{{
+          <span v-if="scope.row.approveStatus">
+            {{
             scope.row.approveStatus
             scope.row.approveStatus
-          }}</span>
+            }}
+          </span>
           <span v-else>{{ scope.row.status }}</span>
           <span v-else>{{ scope.row.status }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="collectionEdPayable"
-        label="操作"
-        width="350"
-      >
+      <el-table-column class="table_td" prop="collectionEdPayable" label="操作" width="350">
         <template scope="scope">
         <template scope="scope">
-          <el-button  type="danger" v-if="!scope.row.approveStatus && scope.row.status != '已驳回'" @click="del(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.delete`">删除</el-button>
-          <el-button v-if="!scope.row.approveStatus && scope.row.status != '已驳回'" @click="settlement(1, scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.add`">结算</el-button >
-          <el-button v-if="scope.row.approveStatus || scope.row.status == '已驳回'" @click="settlement(2, scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.view`">查看</el-button >
-          <el-button v-if=" scope.row.approveStatus || scope.row.status == '已驳回' || userJurisdiction " @click="print(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">打印</el-button>
+          <el-button
+            type="danger"
+            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            @click="del(scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.delete`"
+          >删除</el-button>
+          <el-button
+            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            @click="settlement(1, scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.add`"
+          >结算</el-button>
+          <el-button
+            v-if="scope.row.approveStatus || scope.row.status == '已驳回'"
+            @click="settlement(2, scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.view`"
+          >查看</el-button>
+          <el-button
+            v-if=" scope.row.approveStatus || scope.row.status == '已驳回' || userJurisdiction "
+            @click="print(scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.print`"
+          >打印</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
     <!-- 付款弹窗 -->
     <!-- 付款弹窗 -->
-    <el-dialog
-      width="40%"
-      :visible.sync="paymentForm"
-      :append-to-body="true"
-      title="付款"
-    >
+    <el-dialog width="40%" :visible.sync="paymentForm" :append-to-body="true" title="付款">
       <div class="tanchuang">
       <div class="tanchuang">
         <ws-form>
         <ws-form>
           <ws-info-table>
           <ws-info-table>
-            <ws-form-item label="未付金额(元)" prop="amountNotPayable">
-              {{ payments.amountNotPayable }}
-            </ws-form-item>
+            <ws-form-item label="未付金额(元)" prop="amountNotPayable">{{ payments.amountNotPayable }}</ws-form-item>
             <ws-form-item label="本次付款金额(元)" prop="money">
             <ws-form-item label="本次付款金额(元)" prop="money">
               <ws-input
               <ws-input
                 v-model="payments.money"
                 v-model="payments.money"
@@ -177,15 +127,9 @@
               />
               />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="付款日期" prop=" paymentDate">
             <ws-form-item label="付款日期" prop=" paymentDate">
-              <el-date-picker
-                v-model="payments.paymentDate"
-                type="date"
-                placeholder="选择日期"
-              >
-              </el-date-picker>
-            </ws-form-item>
-            <ws-form-item label="上传截图" prop=" paymentScreenshot">
+              <el-date-picker v-model="payments.paymentDate" type="date" placeholder="选择日期"></el-date-picker>
             </ws-form-item>
             </ws-form-item>
+            <ws-form-item label="上传截图" prop=" paymentScreenshot"></ws-form-item>
             <div class="upLoad">
             <div class="upLoad">
               <el-upload
               <el-upload
                 class="avatar-uploader"
                 class="avatar-uploader"
@@ -213,8 +157,7 @@
         :page-size="deptCircularPage.pageSize"
         :page-size="deptCircularPage.pageSize"
         layout="total, sizes, prev, pager, next, jumper"
         layout="total, sizes, prev, pager, next, jumper"
         :total="deptBudgetTotal"
         :total="deptBudgetTotal"
-      >
-      </el-pagination>
+      ></el-pagination>
       <el-dialog
       <el-dialog
         width="70%"
         width="70%"
         class="table-content"
         class="table-content"
@@ -224,9 +167,7 @@
       >
       >
         <paymentPrint :printData="printData"></paymentPrint>
         <paymentPrint :printData="printData"></paymentPrint>
         <div style="text-align: center">
         <div style="text-align: center">
-          <el-button type="primary" @click="isShowPrint = false"
-            >关闭</el-button
-          >
+          <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
           <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
           <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
           <el-button type="primary" @click="printBig">打印单据</el-button>
           <el-button type="primary" @click="printBig">打印单据</el-button>
         </div>
         </div>
@@ -241,7 +182,7 @@ import {
   delpayment,
   delpayment,
   auditpayment,
   auditpayment,
   getpaymentexamine,
   getpaymentexamine,
-  paymentCommit,
+  paymentCommit
 } from '@/model/houseSelfCollect/index'
 } from '@/model/houseSelfCollect/index'
 import { posthandle } from '@/model/purchasingManagement/index'
 import { posthandle } from '@/model/purchasingManagement/index'
 import paymentPrint from './component/paymentPrint.vue'
 import paymentPrint from './component/paymentPrint.vue'
@@ -274,11 +215,11 @@ export default {
       userJurisdiction: true,
       userJurisdiction: true,
       payments: {
       payments: {
         amountNotPayable: 0,
         amountNotPayable: 0,
-        paymentDate:"",
+        paymentDate: ''
       },
       },
       isShowAdopt:false,
       isShowAdopt:false,
       //上传截图路径
       //上传截图路径
-      imageUrl: '',
+      imageUrl: ''
     }
     }
   },
   },
   activated() {
   activated() {
@@ -296,33 +237,43 @@ export default {
     //     this.getList()
     //     this.getList()
     //   })
     //   })
     this.getWarehouse()
     this.getWarehouse()
-    this.warehouseName = this.WAREHOUSE.payname
-    console.log(this.WAREHOUSE.payname)
     this.getList()
     this.getList()
   },
   },
   methods: {
   methods: {
-    getWarehouse(){
-       selectWarehouseSelf({
-      compId: sessionStorage.getItem('ws-pf_compId'),
-    })
-      .toPromise()
-      .then((response) => {
-        this.warehouseList = response
-        this.warehouseNameKey = this.warehouseList[0].id
-        this.warehouseName = this.warehouseList[0].warehouseName
-        // this.getList()
+    getWarehouse() {
+      selectWarehouseSelf({
+        compId: sessionStorage.getItem('ws-pf_compId')
       })
       })
+        .toPromise()
+        .then(response => {
+          this.warehouseList = response
+          console.log(this.WAREHOUSE.payname)
+          this.warehouseNameKey = this.warehouseList[0].id
+          if (this.warehouseName) {
+            this.warehouseNameKey = this.WAREHOUSE.payname
+          } else {
+            this.WAREHOUSE.payname = this.warehouseList[0].id
+          }
 
 
+          // this.getList()
+        })
     },
     },
     //上传付款截图
     //上传付款截图
     handleAvatarSuccess(e) {
     handleAvatarSuccess(e) {
       this.imageUrl = e.url
       this.imageUrl = e.url
     },
     },
     printSmall() {
     printSmall() {
-      window.open('../../../../../static/payprint.html?type=1&dataList=' + JSON.stringify(this.printData))
+      window.open(
+        '../../../../../static/payprint.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      )
     },
     },
     printBig() {
     printBig() {
-      window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData),"结算凭证")
+      window.open(
+        '../../../../../static/payprint.html?type=2&dataList=' +
+          JSON.stringify(this.printData),
+        '结算凭证'
+      )
     },
     },
     getList() {
     getList() {
       getpayment({
       getpayment({
@@ -331,13 +282,12 @@ export default {
         searchKeyWord: this.searchKeyWord,
         searchKeyWord: this.searchKeyWord,
         searchType: this.searchType,
         searchType: this.searchType,
         warehouseName: this.warehouseName,
         warehouseName: this.warehouseName,
-        managementType : 1 
+        managementType: 1
       })
       })
         .toPromise()
         .toPromise()
-        .then((response) => {
+        .then(response => {
           this.paymentList = response
           this.paymentList = response
-           this.deptBudgetTotal = response.total
-           this.WAREHOUSE.payname = this.warehouseName 
+          this.deptBudgetTotal = response.total
         })
         })
      getpayment({
      getpayment({
         currentPage: 1,
         currentPage: 1,
@@ -364,13 +314,13 @@ export default {
         {
         {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         }
         }
       )
       )
         .then(() => {
         .then(() => {
           delpayment({ id: row.id })
           delpayment({ id: row.id })
             .toPromise()
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.$message.success('删除成功')
               this.$message.success('删除成功')
               this.getList()
               this.getList()
             })
             })
@@ -379,12 +329,12 @@ export default {
           return false
           return false
         })
         })
     },
     },
-    screen(num){
+    screen(num) {
       this.searchType = num
       this.searchType = num
       this.getList()
       this.getList()
     },
     },
-    find(){
-       this.getList()
+    find() {
+      this.getList()
     },
     },
     settlement(index, row) {
     settlement(index, row) {
       var data = {}
       var data = {}
@@ -402,7 +352,7 @@ export default {
       if (row.goodsName)
       if (row.goodsName)
         this.$router.push({
         this.$router.push({
           path: 'settlement',
           path: 'settlement',
-          query: { type: index, id: row.id, waterMin: data1.waterMin },
+          query: { type: index, id: row.id, waterMin: data1.waterMin }
         })
         })
     },
     },
     payment() {
     payment() {
@@ -423,28 +373,28 @@ export default {
       if (!this.payments.money) {
       if (!this.payments.money) {
         this.$message({
         this.$message({
           message: '付款金额不能为空',
           message: '付款金额不能为空',
-          type: 'warning',
+          type: 'warning'
         })
         })
         return
         return
       }
       }
       if (this.payments.money > this.payments.amountNotPayable) {
       if (this.payments.money > this.payments.amountNotPayable) {
         this.$message({
         this.$message({
           message: '付款金额不能超过未付金额',
           message: '付款金额不能超过未付金额',
-          type: 'warning',
+          type: 'warning'
         })
         })
         return
         return
       }
       }
       if (!this.payments.paymentDate) {
       if (!this.payments.paymentDate) {
         this.$message({
         this.$message({
           message: '付款日期不能为空',
           message: '付款日期不能为空',
-          type: 'warning',
+          type: 'warning'
         })
         })
         return
         return
       }
       }
       if (!this.imageUrl) {
       if (!this.imageUrl) {
         this.$message({
         this.$message({
           message: '请上传付款截图 ',
           message: '请上传付款截图 ',
-          type: 'warning',
+          type: 'warning'
         })
         })
         return
         return
       }
       }
@@ -454,19 +404,19 @@ export default {
       this.$confirm('确定提交付款信息?', '提示', {
       this.$confirm('确定提交付款信息?', '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
-        type: 'warning',
+        type: 'warning'
       })
       })
         .then(() => {
         .then(() => {
           //付款提交
           //付款提交
           paymentCommit(this.payments)
           paymentCommit(this.payments)
             .toPromise()
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.$notify.success({
               this.$notify.success({
                 title: '成功',
                 title: '成功',
-                message: '付款成功',
+                message: '付款成功'
               })
               })
-               this.paymentForm = false
-               this.getList()
+              this.paymentForm = false
+              this.getList()
             })
             })
         })
         })
         .catch(() => {
         .catch(() => {
@@ -480,7 +430,7 @@ export default {
         this.$confirm('是否确定驳回?', '提示', {
         this.$confirm('是否确定驳回?', '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
         })
           .then(() => {
           .then(() => {
             this.audit(this.modification[0], 0, false, '', '')
             this.audit(this.modification[0], 0, false, '', '')
@@ -495,10 +445,10 @@ export default {
         if (status == true && item.status == '已驳回') {
         if (status == true && item.status == '已驳回') {
           auditpayment({
           auditpayment({
             compId: sessionStorage.getItem('ws-pf_compId'),
             compId: sessionStorage.getItem('ws-pf_compId'),
-            id: item.id,
+            id: item.id
           })
           })
             .toPromise()
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.audit(
               this.audit(
                 this.modification[index + 1],
                 this.modification[index + 1],
                 index + 1,
                 index + 1,
@@ -512,10 +462,10 @@ export default {
             taskId: item.taskId,
             taskId: item.taskId,
             approved: status,
             approved: status,
             auditMind: reason != undefined ? '已驳回' : '34',
             auditMind: reason != undefined ? '已驳回' : '34',
-            needReapply: status2 != undefined ? true : false,
+            needReapply: status2 != undefined ? true : false
           })
           })
             .toPromise()
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.audit(
               this.audit(
                 this.modification[index + 1],
                 this.modification[index + 1],
                 index + 1,
                 index + 1,
@@ -524,7 +474,7 @@ export default {
                 reason
                 reason
               )
               )
             })
             })
-            .catch((req) => {
+            .catch(req => {
               this.$message.warning(req.message)
               this.$message.warning(req.message)
             })
             })
         }
         }
@@ -546,7 +496,7 @@ export default {
         this.$confirm('是否确定通过?', '提示', {
         this.$confirm('是否确定通过?', '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
         })
           .then(() => {
           .then(() => {
             this.audit(this.modification[0], 0, true)
             this.audit(this.modification[0], 0, true)
@@ -559,11 +509,17 @@ export default {
     print(row) {
     print(row) {
       getpaymentexamine({ id: row.id })
       getpaymentexamine({ id: row.id })
         .toPromise()
         .toPromise()
-        .then((response) => {
+        .then(response => {
           this.isShowPrint = true
           this.isShowPrint = true
           this.printData = response
           this.printData = response
           let date = new Date()
           let date = new Date()
-          this.printData.currentTime = date.getFullYear() +"年"+ date.getMonth() +"月"+ date.getDay()+"日"
+          this.printData.currentTime =
+            date.getFullYear() +
+            '年' +
+            date.getMonth() +
+            '月' +
+            date.getDay() +
+            '日'
         })
         })
     },
     },
     examine() {
     examine() {
@@ -573,7 +529,7 @@ export default {
         this.$confirm('审核通过后,任务将发送给财务,是否确定通过?', '提示', {
         this.$confirm('审核通过后,任务将发送给财务,是否确定通过?', '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
         })
           .then(() => {})
           .then(() => {})
           .catch(() => {
           .catch(() => {
@@ -584,13 +540,16 @@ export default {
     selectInit(row) {
     selectInit(row) {
       //在这里一定要记得类型匹配的上。
       //在这里一定要记得类型匹配的上。
       if (row.status != '已驳回') {
       if (row.status != '已驳回') {
-        if (row.taskId == null&&row.status != '已通过'&&row.status!='部分付款') {
+        if (
+          row.taskId == null &&
+          row.status != '已通过' &&
+          row.status != '部分付款'
+        ) {
           return false
           return false
         } else {
         } else {
-           return true
+          return true
         }
         }
-      } 
-      else {
+      } else {
         return true
         return true
       }
       }
     },
     },
@@ -601,7 +560,7 @@ export default {
       for (let i = 0; i < this.warehouseList.length; i++) {
       for (let i = 0; i < this.warehouseList.length; i++) {
         if (this.warehouseList[i].id == this.warehouseNameKey) {
         if (this.warehouseList[i].id == this.warehouseNameKey) {
           this.warehouseName = this.warehouseList[i].warehouseName
           this.warehouseName = this.warehouseList[i].warehouseName
-          this.WAREHOUSE.payname = this.warehouseList[i].warehouseName
+          this.WAREHOUSE.payname = this.warehouseList[i].id
         }
         }
       }
       }
       this.getList()
       this.getList()
@@ -615,8 +574,8 @@ export default {
       this.currentPage = val
       this.currentPage = val
       console.log(`当前页: ${val}`)
       console.log(`当前页: ${val}`)
       this.getList()
       this.getList()
-    },
-  },
+    }
+  }
 }
 }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>