linwenxin 1 éve
szülő
commit
1a67560a95

+ 40 - 0
src/api/applicationWithoutFee.js

@@ -31,3 +31,43 @@ export function enginMaterialExamine(params) {
     params
   })
 }
+
+export function enginMaterialListPageSettlementV2(data) {
+  return request({
+    url: `/engin/material/list/pageSettlementV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialPageSettlementExport(data, name) {
+  return postBlob({
+    url: '/engin/material/pageSettlementExport',
+    data,
+    name
+  })
+}
+
+export function enginMaterialListLine(data) {
+  return request({
+    url: `/engin/material/listLine?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialListLineExport(data, name) {
+  return postBlob({
+    url: '/engin/material/listLine/export',
+    data,
+    name
+  })
+}
+
+export function enginMaterialLineSettlement(params) {
+  return request({
+    url: `/engin/material/lineSettlement`,
+    method: 'post',
+    params
+  })
+}

+ 43 - 88
src/views/engineeringMaintenance/feeSettlementIncluded/index.vue

@@ -1,104 +1,59 @@
 <template>
-  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
-    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
-    :moreParameters="moreParameters">
-    <div class="cartographer_big">
-      <el-dialog title="创建工单" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
-      </el-dialog>
+  <zj-page-container>
+    <div class="tab">
+      <el-radio-group v-model="tabType" size="small" @change="tabTypeChange">
+        <el-radio-button label="collect">汇总</el-radio-button>
+        <el-radio-button label="offline">明细</el-radio-button>
+      </el-radio-group>
     </div>
-  </template-page>
+    <zj-page-fill>
+      <collect v-if="tabTypeCk == 'collect'" key="collect" />
+      <offline v-if="tabTypeCk == 'offline'" key="offline" :websitId="websitId" :workerId="workerId" :status="status" />
+    </zj-page-fill>
+  </zj-page-container>
 </template>
 
 <script>
-import TemplatePage from '@/components/template/template-page-1.vue'
-import import_mixin from '@/components/template/import_mixin.js'
-import operation_mixin from '@/components/template/operation_mixin.js'
-import { enginMaterialList, enginMaterialListExport } from "@/api/applicationWithoutFee.js"
+import { EventBus } from '@/utils/eventBus'
+import collect from './pages/collect.vue'
+import offline from './pages/offline.vue'
 export default {
-  components: {
-    TemplatePage,
-  },
-  mixins: [import_mixin, operation_mixin],
+  components: { collect, offline },
   data() {
     return {
-      // 创建表单
-      createFormBool: false,
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false,
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
+      tabType: 'collect',
+      tabTypeCk: 'collect',
+      websitId: "",
+      workerId: "",
+      status: "",
     }
   },
-  computed: {
-    moreParameters() {
-      return [
-        {
-          name: '状态',
-          key: 'examineStatus',
-          value: '',
-          conditions: [
-            { label: "全部", value: "" },
-            { label: "待审核", value: "WAIT" },
-            { label: "审核通过", value: "OK" },
-            { label: "驳回", value: "FAIL" },
-            { label: "取消", value: "NO" },
-            { label: "已支付", value: "PAID" },
-            { label: "未支付", value: "NO_PAID" },
-          ]
-        }
-      ]
-    },
+  created() {
+    EventBus.$on("tabTypeCkChange", ({ websitId, workerId, status, tabTypeCk }) => {
+      this.websitId = websitId
+      this.workerId = workerId
+      this.status = status
+      this.$nextTick(() => {
+        this.tabTypeCk = tabTypeCk
+        this.tabType = tabTypeCk
+      })
+    })
   },
   methods: {
-    // 列表请求函数
-    getList(p, cb) {
-      try {
-        var pam = JSON.parse(JSON.stringify(p))
-        pam.params.push({ "param": "is_all_fee", "compare": "=", "value": "NO" })
-        if (pam.examineStatus) {
-          pam.params.push({ "param": "examine_status", "compare": "=", "value": pam.examineStatus })
-        }
-        cb && cb(pam)
-        return enginMaterialList(pam)
-      } catch (err) {
-        console.log(err)
-      }
-    },
-
-    // 列表导出函数
-    exportList: enginMaterialListExport,
-
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      return defaultData
-    },
-
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-
-    operation() {
-      return this.operationBtn({
-        edit: {
-          click: ({ row, index, column }) => {
-
-          }
-        }
+    tabTypeChange() {
+      this.websitId = ""
+      this.workerId = ""
+      this.status = ""
+      this.$nextTick(() => {
+        this.tabTypeCk = this.tabType
       })
-    },
-
-    handleClose() {
-      this.createFormBool = false
-    },
-
-  }
+    }
+  },
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 71 - 0
src/views/engineeringMaintenance/feeSettlementIncluded/pages/collect.vue

@@ -0,0 +1,71 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListPageSettlementV2, enginMaterialPageSettlementExport, enginMaterialDetail } from "@/api/applicationWithoutFee.js"
+import { EventBus } from '@/utils/eventBus'
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {}
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: enginMaterialListPageSettlementV2,
+
+    // 列表导出函数
+    exportList: enginMaterialPageSettlementExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            var { websitId, workerId } = row
+            EventBus.$emit("tabTypeCkChange", { websitId, workerId, status: "", tabTypeCk: "offline" })
+          }
+        },
+        settle: {
+          click: ({ row, index, column }) => {
+            var { websitId, workerId } = row
+            EventBus.$emit("tabTypeCkChange", { websitId, workerId, status: "WAIT", tabTypeCk: "offline" })
+          }
+        },
+      })
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 167 - 0
src/views/engineeringMaintenance/feeSettlementIncluded/pages/offline.vue

@@ -0,0 +1,167 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+    <div class="cartographer_big">
+      <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
+        <zj-page-container v-if="formBool">
+          <zj-page-fill class="neibuview" v-if="formBool">
+            <zj-form-container v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module v-if="formBool" title="费用信息" :form-data="formData" :form-items="formItems">
+                <div v-if="openType === 1" style="text-align:right">
+                  <el-button size="mini" type="danger" plain @click="WAITfun">确定结算</el-button>
+                </div>
+              </zj-form-module>
+            </zj-form-container>
+          </zj-page-fill>
+        </zj-page-container>
+      </el-dialog>
+    </div>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListLine, enginMaterialListLineExport, enginMaterialDetail, enginMaterialLineSettlement } from "@/api/applicationWithoutFee.js"
+import feel from "../../mixins/feel.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, feel],
+  props: {
+    websitId: {
+      type: [String, Number],
+      default: ""
+    },
+    workerId: {
+      type: [String, Number],
+      default: ""
+    },
+    status: {
+      type: [String, Number],
+      default: ""
+    },
+  },
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {},
+      openType: 0
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.websitId) {
+          pam.params.push({ "param": "websit_id", "compare": "=", "value": this.websitId })
+        }
+        if (this.workerId) {
+          pam.params.push({ "param": "worker_id", "compare": "=", "value": this.workerId })
+        }
+        if (this.status) {
+          pam.params.push({ "param": "status", "compare": "=", "value": this.status })
+        }
+        cb && cb(pam)
+        return enginMaterialListLine(pam)
+      } catch (err) {
+        console.log(err)
+      }
+    },
+
+    // 列表导出函数
+    exportList: enginMaterialListLineExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail_mx: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 0
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+        settle_mx: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 1
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+      })
+    },
+
+    handleClose() {
+      this.formData = {}
+      this.formBool = false
+    },
+
+    WAITfun() {
+      this.$confirm('是否确定结算?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        enginMaterialLineSettlement({
+          id: this.formData.orderId
+        }).then(res => {
+          this.$refs.pageRef.refreshList()
+          this.handleClose()
+        })
+      }).catch(() => {
+
+      });
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>