|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<template-page ref="pageRef" :getList="getList" :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing"
|
|
|
:tableAttributes="tableAttributes" :tableEvents="tableEvents" :moreParameters="moreParameters"
|
|
|
- :screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true">
|
|
|
+ :screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true" :showTable="showTable">
|
|
|
</template-page>
|
|
|
</template>
|
|
|
|
|
@@ -9,10 +9,11 @@
|
|
|
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 { orderBaseList2, orderBaseStatusCount2, orderBaseSettleNormDetail2 } from "@/api/workOrderPool.js"
|
|
|
import { listPageV2 } from "@/api/workOrder/orderType";
|
|
|
import ywgdjs from "@/assets/ywgdjs.png"
|
|
|
import yjs from "@/assets/yjs.png"
|
|
|
+import { required } from '@/components/template/rules_verify.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
TemplatePage,
|
|
@@ -26,10 +27,11 @@ export default {
|
|
|
},
|
|
|
// 表格事件
|
|
|
tableEvents: {
|
|
|
- 'expand-change':this.expandChange
|
|
|
+ 'expand-change': this.expandChange
|
|
|
},
|
|
|
orderTypeList: [],
|
|
|
orderStatusList: [],
|
|
|
+ showTable: true,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -168,17 +170,903 @@ export default {
|
|
|
return defaultData
|
|
|
},
|
|
|
|
|
|
- expandChange(){
|
|
|
-
|
|
|
+ expandChange(row) {
|
|
|
+ if (!row.expandData) {
|
|
|
+ orderBaseSettleNormDetail2({
|
|
|
+ id: row.id,
|
|
|
+ orderProductId: row.pgOrderProductId
|
|
|
+ }).then(res => {
|
|
|
+ var orderChannelId
|
|
|
+ var normList = []
|
|
|
+ var pfuqinid = 0
|
|
|
+ res.data.normList.map((item, index) => {
|
|
|
+ if (!orderChannelId) { orderChannelId = item.orderChannelId }
|
|
|
+ item.settleNum = item.settleNum || ""
|
|
|
+ normList.push({ ...item, pfuqinid: pfuqinid, zijideid: 0, bianji: res.data.settleStatus == 'YJS' ? false : true })
|
|
|
+ item.workerList.map((resdata, ind_) => {
|
|
|
+ if (ind_ !== 0) { normList.push({ pfuqinid: pfuqinid, zijideid: ind_ }) }
|
|
|
+ if (ind_ == item.workerList.length - 1) { pfuqinid += (ind_ + 1) }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ var otherNormList = []
|
|
|
+ var qtpfuqinid = 0
|
|
|
+ res.data.otherNormList.map((item, index) => {
|
|
|
+ item.settleNum = item.settleNum || ""
|
|
|
+ otherNormList.push({ ...item, pfuqinid: qtpfuqinid, zijideid: 0, bianji: res.data.settleStatus == 'YJS' ? false : true })
|
|
|
+ item.workerList.map((resdata, ind_) => {
|
|
|
+ if (ind_ !== 0) { otherNormList.push({ pfuqinid: qtpfuqinid, zijideid: ind_ }) }
|
|
|
+ if (ind_ == item.workerList.length - 1) { qtpfuqinid += (ind_ + 1) }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ row.expandData = res.data ? { ...res.data, normList, otherNormList } : {};
|
|
|
+ this.showTable = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.showTable = true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
columnExpand(h, { row, column, index }) {
|
|
|
- console.log(row,"-------")
|
|
|
- return null
|
|
|
- }
|
|
|
+ var expandDataForm = row.expandData
|
|
|
+ return expandDataForm ? (<div style="box-sizing: border-box;padding: 10px 10px 0px 50px;">
|
|
|
+ <zj-form-container form-data={expandDataForm}
|
|
|
+ formAttributes={{ 'label-position': 'top' }}
|
|
|
+ styleSwitch={false}>
|
|
|
+ <zj-form-module title="费用结算" showHade={false} form-data={expandDataForm}
|
|
|
+ form-items={[{
|
|
|
+ md: 24,
|
|
|
+ name: 'slot-component',
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '费用结算',
|
|
|
+ prop: 'normList',
|
|
|
+ },
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
+ var { formData } = props
|
|
|
+ var columns = [{
|
|
|
+ columnAttributes: {
|
|
|
+ label: '工单类型',
|
|
|
+ prop: 'typeName'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算工单来源',
|
|
|
+ prop: 'channelId',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.parentCategoryId = ""
|
|
|
+ row.parentCategoryName = ""
|
|
|
+ row.categoryId = ""
|
|
|
+ row.categoryName = ""
|
|
|
+ row.label = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.repairAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ if (val) {
|
|
|
+ var data = this.classifyListChuLi([], "orderChannelId", "orderChannelText").find(item => item.value == val)
|
|
|
+ row.channelText = data.label
|
|
|
+ } else {
|
|
|
+ row.channelText = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.classifyListChuLi([], "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算产品大类',
|
|
|
+ prop: 'parentCategoryId',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.categoryId = ""
|
|
|
+ row.categoryName = ""
|
|
|
+ row.label = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.repairAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ if (val) {
|
|
|
+ var data = this.classifyListChuLi([], "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).find(item => item.value == val)
|
|
|
+ row.parentCategoryName = data.label
|
|
|
+ } else {
|
|
|
+ row.parentCategoryName = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.classifyListChuLi([], "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算产品小类',
|
|
|
+ prop: 'categoryId',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.label = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.repairAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ if (val) {
|
|
|
+ var data = this.classifyListChuLi([], "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).find(item => item.value == val)
|
|
|
+ row.categoryName = data.label
|
|
|
+ } else {
|
|
|
+ row.categoryName = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.classifyListChuLi([], "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ...(() => {
|
|
|
+ if (expandDataForm.orderType == 'INSTALL') {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算功率',
|
|
|
+ prop: 'label'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ if (val) {
|
|
|
+ var data = this.getflList([], row).find(item => item.label == val)
|
|
|
+ row.normAmount = data.normAmount
|
|
|
+ row.settleNormId = data.id
|
|
|
+ } else {
|
|
|
+ row.normAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.getflList([], row).map((item, index_) => <el-option key={index_} label={item.label} value={item.label}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算标准(元/套)',
|
|
|
+ prop: 'normAmount'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算数量',
|
|
|
+ prop: 'settleNum'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算金额(元)',
|
|
|
+ prop: 'settleAmount',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ {row.settleAmount}
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ })(),
|
|
|
+ ...(() => {
|
|
|
+ if (expandDataForm.orderType == 'REPAIR') {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '质保类型',
|
|
|
+ prop: 'label'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ if (val) {
|
|
|
+ var data = this.getflList([], row).find(item => item.label == val)
|
|
|
+ row.repairAmount = data.repairAmount
|
|
|
+ row.normAmount = data.normAmount
|
|
|
+ row.settleNormId = data.id
|
|
|
+ } else {
|
|
|
+ row.repairAmount = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.getflList([], row).map((item, index_) => <el-option key={index_} label={({ INSIDE: '保内', OUT: '保外' })[item.label]} value={item.label}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '上门费(元/单)',
|
|
|
+ prop: 'repairAmount',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ type="number"
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '维修费结算比例%',
|
|
|
+ prop: 'normAmount',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ {row[column.columnAttributes.prop]}%
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '维修费用结算',
|
|
|
+ prop: 'repairNormAmount',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ type="number"
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算数量',
|
|
|
+ prop: 'settleNum'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算金额(元)',
|
|
|
+ prop: 'settleAmount',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ row.settleAmount = (((Number(row.repairAmount || 0) + (Number(row.normAmount || 0) / 100) * Number(row.repairNormAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ {row.settleAmount}
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ })(),
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remark'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <el-input
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '工程师名称',
|
|
|
+ prop: 'workerName'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '联系电话',
|
|
|
+ prop: 'workerMobile',
|
|
|
+ width: '140px'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算费用',
|
|
|
+ prop: 'settleAmount'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ disabled={!expandDataForm.normList[row.pfuqinid].bianji || expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
|
|
|
+ value={expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => {
|
|
|
+ expandDataForm.normList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
|
|
|
+ }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '确认人',
|
|
|
+ prop: 'confirmBy'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '确认时间',
|
|
|
+ prop: 'confirmTime'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '汇总状态',
|
|
|
+ prop: 'poolStatus'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ prop: '',
|
|
|
+ fixed: 'right',
|
|
|
+ width: "100px"
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.normList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ var yjsje = [0, 0, 0, expandDataForm?.normList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
|
|
|
+ return prev + curr;
|
|
|
+ })
|
|
|
+ var nou = expandDataForm?.normList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
|
+ var qian = ((((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
+ var rongyu = ((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
|
+ nou.map((item, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
|
+ } else {
|
|
|
+ item.settleAmount = qian
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }>平分费用</el-button> : null}
|
|
|
+ {expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ var item = expandDataForm.normList[row.pfuqinid]
|
|
|
+ if ([0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
|
|
|
+ return prev + curr;
|
|
|
+ }) == Number(item.settleAmount)) {
|
|
|
+ expandDataForm.normList[row.pfuqinid].bianji = false
|
|
|
+ } else {
|
|
|
+ this.$message.warning(`费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }>确定</el-button> : null}
|
|
|
+ {!expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ expandDataForm.normList[row.pfuqinid].bianji = true
|
|
|
+ }
|
|
|
+ }>修改</el-button> : null}
|
|
|
+ </div>) : null
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ return (
|
|
|
+ <zj-table
|
|
|
+ columns={columns}
|
|
|
+ table-data={formData.normList}
|
|
|
+ tableAttributes={{
|
|
|
+ 'span-method': ({ row, column, rowIndex, columnIndex }) => {
|
|
|
+ if (columnIndex === columns.length - 1) {
|
|
|
+ if (row.zijideid == 0) {
|
|
|
+ return {
|
|
|
+ rowspan: formData.normList[row.pfuqinid].workerList.length,
|
|
|
+ colspan: 1
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ md: 24,
|
|
|
+ name: 'slot-component',
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '其他费用结算',
|
|
|
+ prop: 'otherNormList',
|
|
|
+ },
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
+ var { formData } = props
|
|
|
+ var columns = [{
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算工单来源',
|
|
|
+ prop: 'channelId',
|
|
|
+ width: '110'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.type = ""
|
|
|
+ row.label = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ row.settleNum = ""
|
|
|
+ if (val) {
|
|
|
+ var data = this.otherListChuLi([], "orderChannelId", "orderChannelText").find(item => item.value == val)
|
|
|
+ row.channelText = data.label
|
|
|
+ } else {
|
|
|
+ row.channelText = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.otherListChuLi([], "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '费用类型',
|
|
|
+ prop: 'type'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.label = ""
|
|
|
+ row.normAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ row.settleNum = ""
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.otherListChuLi([], "type", "typeName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '规格',
|
|
|
+ prop: 'label'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <el-select
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ onChange={(val) => {
|
|
|
+ row.settleNum = ""
|
|
|
+ if (val) {
|
|
|
+ var data = this.otherListChuLi([], "label", "label", (item) => { return item.orderChannelId == row.channelId && item.type == row.type }, "normAmount", "id").find(item => item.label == val)
|
|
|
+ row.normAmount = data.normAmount
|
|
|
+ row.settleNormId = data.id
|
|
|
+ } else {
|
|
|
+ row.normAmount = ""
|
|
|
+ row.settleNormId = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.otherListChuLi([], "label", "label", (item) => item.orderChannelId == row.channelId && item.type == row.type).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '单价(元/套)',
|
|
|
+ prop: 'normAmount'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'settleNum'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ disabled={!row.bianji || row.normAmount ? expandDataForm.settleStatus != 'YWG' : true}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算金额(元)',
|
|
|
+ prop: 'settleAmount',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ {row.settleAmount}
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remark'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return this.panfuan(row) ? <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <el-input
|
|
|
+ disabled={!row.bianji || expandDataForm.settleStatus != 'YWG'}
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div> : null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '工程师名称',
|
|
|
+ prop: 'workerName'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '联系电话',
|
|
|
+ prop: 'workerMobile',
|
|
|
+ width: '140px'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '结算费用',
|
|
|
+ prop: 'settleAmount'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr">
|
|
|
+ <el-form-item label="" label-width="0px" prop={`otherNormList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ disabled={!expandDataForm.otherNormList[row.pfuqinid].bianji || expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
|
|
|
+ value={expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => {
|
|
|
+ expandDataForm.otherNormList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
|
|
|
+ }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '确认人',
|
|
|
+ prop: 'confirmBy'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '确认时间',
|
|
|
+ prop: 'confirmTime'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '汇总状态',
|
|
|
+ prop: 'poolStatus'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ prop: '',
|
|
|
+ fixed: 'right',
|
|
|
+ width: "100px"
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.otherNormList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
|
|
|
+ {expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ var yjsje = [0, 0, 0, expandDataForm?.otherNormList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
|
|
|
+ return prev + curr;
|
|
|
+ })
|
|
|
+ var nou = expandDataForm?.otherNormList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
|
+ var qian = ((((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
+ var rongyu = ((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
|
+ nou.map((item, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
|
+ } else {
|
|
|
+ item.settleAmount = qian
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }>平分费用</el-button> : null}
|
|
|
+ {expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ var item = expandDataForm.otherNormList[row.pfuqinid]
|
|
|
+ if ([0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
|
|
|
+ return prev + curr;
|
|
|
+ }) == Number(item.settleAmount)) {
|
|
|
+ expandDataForm.otherNormList[row.pfuqinid].bianji = false
|
|
|
+ } else {
|
|
|
+ this.$message.warning(`其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }>确定</el-button> : null}
|
|
|
+ {!expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
|
|
|
+ () => {
|
|
|
+ expandDataForm.otherNormList[row.pfuqinid].bianji = true
|
|
|
+ }
|
|
|
+ }>修改</el-button> : null}
|
|
|
+ </div>) : null
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ return (
|
|
|
+ <zj-table
|
|
|
+ columns={columns}
|
|
|
+ table-data={formData.otherNormList}
|
|
|
+ tableAttributes={{
|
|
|
+ 'span-method': ({ row, column, rowIndex, columnIndex }) => {
|
|
|
+ if (columnIndex === columns.length - 1) {
|
|
|
+ if (row.zijideid == 0) {
|
|
|
+ return {
|
|
|
+ rowspan: formData.otherNormList[row.pfuqinid].workerList.length,
|
|
|
+ colspan: 1
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }]} />
|
|
|
+ </zj-form-container>
|
|
|
+ </div>) : null
|
|
|
+ },
|
|
|
+
|
|
|
+ panfuan(item) {
|
|
|
+ if (!!item.id) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 产品类型过滤筛选
|
|
|
+ classifyListChuLi(list, value, label, func, ...keys) {
|
|
|
+ var obj = {};
|
|
|
+ list.map(item => {
|
|
|
+ if (func && !func(item)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ obj[item[value]] = {
|
|
|
+ label: item[label]
|
|
|
+ }
|
|
|
+ for (var key of keys) {
|
|
|
+ obj[item[value]][key] = item[key]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return Object.keys(obj).map(value => {
|
|
|
+ return {
|
|
|
+ value: value,
|
|
|
+ ...obj[value]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 其他类型筛选
|
|
|
+ otherListChuLi(list, value, label, func, ...keys) {
|
|
|
+ var obj = {};
|
|
|
+ list.map(item => {
|
|
|
+ if (func && !func(item)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ obj[item[value]] = {
|
|
|
+ label: item[label]
|
|
|
+ }
|
|
|
+ for (var key of keys) {
|
|
|
+ obj[item[value]][key] = item[key]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return Object.keys(obj).map(value => {
|
|
|
+ return {
|
|
|
+ value: value,
|
|
|
+ ...obj[value]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getflList(list = [], row = {},) {
|
|
|
+ return list.filter(item => (
|
|
|
+ item.type == row.type &&
|
|
|
+ item.parentCategoryId == row.parentCategoryId &&
|
|
|
+ item.categoryId == row.categoryId
|
|
|
+ ))
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.aaa {
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px 10px 10px 50px;
|
|
|
+}
|
|
|
+</style>
|