瀏覽代碼

Merge branch 'master' of https://gogs.zfire.top/linwenxin/jsm-mall-front into 中差评申诉

linwenxin 4 月之前
父節點
當前提交
e1799332f9

+ 15 - 0
src/api/auxiliaryMaterialReport.js

@@ -0,0 +1,15 @@
+export function settlementOrderNewListPgOrder(data) {
+  return request({
+    url: `/settlementOrderNew/list/pgOrder?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function settlementOrderNewPgOrderExport(data, name) {
+  return postBlob({
+    url: '/settlementOrderNew/pgOrderExport',
+    data,
+    name
+  })
+}

+ 156 - 0
src/views/auxiliaryFittings/auxiliaryMaterialReport/index.vue

@@ -0,0 +1,156 @@
+<template>
+  <template-page
+    v-if="showTableBool"
+    ref="pageRef"
+    :get-list="getList"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :options-evens-group="optionsEvensGroup"
+    :moreParameters="moreParameters"
+    :column-parsing="columnParsing"
+    :exportList="exportList"
+  >
+    <div slot="moreSearch">
+      <div style="margin-bottom: 10px">
+        <span
+          style="
+            font-size: 12px;
+            font-weight: 400;
+            text-align: left;
+            color: #666;
+            line-height: 28px;
+            margin-right: 10px;
+          "
+          >选择范围</span
+        >
+        <el-date-picker
+          size="mini"
+          v-model="value1"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          align="right"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+        >
+        </el-date-picker>
+      </div>
+    </div>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import { settlementOrderNewListPgOrder, settlementOrderNewPgOrderExport } from '@/api/auxiliaryMaterialReport'
+import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      value1: [],
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', [start, end])
+            }
+          },
+          {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+              picker.$emit('pick', [start, end])
+            }
+          }
+        ],
+        onPick: obj => {
+          this.pickerMinDate = new Date(obj.minDate).getTime()
+        },
+        disabledDate: time => {
+          if (this.pickerMinDate) {
+            const day1 = 31 * 24 * 3600 * 1000
+            let maxTime = this.pickerMinDate + day1
+            let minTime = this.pickerMinDate - day1
+            return time.getTime() > maxTime || time.getTime() < minTime
+          }
+        }
+      },
+      pickerMinDate: null,
+      showTableBool: true
+    }
+  },
+  watch: {
+    value1() {
+      if (!this.value1) {
+        this.pickerMinDate = null
+      }
+      this.showTableBool = false
+      this.$nextTick(() => {
+        this.showTableBool = true
+      })
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return []
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      var pam = JSON.parse(JSON.stringify(p))
+      try {
+        if (this.value1 && this.value1.length) {
+          pam.overTime = `${this.value1?.[0]} 00:00:00`
+          pam.overEndTime = `${this.value1?.[1]} 23:59:59`
+          cb && cb(pam)
+          return settlementOrderNewListPgOrder(pam)
+        }
+      } catch (err) {}
+    },
+    // 列表导出函数
+    exportList(...p) {
+      if (this.value1) {
+        return settlementOrderNewPgOrderExport(...p)
+      }
+    },
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 64 - 9
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -35,7 +35,7 @@
                 <el-input type="text" :value="formData.salesId" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="16">
+            <el-col :span="8">
               <el-form-item label="网点名称" prop="websitId">
                 <el-select
                   clearable
@@ -58,6 +58,28 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
+              <el-form-item label="师傅所属网点" prop="websitId">
+                <el-select
+                  clearable
+                  filterable
+                  v-model="formData.websit2"
+                  :disabled="formData.flag != 'SAVE' && formType != 0"
+                  value-key="websitId"
+                  @change="changeWebsit2"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in websitList2"
+                    :key="item.websitId"
+                    :label="`(${item.websitId})${item.name}`"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
               <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
                 <el-radio-group
                   v-model="formData.buyPeople"
@@ -666,6 +688,7 @@ export default {
     return {
       dataList: [],
       websitList: [],
+      websitList2: [],
       workerList: [],
       mainList: [],
       projectList: [],
@@ -675,8 +698,11 @@ export default {
       payCodeUrl: '',
       formData: {
         websit: {},
+        websit2: {},
         websitId: '',
         websitName: '',
+        workerWebsitName: '',
+        workerWebsitId: '',
         file_url: [],
         salesId: '',
         flag: '',
@@ -767,6 +793,7 @@ export default {
       getDetail({ salesId: this.id }).then(async res => {
         Object.assign(this.formData, res.data, {
           websit: { websitId: res.data.websitId, name: res.data.websitName },
+          websit2: { websitId: res.data.workerWebsitId, name: res.data.workerWebsitName },
           worker: { nickName: res.data.workerName, userId: res.data.workerId },
           project: {
             id: res.data.orderEnginBaseId,
@@ -818,6 +845,9 @@ export default {
       getWebsit({ type: 'C' }).then(res => {
         this.websitList = res.data
       })
+      getWebsit({ type: 'C', isAll: true }).then(res => {
+        this.websitList2 = res.data
+      })
     },
     changeWebsit(e) {
       this.dataList = []
@@ -825,10 +855,18 @@ export default {
       this.formData.websitName = e.name
       this.formData.storageName = ''
       this.formData.storageId = ''
-      this.getWorker()
       this.getCategory(e.websitId, this.formData.storageId)
       this.getWarehouseList(e.websitId)
     },
+    changeWebsit2(e) {
+      this.formData.workerWebsitId = e.websitId
+      this.formData.workerWebsitName = e.name
+      this.formData.identity = ''
+      this.formData.workerMobile = ''
+      this.formData.workerId = ''
+      this.formData.workerName = ''
+      this.getWorker()
+    },
     changeStorage(e) {
       if (!this.formData.isImport && this.formData.orderSource == 'SELF') {
         this.dataList = []
@@ -914,13 +952,24 @@ export default {
       }
     },
     getWorker() {
-      getWorker({
-        pageNum: 1,
-        pageSize: -1,
-        params: this.formType == 2 ? [] : [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
-      }).then(res => {
-        this.workerList = res.data.records
-      })
+      if (this.formData.workerWebsitId) {
+        getWorker({
+          pageNum: 1,
+          pageSize: -1,
+          ignoreWebsitRole: true,
+          params:
+            this.formType == 2
+              ? []
+              : [
+                  { param: 'b.websit_id', compare: '=', value: this.formData.workerWebsitId }
+                  // { param: 'b.ignore_websit_role', compare: '=', value: true }
+                ]
+        }).then(res => {
+          this.workerList = res.data.records
+        })
+      } else {
+        this.workerList = []
+      }
     },
     changeWorker(e) {
       this.formData.identity = e.idCard
@@ -1062,6 +1111,8 @@ export default {
             remark: this.formData.remark,
             websitId: this.formData.websitId,
             websitName: this.formData.websitName,
+            workerWebsitName: this.formData.workerWebsitName,
+            workerWebsitId: this.formData.workerWebsitId,
             workerName: this.formData.workerName,
             workerId: this.formData.workerId,
             identity: this.formData.identity,
@@ -1177,6 +1228,8 @@ export default {
               websitId: this.formData.websitId,
               websitName: this.formData.websitName,
               workerName: this.formData.workerName,
+              workerWebsitName: this.formData.workerWebsitName,
+              workerWebsitId: this.formData.workerWebsitId,
               workerId: this.formData.workerId,
               identity: this.formData.identity,
               workerMobile: this.formData.workerMobile,
@@ -1201,6 +1254,8 @@ export default {
               remark: this.formData.remark,
               websitId: this.formData.websitId,
               websitName: this.formData.websitName,
+              workerWebsitName: this.formData.workerWebsitName,
+              workerWebsitId: this.formData.workerWebsitId,
               workerName: this.formData.workerName,
               workerId: this.formData.workerId,
               identity: this.formData.identity,