Переглянути джерело

Merge branch 'deploy' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into deploy

lilei 4 роки тому
батько
коміт
1bf5e00906

+ 21 - 10
src/views/financialManagement/companyCollectionPayment/detail.vue

@@ -17,15 +17,15 @@
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="基础信息">
           <a-descriptions :column="3">
-            <a-descriptions-item label="单位名称">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="单位类型">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="结算类型">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="收款金额">2</a-descriptions-item>
-            <a-descriptions-item label="折让金额">20</a-descriptions-item>
-            <a-descriptions-item label="结算金额">¥120.36</a-descriptions-item>
-            <a-descriptions-item label="结算时间">3</a-descriptions-item>
-            <a-descriptions-item label="操作人">4</a-descriptions-item>
-            <a-descriptions-item label="结算方式">¥11.2</a-descriptions-item>
+            <a-descriptions-item label="单位名称">{{ (basicInfoData&&basicInfoData.settleClientName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="单位类型">{{ (basicInfoData&&basicInfoData.settleClientTypeDictValue) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="结算类型">{{ (basicInfoData&&basicInfoData.settleTypeDictValue) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="应结算金额">{{ (basicInfoData&&basicInfoData.settleAmount) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="折让金额">{{ discountAmount || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="实结算金额">{{ (basicInfoData&&basicInfoData.realSettleAmount) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="结算时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="操作人">{{ (basicInfoData&&basicInfoData.operateName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="结算方式">{{ (basicInfoData&&basicInfoData.settleStyleName) || '--' }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
@@ -36,7 +36,7 @@
         <a-collapse-panel key="1" header="收款明细">
           <!-- alert -->
           <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">共 <strong>6</strong> 条明细,金额合计 <strong>¥{{ (productTotal&&productTotal.totalAmount) || 0 }}</strong> ,结算金额合计 <strong>¥{{ (productTotal&&productTotal.settleAmount) || 0 }}</strong> </div>
+            <div slot="message">共 <strong>{{ total }}</strong> 条明细,金额合计 <strong>¥{{ (basicInfoData&&basicInfoData.totalAmount) || 0 }}</strong> ,结算金额合计 <strong>¥{{ (basicInfoData&&basicInfoData.realSettleAmount) || 0 }}</strong> </div>
           </a-alert>
           <!-- 列表 -->
           <s-table
@@ -79,12 +79,23 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.total = data.list.length
           return data
         })
       },
+      total: 0, //  总条数
       basicInfoData: null //  基本信息
     }
   },
+  computed: {
+    discountAmount () {
+      let val = 0
+      if (this.basicInfoData && this.basicInfoData.discountAmount) {
+        val = Math.abs(this.basicInfoData.discountAmount)
+      }
+      return val
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 78 - 57
src/views/financialManagement/companyCollectionPayment/list.vue

@@ -6,16 +6,16 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="单位名称">
-              <a-input id="companyCollectionPaymentList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入单位名称"/>
+              <a-input id="companyCollectionPaymentList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入单位名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="单位类型">
               <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="companyCollectionPaymentList-billStatus"
-                code="PAYMENT_TYPE"
+                v-model="queryParam.settleClientType"
+                ref="settleClientType"
+                id="companyCollectionPaymentList-settleClientType"
+                code="SETTLE_CLIENT_TYPE"
                 placeholder="请选择单位类型"
                 allowClear></v-select>
             </a-form-item>
@@ -23,10 +23,10 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="结算类型">
               <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="companyCollectionPaymentList-billStatus"
-                code="PAYMENT_TYPE"
+                v-model="queryParam.settleType"
+                ref="settleType"
+                id="companyCollectionPaymentList-settleType"
+                code="SETTLE_TYPE"
                 placeholder="请选择结算类型"
                 allowClear></v-select>
             </a-form-item>
@@ -34,23 +34,25 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="结算单号">
-                <a-input id="companyCollectionPaymentList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入结算单号"/>
+                <a-input id="companyCollectionPaymentList-unitSettleNo" v-model.trim="queryParam.unitSettleNo" allowClear placeholder="请输入结算单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="结算时间">
-                <a-range-picker v-model="queryParam.creatDate" id="companyCollectionPaymentList-creatDate"/>
+                <a-range-picker
+                  style="width:100%"
+                  id="companyCollectionPaymentList-createDate"
+                  :disabledDate="disabledDate"
+                  v-model="createDate"
+                  :format="dateFormat"
+                  :placeholder="['开始时间', '结束时间']" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="结算方式">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="companyCollectionPaymentList-billStatus"
-                  code="PAYMENT_TYPE"
-                  placeholder="请选择结算方式"
-                  allowClear></v-select>
+                <a-select id="companyCollectionPaymentList-settleStyleSn" v-model="queryParam.settleStyleSn" placeholder="请选择结算方式" allowClear>
+                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
           </template>
@@ -69,7 +71,7 @@
     </div>
     <!-- alert -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>6</strong> 条记录,其中收款单 <strong>{{ (productTotal&&productTotal.receiptCount) || 0 }}</strong> 条,收款金额合计 <strong>¥{{ (productTotal&&productTotal.receiptAmount) || 0 }}</strong> ,付款单 <strong>{{ (productTotal&&productTotal.payCount) || 0 }}</strong> 条,付款金额合计 <strong>¥{{ (productTotal&&productTotal.payAmount) || 0 }}</strong> </div>
+      <div slot="message">共 <strong>{{ total }}</strong> 条记录,其中收款单 <strong>{{ (productTotal&&productTotal.receiptCount) || 0 }}</strong> 条,收款金额合计 <strong>¥{{ (productTotal&&productTotal.receiptAmount) || 0 }}</strong> ,付款单 <strong>{{ (productTotal&&productTotal.payCount) || 0 }}</strong> 条,付款金额合计 <strong>¥{{ (productTotal&&productTotal.payAmount) || 0 }}</strong> </div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -79,22 +81,20 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1180 }"
+      :scroll="{ x: 1340, y: tableHeight }"
       bordered>
       <!-- 结算单号 -->
       <template slot="unitSettleNo" slot-scope="text, record">
         <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
       </template>
-      <!-- 结算方式 -->
-      <template slot="sss" slot-scope="text, record">
-        <span>{{ record.state == 1 ? '现金' : '微信' }}</span>
-      </template>
     </s-table>
   </a-card>
 </template>
 
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import { settleStyleQueryAll } from '@/api/settleStyle'
 import { settleUnitList, settleUnitQuerySum } from '@/api/settle'
 export default {
   components: { STable, VSelect },
@@ -102,23 +102,43 @@ export default {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      createDate: [], //  创建时间
+      dateFormat: 'YYYY-MM-DD',
+      tableHeight: 0,
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        settleClientName: '',
+        settleClientType: undefined,
+        settleType: undefined,
+        unitSettleNo: '',
+        settleStyleSn: undefined
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '单位名称', dataIndex: 'settleClientName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位类型', dataIndex: 'settleClientTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '结算类型', dataIndex: 'settleTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '结算单号', scopedSlots: { customRender: 'unitSettleNo' }, width: 140, align: 'center' },
+        { title: '单位名称', dataIndex: 'settleClientName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位类型', dataIndex: 'settleClientTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算类型', dataIndex: 'settleTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算单号', scopedSlots: { customRender: 'unitSettleNo' }, width: 220, align: 'center' },
         { title: '结算金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '结算时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作人', dataIndex: 'operateName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '结算方式', dataIndex: 'settleStyleName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '操作人', dataIndex: 'operateName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '结算方式', dataIndex: 'settleStyleName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 440
+        }
+        // 结算时间
+        if (this.createDate && this.createDate.length > 0) {
+          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
         return settleUnitList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -126,15 +146,21 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.total = data.list.length
           this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },
+      settleStyleList: [],
       total: 0, //  总条数
       productTotal: null
     }
   },
   methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/financialManagement/companyCollectionPayment/detail/${row.id}` })
@@ -149,36 +175,31 @@ export default {
         }
       })
     },
-    //  审核
-    handleExamine (row, type) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
-        centered: true,
-        onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
-    },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.settleClientName = ''
+      this.queryParam.settleClientType = undefined
+      this.queryParam.settleType = undefined
+      this.queryParam.unitSettleNo = ''
+      this.queryParam.settleStyleSn = undefined
+      this.createDate = []
       this.$refs.table.refresh(true)
+    },
+    //  结算方式
+    getSettleStyle () {
+      settleStyleQueryAll({}).then(res => {
+        if (res.status == 200) {
+          this.settleStyleList = res.data
+        } else {
+          this.settleStyleList = []
+        }
+      })
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getSettleStyle()
+    })
   }
 }
 </script>

+ 8 - 1
src/views/financialManagement/companyReceivablePayable/list.vue

@@ -41,6 +41,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
+      :scroll="{ y: tableHeight }"
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
@@ -59,6 +60,7 @@ export default {
   data () {
     return {
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       // 查询参数
       queryParam: {
         settleClientName: '',
@@ -71,16 +73,21 @@ export default {
         { title: '单位类型', dataIndex: 'settleClientTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '应收金额', dataIndex: 'unSettleAmountReceipt', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '应付金额', dataIndex: 'unSettleAmountPay', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
         return settleUnitClientList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            // 应付金额  值为负,应显示为正
+            data.list[i].unSettleAmountPay = Math.abs(data.list[i].unSettleAmountPay) || 0
           }
           this.disabled = false
           this.total = data.list.length