|
@@ -0,0 +1,184 @@
|
|
|
|
+<template>
|
|
|
|
+ <template-page ref="pageRef" :getList="getList" :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing"
|
|
|
|
+ :tableAttributes="tableAttributes" :tableEvents="tableEvents" :moreParameters="moreParameters"
|
|
|
|
+ :screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true">
|
|
|
|
+ </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 { orderBaseList2, orderBaseStatusCount2 } from "@/api/workOrderPool.js"
|
|
|
|
+import { listPageV2 } from "@/api/workOrder/orderType";
|
|
|
|
+import ywgdjs from "@/assets/ywgdjs.png"
|
|
|
|
+import yjs from "@/assets/yjs.png"
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ TemplatePage,
|
|
|
|
+ },
|
|
|
|
+ mixins: [import_mixin, operation_mixin],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ // 表格属性
|
|
|
|
+ tableAttributes: {
|
|
|
|
+ columnExpand: this.columnExpand
|
|
|
|
+ },
|
|
|
|
+ // 表格事件
|
|
|
|
+ tableEvents: {
|
|
|
|
+ 'expand-change':this.expandChange
|
|
|
|
+ },
|
|
|
|
+ orderTypeList: [],
|
|
|
|
+ orderStatusList: [],
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ moreParameters() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ name: '工单类型',
|
|
|
|
+ key: 'orderSmallType',
|
|
|
|
+ value: '',
|
|
|
|
+ conditions: [{
|
|
|
|
+ label: "全部",
|
|
|
|
+ value: ""
|
|
|
|
+ }, ...this.orderTypeList]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '工单状态',
|
|
|
|
+ key: 'orderStatus',
|
|
|
|
+ value: this.$route.query.orderStatus || "",
|
|
|
|
+ conditions: [{
|
|
|
|
+ label: "全部",
|
|
|
|
+ value: ""
|
|
|
|
+ }, ...this.orderStatusList]
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ // 用户信息
|
|
|
|
+ userInfo() {
|
|
|
|
+ return JSON.parse(localStorage.getItem('greemall_user'))
|
|
|
|
+ },
|
|
|
|
+ // 事件组合
|
|
|
|
+ optionsEvensGroup() {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ // 获取工单类型
|
|
|
|
+ listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
|
|
|
|
+ this.orderTypeList = res.data.records.map(item => ({
|
|
|
|
+ value: item.id,
|
|
|
|
+ label: item.orderSmallTypeText
|
|
|
|
+ }))
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+
|
|
|
|
+ screeningAnalysis(jname, val) {
|
|
|
|
+ if (jname == 'orderFlags') {
|
|
|
|
+ return (val || []).map(item => item.tagName).join(',')
|
|
|
|
+ } else {
|
|
|
|
+ return val
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterMethod(value, row, column) {
|
|
|
|
+ if (column['property'] == 'orderFlags') {
|
|
|
|
+ return (row[column['property']] || []).map(item => item.tagName).join(',') === value
|
|
|
|
+ }
|
|
|
|
+ return row[column['property']] === value
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取统计
|
|
|
|
+ getOrderBaseStatusCount(...p) {
|
|
|
|
+ orderBaseStatusCount2(...p).then(res => {
|
|
|
|
+ this.orderStatusList = [{
|
|
|
|
+ label: "已完工待结算",
|
|
|
|
+ value: "YWG"
|
|
|
|
+ }, {
|
|
|
|
+ label: "已结算",
|
|
|
|
+ value: "YJS"
|
|
|
|
+ }].map(item => {
|
|
|
|
+ var data = res.data.find(val => val.orderStatus == item.value)
|
|
|
|
+ if (data) {
|
|
|
|
+ item.label = `${item.label}(${data.total})`
|
|
|
|
+ }
|
|
|
|
+ return item
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 列表请求函数
|
|
|
|
+ getList(p, cb) {
|
|
|
|
+ var pam = JSON.parse(JSON.stringify(p))
|
|
|
|
+ try {
|
|
|
|
+ if (pam.orderStatus) {
|
|
|
|
+ pam.params.push({ "param": "a.order_status", "compare": "=", "value": pam.orderStatus })
|
|
|
|
+ }
|
|
|
|
+ if (pam.orderSmallType) {
|
|
|
|
+ pam.params.push({ "param": "a.order_small_type", "compare": "=", "value": pam.orderSmallType })
|
|
|
|
+ }
|
|
|
|
+ cb && cb(pam)
|
|
|
|
+ return orderBaseList2(pam)
|
|
|
|
+ } catch (err) {
|
|
|
|
+ } finally {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.getOrderBaseStatusCount({ orderSmallType: pam.orderSmallType || "" })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
|
+ if (item.jname === 'orderFlags') {
|
|
|
|
+ defaultData.render = (h, { row, index, column }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div style="padding:0 6px;display:flex;align-items:center;">
|
|
|
|
+ {(row[column.columnAttributes.prop] || []).map(item => {
|
|
|
|
+ if (item.tagName == "已完工") {
|
|
|
|
+ return (
|
|
|
|
+ <img src={ywgdjs} style="width:22px;height:22px;" />
|
|
|
|
+ )
|
|
|
|
+ } else if (item.tagName == "已结算") {
|
|
|
|
+ return (
|
|
|
|
+ <img src={yjs} style="width:22px;height:22px;" />
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ return (
|
|
|
|
+ <div style="display: inline-block;border:1px solid #409EFF; color:#409EFF;padding:0 2px;border-radius: 4px;margin:2px 2px 0 0;">
|
|
|
|
+ {item.tagName}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ })}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (item.jname === 'appointmentTime') {
|
|
|
|
+ defaultData.render = (h, { row, index, column }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div style="padding:0 6px;cursor: pointer;">
|
|
|
|
+ {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return defaultData
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ expandChange(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ columnExpand(h, { row, column, index }) {
|
|
|
|
+ console.log(row,"-------")
|
|
|
|
+ return null
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped></style>
|