Просмотр исходного кода

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

lilei 4 лет назад
Родитель
Сommit
4b4ec890c7

+ 19 - 5
src/api/sales.js

@@ -82,8 +82,22 @@ export const salesWriteSubmit = (params) => {
     method: 'get'
   })
 }
-
-
-
-
-
+//  财务收款 列表 分页
+export const salesReceiptList = (params) => {
+  const url = `/sales/queryPageByReceipt/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  财务收款
+export const salesReceipt = (params) => {
+  return axios({
+    url: `/sales/receipt/${params.sn}`,
+    data: params,
+    method: 'get'
+  })
+}

+ 328 - 1
src/views/financialManagement/financialCollection/list.vue

@@ -1,8 +1,335 @@
 <template>
+  <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="审核时间">
+              <a-range-picker
+                style="width:100%"
+                id="financialCollectionList-auditDate"
+                :disabledDate="disabledDate"
+                v-model="auditDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="经销商名称">
+              <a-input id="financialCollectionList-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入经销商名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="商户级别">
+              <v-select
+                v-model="queryParam.dealerLevel"
+                ref="dealerLevel"
+                id="financialCollectionList-dealerLevel"
+                code="DEALER_LEVEL"
+                placeholder="请选择商户级别"
+                allowClear></v-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="收款方式">
+                <v-select
+                  v-model="queryParam.settleStyleSn"
+                  ref="settleStyleSn"
+                  id="financialCollectionList-settleStyleSn"
+                  code="SETTLE_STYLE"
+                  placeholder="请选择收款方式"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="区域">
+                <subarea id="financialCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="financialCollectionList-billStatus"
+                  code="SALES_RECEIVE_LIST_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="财务状态">
+                <v-select
+                  v-model="queryParam.financialStatus"
+                  ref="financialStatus"
+                  id="financialCollectionList-financialStatus"
+                  code="FINANCIAL_RECEIVE_STATUS"
+                  placeholder="请选择财务状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="收款时间">
+                <a-range-picker
+                  style="width:100%"
+                  id="financialCollectionList-settleDate"
+                  :disabledDate="disabledDate"
+                  v-model="settleDate"
+                  :format="dateFormat"
+                  :placeholder="['开始时间', '结束时间']" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="12" :sm="24">
+              <a-row>
+                <a-form-item label="经销商地区">
+                  <a-col span="7">
+                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
+                      <a-select v-model="queryParam.dealerProvinceSn" @change="getCityList" placeholder="请选择省">
+                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-item prop="dealerCitySn" style="margin: 0;">
+                      <a-select v-model="queryParam.dealerCitySn" @change="getAreaList" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-item prop="dealerCountySn" style="margin: 0;">
+                      <a-select v-model="queryParam.dealerCountySn" placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                </a-form-item>
+              </a-row>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 8px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 总计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1820, y: tableHeight }"
+      bordered>
+      <!-- 单号 -->
+      <template slot="salesBillNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.financialStatus=='WAIT'"
+          class="button-warning"
+          @click="handleAudit(record)"
+          id="financialCollectionList-audit-btn">收款</a-button>
+        <span v-else>--</span>
+      </template>
+    </s-table>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import { getArea } from '@/api/data'
+import { salesReceiptList, salesReceipt } from '@/api/sales'
+export default {
+  components: { STable, VSelect, subarea },
+  data () {
+    return {
+      queryParam: { //  查询条件
+        buyerName: '',
+        dealerLevel: undefined,
+        settleStyleSn: undefined,
+        subareaSn: undefined,
+        billStatus: undefined,
+        financialStatus: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      auditDate: [], //  审核时间
+      settleDate: [], //  收款时间
+      dateFormat: 'YYYY-MM-DD',
+      advanced: false,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 220, align: 'center' },
+        { title: '经销商名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '订单金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款时间', dataIndex: 'settleDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remarks', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // 审核时间
+        if (this.auditDate && this.auditDate.length > 0) {
+          this.queryParam.beginAuditDate = moment(this.auditDate[0]).format(this.dateFormat)
+          this.queryParam.endAuditDate = moment(this.auditDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginAuditDate = undefined
+          this.queryParam.endAuditDate = undefined
+        }
+        // 收款时间
+        if (this.settleDate && this.settleDate.length > 0) {
+          this.queryParam.beginSettleDate = moment(this.settleDate[0]).format(this.dateFormat)
+          this.queryParam.endSettleDate = moment(this.settleDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginSettleDate = undefined
+          this.queryParam.endSettleDate = undefined
+        }
+        return salesReceiptList(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
+          }
+          this.total = data.count
+          this.disabled = false
+          return data
+        })
+      },
+      total: 0, // 合计
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.buyerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.settleStyleSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.billStatus = undefined
+      this.queryParam.financialStatus = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.auditDate = []
+      this.settleDate = []
+      this.$refs.table.refresh(true)
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
+    },
+    // 收款
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要收款吗?',
+        centered: true,
+        onOk () {
+          salesReceipt({ sn: row.salesBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.districtSn = undefined
+      this.getArea('city', val)
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.districtSn = undefined
+      this.getArea('district', val)
+    },
+    //  省/市/区
+    getArea (type, sn) {
+      let params
+      if (type == 'province') {
+        params = { level: '1' }
+      } else {
+        params = { psn: sn }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (type == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (type == 'city') {
+            this.addrCityList = res.data || []
+          } else if (type == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (type == 'province') {
+            this.addrProvinceList = []
+          } else if (type == 'city') {
+            this.addrCityList = []
+          } else if (type == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getArea('province')
+    })
+  }
+}
 </script>
 
-<style>
+<style lang="less">
+  .financialCollectionList-wrap{
+    .sTable{
+      margin-top: 20px;
+    }
+  }
 </style>

+ 1 - 0
src/views/productManagement/productLaunchAudit/list.vue

@@ -140,6 +140,7 @@ export default {
     },
     // 单个审核
     handleAudit (row) {
+      const _this = this
       this.$confirm({
         title: '提示',
         content: '确认要上线审核吗?',