|
@@ -20,7 +20,7 @@ import { required, mobileRequired, mobile, httpUrl, email } from '@/components/t
|
|
|
import { listPageV2 } from "@/api/workOrder/settlementStandardInstall";
|
|
|
import { listPageV2 as listPageV2Repair } from "@/api/workOrder/settlementStandardRepair";
|
|
|
import { listPageV2 as listPageV2Other } from "@/api/workOrder/settlementStandardOther";
|
|
|
-import { orderBaseSettleNormDetail, orderBaseSettleNormConfirm } from "@/api/workOrderPool.js";
|
|
|
+import { orderBaseSettleNormDetail, orderBaseSettleNormConfirm, settleNormInstallQuery, settleNormOtherQuery } from "@/api/workOrderPool.js";
|
|
|
import { EventBus } from '@/utils/eventBus'
|
|
|
export default {
|
|
|
props: {
|
|
@@ -45,14 +45,45 @@ export default {
|
|
|
return [
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
+ label: '产品品牌',
|
|
|
+ prop: 'brand'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '产品大类',
|
|
|
+ prop: 'mainName'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '产品小类',
|
|
|
+ prop: 'smallName'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '产品机型',
|
|
|
+ prop: 'goodsName'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'orderNum'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
label: '工单类型',
|
|
|
prop: 'typeName'
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '产品大类',
|
|
|
- prop: 'parentCategoryId'
|
|
|
+ label: '结算产品大类',
|
|
|
+ prop: 'parentCategoryId',
|
|
|
+ width: '110'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return <div class="redbordererr">
|
|
@@ -68,7 +99,6 @@ export default {
|
|
|
row.normAmount = ""
|
|
|
row.repairAmount = ""
|
|
|
row.settleNormId = ""
|
|
|
- row.settleNum = ""
|
|
|
if (val) {
|
|
|
var data = this.classifyList.find(item => item.categoryId == val)
|
|
|
row.parentCategoryName = data.name
|
|
@@ -85,8 +115,9 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '产品小类',
|
|
|
- prop: 'categoryId'
|
|
|
+ label: '结算产品小类',
|
|
|
+ prop: 'categoryId',
|
|
|
+ width: '110'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return <div class="redbordererr">
|
|
@@ -100,7 +131,6 @@ export default {
|
|
|
row.normAmount = ""
|
|
|
row.repairAmount = ""
|
|
|
row.settleNormId = ""
|
|
|
- row.settleNum = ""
|
|
|
if (val) {
|
|
|
var data = this.classifyListLv2.find(item => item.categoryId == val)
|
|
|
row.categoryName = data.name
|
|
@@ -109,24 +139,18 @@ export default {
|
|
|
}
|
|
|
}}
|
|
|
placeholder="请选择">
|
|
|
- {this.classifyListLv2.filter(item => item.parentId === row.parentCategoryId).map((item, index_) => <el-option key={index_} label={item.name} value={item.categoryId}></el-option>)}
|
|
|
+ {this.classifyListLv2.filter(item => item.parentCategoryId === row.parentCategoryId).map((item, index_) => <el-option key={index_} label={item.name} value={item.categoryId}></el-option>)}
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- columnAttributes: {
|
|
|
- label: '机型',
|
|
|
- prop: 'goodsName'
|
|
|
- },
|
|
|
- },
|
|
|
...(() => {
|
|
|
if (this.formData.orderType == 'INSTALL') {
|
|
|
return [
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '功率',
|
|
|
+ label: '结算功率',
|
|
|
prop: 'label'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
@@ -137,7 +161,6 @@ export default {
|
|
|
value={row[column.columnAttributes.prop]}
|
|
|
onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
onChange={(val) => {
|
|
|
- row.settleNum = ""
|
|
|
if (val) {
|
|
|
var data = this.getflList(this.gonglv, row).find(item => item.label == val)
|
|
|
row.normAmount = data.normAmount
|
|
@@ -162,7 +185,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '数量',
|
|
|
+ label: '结算数量',
|
|
|
prop: 'settleNum'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
@@ -170,7 +193,7 @@ export default {
|
|
|
<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
<el-input
|
|
|
type="number"
|
|
|
- disabled={row.normAmount ? this.formData.settleStatus != 'YWG' : true}
|
|
|
+ disabled={this.formData.settleStatus != 'YWG'}
|
|
|
value={row[column.columnAttributes.prop]}
|
|
|
onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
placeholder="请输入内容"
|
|
@@ -211,7 +234,6 @@ export default {
|
|
|
value={row[column.columnAttributes.prop]}
|
|
|
onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
onChange={(val) => {
|
|
|
- row.settleNum = ""
|
|
|
if (val) {
|
|
|
var data = this.getflList(this.gonglr, row).find(item => item.label == val)
|
|
|
row.repairAmount = data.repairAmount
|
|
@@ -233,7 +255,8 @@ export default {
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
label: '上门费(元/单)',
|
|
|
- prop: 'repairAmount'
|
|
|
+ prop: 'repairAmount',
|
|
|
+ width: '110'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return <div class="redbordererr">
|
|
@@ -254,7 +277,8 @@ export default {
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
label: '维修费结算比例%',
|
|
|
- prop: 'normAmount'
|
|
|
+ prop: 'normAmount',
|
|
|
+ width: '110'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return <div class="redbordererr">
|
|
@@ -265,7 +289,8 @@ export default {
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
label: '维修费用结算',
|
|
|
- prop: 'repairNormAmount'
|
|
|
+ prop: 'repairNormAmount',
|
|
|
+ width: '110'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return <div class="redbordererr">
|
|
@@ -285,7 +310,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
- label: '数量',
|
|
|
+ label: '结算数量',
|
|
|
prop: 'settleNum'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
@@ -293,7 +318,7 @@ export default {
|
|
|
<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
<el-input
|
|
|
type="number"
|
|
|
- disabled={row.normAmount ? this.formData.settleStatus != 'YWG' : true}
|
|
|
+ disabled={this.formData.settleStatus != 'YWG'}
|
|
|
value={row[column.columnAttributes.prop]}
|
|
|
onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
placeholder="请输入内容"
|
|
@@ -525,6 +550,9 @@ export default {
|
|
|
id: this.id
|
|
|
}).then(res => {
|
|
|
this.formData = res.data || {}
|
|
|
+ this.formData.normList.map(item=>{
|
|
|
+ item.settleNum = item.orderNum
|
|
|
+ })
|
|
|
if (this.formData.orderType == "INSTALL") {
|
|
|
// 安装单请求
|
|
|
listPageV2({ "pageNum": 1, "pageSize": -1, "params": [] }).then(res => {
|
|
@@ -536,6 +564,33 @@ export default {
|
|
|
this.gonglr = res.data.records
|
|
|
})
|
|
|
}
|
|
|
+ settleNormInstallQuery({
|
|
|
+ settleNormType: this.formData.orderType,
|
|
|
+ type: this.formData.orderSmallType
|
|
|
+ }).then(res => {
|
|
|
+ var classifyList = {}
|
|
|
+ var classifyListLv2 = {}
|
|
|
+ this.classifyListLv2 = res.data.map(item => {
|
|
|
+ var { children, ...data } = item
|
|
|
+ classifyList[data.parentCategoryId] = data.parentCategoryName
|
|
|
+ classifyListLv2[data.categoryId] = {
|
|
|
+ name: data.categoryName,
|
|
|
+ ...data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.classifyListLv2 = Object.keys(classifyListLv2).map(key => classifyListLv2[key])
|
|
|
+ this.classifyList = Object.keys(classifyList).map(key => ({
|
|
|
+ name: classifyList[key],
|
|
|
+ categoryId: key
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ settleNormOtherQuery().then(res => {
|
|
|
+ this.gongqt = res.data;
|
|
|
+ this.gongqtdl = Array.from(new Set(res.data.map(item => item.type))).map(type => ({
|
|
|
+ label: type,
|
|
|
+ value: type
|
|
|
+ }));
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -543,28 +598,6 @@ export default {
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
- created() {
|
|
|
- // 获取产品大类小类
|
|
|
- getClassifyList({ type: 2, status: true }).then(res => {
|
|
|
- var classifyListLv2 = []
|
|
|
- this.classifyList = res.data.map(item => {
|
|
|
- var { children, ...data } = item
|
|
|
- classifyListLv2.push(...(children || []))
|
|
|
- return {
|
|
|
- ...data
|
|
|
- }
|
|
|
- });
|
|
|
- this.classifyListLv2 = classifyListLv2
|
|
|
- })
|
|
|
- // 其他类型
|
|
|
- listPageV2Other({ "pageNum": 1, "pageSize": -1, "params": [] }).then(res => {
|
|
|
- this.gongqt = res.data.records
|
|
|
- this.gongqtdl = Array.from(new Set(res.data.records.map(item => item.type))).map(type => ({
|
|
|
- label: type,
|
|
|
- value: type
|
|
|
- }))
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
getflList(list = [], row = {},) {
|
|
|
return list.filter(item => (
|