Преглед на файлове

feat: 执行明细记录

zh преди 2 години
родител
ревизия
ba9bd82c7f

+ 48 - 0
src/api/executionRecord.js

@@ -0,0 +1,48 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListTradeExecV2(params) {
+  return request({
+    url: `/v2/order/trade-e/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListTradeExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/trade-e/exec/list/export',
+    data,
+    name
+  })
+}
+
+export function getListRetailExecV2(params) {
+  return request({
+    url: `/v2/order/retail/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListRetailExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/retail/exec/list/export',
+    data,
+    name
+  })
+}
+
+export function getListOtherExecV2(params) {
+  return request({
+    url: `/v2/order/other/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListOtherExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/other/exec/list/export',
+    data,
+    name
+  })
+}

+ 102 - 0
src/views/executionRecord/commercial.vue

@@ -0,0 +1,102 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="commercial" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListTradeExecV2, exportListTradeExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      refundOrderId: null,
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListTradeExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListTradeExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 384 - 0
src/views/executionRecord/orderDetail.vue

@@ -0,0 +1,384 @@
+<template>
+  <div>
+    <h4>订单信息</h4>
+    <el-divider />
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">销售退货单</div>
+          <div class="value">{{ detailData.refundOrderId }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单日期</div>
+          <div class="value">{{ detailData.refOrderDate }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售订单</div>
+          <div class="value">{{ detailData.refOrderId }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{ detailData.customerNumber }}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{ detailData.customerName }}</div>
+        </el-col>
+      </el-row>
+      <!-- 政策订单 -->
+      <el-row v-if="type === 'policy'">
+        <el-col :span="8" class="item">
+          <div class="label">销售政策编码</div>
+          <div class="value">{{ detailData.policyCode }}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">销售政策</div>
+          <div class="value">{{ detailData.policyTitle }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力回复</div>
+          <div class="value">{{ detailData.geLiNote }}</div>
+        </el-col>
+      </el-row>
+      <!-- 零售订单 -->
+      <el-row v-if="type === 'retail'">
+        <!-- <el-col :span="8" class="item">
+          <div class="label">产品大类</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col> -->
+        <el-col :span="24" class="item">
+          <div class="label">销售订单类型</div>
+          <div class="value">{{ orderType[detailData.refundOrderType] }}</div>
+        </el-col>
+      </el-row>
+      <!-- 商用工程订单 -->
+      <el-row v-if="type === 'commercial'">
+        <el-col :span="8" class="item">
+          <div class="label">工程信息编码</div>
+          <div class="value">{{ detailData.refEnginRecordNo }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程项目名称</div>
+          <div class="value">{{ detailData.refProjectName }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程信息单类型</div>
+          <div class="value">{{ detailData.refProjectType }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">厂工程编码</div>
+          <div class="value">{{ detailData.refFactoryNo }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">使用单位</div>
+          <div class="value">{{ detailData.refUseUnit }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label" />
+          <div class="value" />
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">联系人</div>
+          <div class="value">{{ detailData.refLinkman }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">固定电话</div>
+          <div class="value">{{ detailData.refTel }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">移动电话</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">不扣押金</div>
+          <div class="value">{{ detailData.takeDeposit?'不扣':'扣' }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">文件编码</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">业务员</div>
+          <div class="value">{{ detailData.serviceName }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力回复</div>
+          <div class="value">{{ detailData.geLiNote }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力内部备注</div>
+          <div class="value">{{ detailData.geLiInnerNote }}</div>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{ detailData.remark }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{ detailData.createBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{ detailData.createTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核人</div>
+          <div class="value">{{ detailData.examineBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{ detailData.examineTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新人</div>
+          <div class="value">{{ detailData.updateBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新日期</div>
+          <div class="value">{{ detailData.updateTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭人</div>
+          <div class="value">{{ detailData.refundBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭日期</div>
+          <div class="value">{{ detailData.refundTime }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审核说明</div>
+          <div class="value">{{ detailData.examineRemark }}</div>
+        </el-col>
+      </el-row>
+    </div>
+    <h4>货品信息</h4>
+    <el-divider />
+    <zj-table
+      :table-attributes="tableAttributes"
+      :is-drop="true"
+      :columns="columns"
+      :table-data="policyData"
+    />
+  </div>
+</template>
+
+<script>
+import { getRefundDetail } from '@/api/supply/salesReturnOrder'
+
+export default {
+  props: {
+    refundOrderId: {
+      type: String,
+      default: null
+    },
+    type: {
+      type: String,
+      default: null
+    }
+  },
+  data() {
+    return {
+      moduleType: 1,
+      detailData: {},
+      policyData: [],
+      tableAttributes: {
+        border: true,
+        headerCellClassName: 'headerRowColor',
+        size: 'mini',
+        'summary-method': this.$getSummaries,
+        'show-summary': true
+      },
+      orderType: {
+        TRADE: '商用',
+        HOME: '家用',
+        RETAIL: '零售单',
+        RETAIL_POLICY: '销售政策单'
+      }
+    }
+  },
+  computed: {
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '序号',
+            prop: 'index'
+          },
+          render: (h, { props, index }) => {
+            return <div>{index + 1}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '销售类型',
+            prop: 'saleTypeName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品编码',
+            prop: 'materialOldNumber',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'materialCode',
+            width: 200
+          }
+
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'materialName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specification',
+            width: 300
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单位',
+            prop: 'unit',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价',
+            prop: 'price',
+            width: 200
+          }
+        },
+        ...(() => {
+          return this.type !== 'commercial' ? [{
+            columnAttributes: {
+              label: '数量',
+              prop: 'qty',
+              width: 120
+            }
+          }] : [
+            {
+              columnAttributes: {
+                label: '工程信息数量',
+                prop: 'enginNum',
+                width: 120
+
+              }
+            },
+            {
+              columnAttributes: {
+                label: '数量',
+                prop: 'qty',
+                width: 120
+              }
+            }
+          ]
+        })(),
+        {
+          columnAttributes: {
+            label: '订单金额',
+            prop: 'totalAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '返利类型',
+            prop: 'customerWalletName2',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '使用返利金额',
+            prop: 'payRebateAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '格力折扣',
+            prop: 'discAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '现金钱包',
+            prop: 'customerWalletName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '实付金额',
+            prop: 'payAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '直调',
+            prop: 'directTransferStatus',
+            width: 120
+          }, render: (h, { row }) => {
+            const { directTransferStatus } = row
+            return <div>{directTransferStatus ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '直调数量',
+            prop: 'directTransferQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '原订单数量',
+            prop: 'oldQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '税率',
+            prop: 'tax',
+            width: 120
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    getRefundDetail({ refundOrderId: this.refundOrderId }).then(res => {
+      res.data.items.forEach(item => {
+        item.sums1 = ['directTransferQty', 'enginNum', 'hasSendQty', 'oldQty', 'qty', 'rebateRate', 'tax']
+        item.sums2 = ['orgPrice', 'payAmount', 'payRebateAmount', 'price', 'totalAmount']
+      })
+      this.detailData = res.data
+      this.policyData = res.data.items
+    })
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 103 - 0
src/views/executionRecord/policy.vue

@@ -0,0 +1,103 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="policy" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListRetailExecV2, exportListRetailExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: '',
+      refundOrderId: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListRetailExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListRetailExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 102 - 0
src/views/executionRecord/retail.vue

@@ -0,0 +1,102 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="retail" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListOtherExecV2, exportListOtherExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      refundOrderId: null,
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListOtherExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListOtherExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>