优化联调
This commit is contained in:
parent
f80e143545
commit
3edf61bbfb
|
|
@ -372,4 +372,13 @@ export function getMaTypeDataById(data) {
|
|||
},
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 获取预退数量
|
||||
export function getPreAuditNum(params) {
|
||||
return request({
|
||||
url: '/material/base/backReceive/getPreAuditNum',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
|
@ -128,3 +128,12 @@ export function getMaTypeSelectApi(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取配件总费用
|
||||
export function getCostByPidAndNumApi(query) {
|
||||
return request({
|
||||
url: '/material/base/repair/getCostByPidAndNum',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="status">
|
||||
<el-form-item label="类型名称" prop="status">
|
||||
<el-cascader
|
||||
filterable
|
||||
collapse-tags
|
||||
|
|
@ -84,11 +84,23 @@
|
|||
ref="deviceTypeCascader"
|
||||
:options="deviceTypeTree"
|
||||
@change="deviceTypeChange"
|
||||
placeholder="请输入规格型号"
|
||||
placeholder="请输入类型名称"
|
||||
popper-class="popper-select"
|
||||
:props="deviceTypeTreeProps"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="typeId">
|
||||
<el-select
|
||||
v-model="queryParams.typeId"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="请选择规格型号"
|
||||
@change="changeType"
|
||||
>
|
||||
<el-option v-for="item in typeListDev" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.estimateLeaseTime"
|
||||
|
|
@ -303,6 +315,7 @@ import {
|
|||
getAgreementInfoByIdApi,
|
||||
getHoldingPoleSelListApi,
|
||||
getLevelTwoUnitCbx,
|
||||
getMaTypeDataById,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { getInfo } from '@/api/login'
|
||||
export default {
|
||||
|
|
@ -400,6 +413,7 @@ export default {
|
|||
deptOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
typeId: null,
|
||||
types: 2,
|
||||
unitId: null,
|
||||
proId: null,
|
||||
|
|
@ -425,6 +439,8 @@ export default {
|
|||
{ id: '0', name: '工程租赁' },
|
||||
{ id: '1', name: '长期领用' },
|
||||
], //集合
|
||||
typeListDev: [], // 规格型号
|
||||
selectParams: {},
|
||||
leaseApplyDetails: [],
|
||||
leaseApplyInfoList: [],
|
||||
//领料详情单条模板
|
||||
|
|
@ -490,7 +506,7 @@ export default {
|
|||
|
||||
// 设备 树显示 配置
|
||||
deviceTypeTreeProps: {
|
||||
multiple: true,
|
||||
// multiple: true,
|
||||
value: 'id',
|
||||
},
|
||||
// 选中的设备类型
|
||||
|
|
@ -616,10 +632,11 @@ export default {
|
|||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTree() {
|
||||
const params = {
|
||||
level: 4,
|
||||
level: 3,
|
||||
}
|
||||
getDeviceTypeTree(params).then((res) => {
|
||||
this.deviceTypeTree = res.data
|
||||
console.log('🚀 ~ getDeviceTypeTree ~ this.deviceTypeTree:', this.deviceTypeTree)
|
||||
})
|
||||
},
|
||||
getParentsById(list, id) {
|
||||
|
|
@ -934,12 +951,12 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
// this.deviceType.forEach((e, index) => {
|
||||
// if (e[3] === row.typeId) {
|
||||
// this.deviceType.splice(index, 1)
|
||||
// this.propsKey++
|
||||
// }
|
||||
// })
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -959,99 +976,79 @@ export default {
|
|||
},
|
||||
/////// 设备类型树 切换
|
||||
deviceTypeChange(val) {
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
this.queryParams.typeId = ''
|
||||
this.typeListDev = []
|
||||
// console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
this.$nextTick(() => {
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
|
||||
this.selectParams = {
|
||||
createBy: this.user.name,
|
||||
companyId: deviceTypeList[0].data.companyId,
|
||||
// num: deviceTypeList[0].data.num,
|
||||
typeCn: deviceTypeList[0].data.label
|
||||
}
|
||||
console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
|
||||
this.getMaTypeDataByIdFun(val[val.length - 1])
|
||||
})
|
||||
|
||||
// if (val.length > 0) {
|
||||
// for (let i in val) {
|
||||
// console.log(val[i], '----+++')
|
||||
// const items = val.map((e) => {
|
||||
// return e[3]
|
||||
// })
|
||||
// for (let i in items) {
|
||||
// for (let z in deviceTypeList) {
|
||||
// if (deviceTypeList[z].data.id === items[i]) {
|
||||
// let { num, companyId, id, unitName } = deviceTypeList[z].data
|
||||
|
||||
// const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id)
|
||||
// if (!isRepeat) {
|
||||
// this.leaseApplyDetails.push({
|
||||
// createBy: this.user.name,
|
||||
// typeId: id,
|
||||
// num,
|
||||
// companyId,
|
||||
// unitCn: unitName,
|
||||
// typeCn: deviceTypeList[z].pathLabels[2],
|
||||
// guigeCn: deviceTypeList[z].pathLabels[3],
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// console.log('🚀 ~ deviceTypeChange ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
||||
// } else {
|
||||
// this.leaseApplyDetails = []
|
||||
// }
|
||||
let tempList = []
|
||||
|
||||
// const isRepeat = this.tempList.some((e) => e.typeId == val[val.length - 1])
|
||||
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
for (let i in items) {
|
||||
for (let z in deviceTypeList) {
|
||||
if (deviceTypeList[z].data.id === items[i]) {
|
||||
let { num, companyId, id, unitName } = deviceTypeList[z].data
|
||||
|
||||
const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id)
|
||||
if (!isRepeat) {
|
||||
this.leaseApplyDetails.push({
|
||||
createBy: this.user.name,
|
||||
typeId: id,
|
||||
num,
|
||||
companyId,
|
||||
unitCn: unitName,
|
||||
typeCn: deviceTypeList[z].pathLabels[2],
|
||||
guigeCn: deviceTypeList[z].pathLabels[3],
|
||||
})
|
||||
|
||||
// break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// const newDataList = [...this.leaseApplyDetails, ...tempList]
|
||||
// const map = new Map()
|
||||
// for (let item of newDataList) {
|
||||
// if (!map.has(item.typeId)) {
|
||||
// map.set(item.typeId, item)
|
||||
// }
|
||||
// }
|
||||
// const newArray = [...map.values()]
|
||||
|
||||
// let newArray_array = []
|
||||
// items.forEach((e) => {
|
||||
// newArray.forEach((j) => {
|
||||
// if (e == j.typeId) {
|
||||
// newArray_array.push(j)
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// this.leaseApplyDetails = newArray_array
|
||||
} else {
|
||||
this.leaseApplyDetails = []
|
||||
},
|
||||
// 获取规格型号
|
||||
async getMaTypeDataByIdFun(val) {
|
||||
const res = await getMaTypeDataById({ id: val })
|
||||
this.typeListDev = res.data
|
||||
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
||||
},
|
||||
// 选择规格型号
|
||||
changeType(e) {
|
||||
// console.log('🚀 ~ changeType ~ e:', e)
|
||||
if (!e) return
|
||||
// 获取选中的规格型号
|
||||
const selectType = this.typeListDev.find((item) => item.id == e)
|
||||
console.log('🚀 ~ changeType ~ selectType:', selectType)
|
||||
this.selectParams.typeId = selectType.id
|
||||
this.selectParams.guigeCn = selectType.name
|
||||
this.selectParams.unitCn = selectType.unit
|
||||
this.selectParams.num = selectType.num
|
||||
console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams)
|
||||
// 判断是否重复
|
||||
const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id)
|
||||
// console.log('🚀 ~ changeType ~ isRepeat:', isRepeat)
|
||||
if (isRepeat) {
|
||||
this.$message.error('当前设备已添加,不可重复添加!')
|
||||
return
|
||||
}
|
||||
|
||||
// const templateList = deviceTypeList.map((e) => {
|
||||
// let { num, companyId, id, unitName } = e.data
|
||||
// return {
|
||||
// createBy: this.user.name,
|
||||
// num,
|
||||
// companyId,
|
||||
// typeId: id,
|
||||
// unitCn: unitName,
|
||||
// typeCn: e.pathLabels[2],
|
||||
// guigeCn: e.pathLabels[3],
|
||||
// }
|
||||
// })
|
||||
// this.leaseApplyDetails = [...new Set(templateList)]
|
||||
// console.log(templateList, '----')
|
||||
|
||||
// let nodes = null
|
||||
// nodes =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
// ? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// if (nodes[0].level != 4) {
|
||||
// return
|
||||
// }
|
||||
// // console.log(this.leaseApplyDetails)
|
||||
// // console.log(nodes[0].data.id)
|
||||
// for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
// if (this.leaseApplyDetails[i].typeId == nodes[0].data.id) {
|
||||
// this.leaseApplyDetails.splice(i, 1)
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.deviceType = {}
|
||||
this.leaseApplyDetails.push({...this.selectParams})
|
||||
console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
||||
},
|
||||
//// 将数据处理成 表格中需要的数据
|
||||
handelTableItemData(node) {
|
||||
|
|
|
|||
|
|
@ -38,12 +38,7 @@
|
|||
placeholder="请选择"
|
||||
:disabled="isEdit"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in unitList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="领料工程" prop="proId">
|
||||
|
|
@ -56,39 +51,24 @@
|
|||
placeholder="请选择"
|
||||
:disabled="isEdit"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in proList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-option v-for="item in proList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议号" prop="agreementCode">
|
||||
<el-input
|
||||
maxlength="50"
|
||||
v-model="queryParams.agreementCode"
|
||||
disabled
|
||||
style="width: 240px"
|
||||
></el-input>
|
||||
<el-input maxlength="50" v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="抱杆设备" prop="agreementCode">
|
||||
<!-- <el-form-item label="成套设备" prop="agreementCode">
|
||||
<el-select
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="请选择抱杆设备"
|
||||
placeholder="请选择成套设备"
|
||||
@change="onChangeWholeTypeName"
|
||||
v-model="queryParams.wholeTypeName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in holdingPoleSelList"
|
||||
:key="item.id"
|
||||
:label="item.wholeTypeName"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-for="item in holdingPoleSelList" :key="item.id" :label="item.wholeTypeName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="status">
|
||||
</el-form-item> -->
|
||||
<el-form-item label="类型名称" prop="status">
|
||||
<el-cascader
|
||||
filterable
|
||||
collapse-tags
|
||||
|
|
@ -102,11 +82,21 @@
|
|||
placeholder="请输入规格型号"
|
||||
popper-class="popper-select"
|
||||
:props="deviceTypeTreeProps"
|
||||
:disabled="
|
||||
(isEdit && !isView) || isCost || wholeTypeNameList.length > 0
|
||||
"
|
||||
:disabled="(isEdit && !isView) || isCost || wholeTypeNameList.length > 0"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="typeId">
|
||||
<el-select
|
||||
v-model="queryParams.typeId"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="请选择规格型号"
|
||||
@change="changeType"
|
||||
>
|
||||
<el-option v-for="item in typeListDev" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.estimateLeaseTime"
|
||||
|
|
@ -148,12 +138,7 @@
|
|||
placeholder="请选择费用承担方"
|
||||
:disabled="isEdit"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in costBearingList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-option v-for="item in costBearingList" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="roleName">
|
||||
|
|
@ -171,14 +156,7 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
v-if="isView"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<el-button plain size="mini" v-if="isView" type="primary" icon="el-icon-plus" @click="handleAdd">
|
||||
保存
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
|
@ -200,26 +178,14 @@
|
|||
<template slot-scope="props">
|
||||
<el-table :data="props.row.childrenList">
|
||||
<el-table-column align="center" prop="typeName" label="设备名称" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="规格型号"
|
||||
prop="deviceType"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="设备所属"
|
||||
prop="deviceAscription"
|
||||
/>
|
||||
<el-table-column align="center" label="规格型号" prop="deviceType" />
|
||||
<el-table-column align="center" label="设备所属" prop="deviceAscription" />
|
||||
<el-table-column label="预领数量" prop="deviceNum" align="center" />
|
||||
<el-table-column align="center" label="库存数量" prop="num" />
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="wholeTypeName"
|
||||
align="center"
|
||||
label="抱杆设备名称"
|
||||
/>
|
||||
<el-table-column prop="wholeTypeName" align="center" label="抱杆设备名称" />
|
||||
<el-table-column align="center" label="抱杆设备数量" width="260">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
|
|
@ -232,12 +198,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="onHandelDelete(scope.$index)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button size="mini" type="danger" @click="onHandelDelete(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -250,29 +211,17 @@
|
|||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="序号" type="index" width="80" />
|
||||
<el-table-column
|
||||
label="机具名称"
|
||||
prop="typeCn"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
prop="guigeCn"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="以大代小"
|
||||
prop="isReplace"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
<el-table-column label="机具名称" prop="typeCn" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="规格型号" prop="guigeCn" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="以大代小" prop="replaceTypeId" show-overflow-tooltip align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- v-if="scope.row.isReplace == 1" -->
|
||||
<el-select
|
||||
v-model="scope.row.isReplaceId"
|
||||
v-if="scope.row.isReplace == 1"
|
||||
v-model="scope.row.replaceTypeId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
@change="handleReplaceType($event, scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in scope.row.isReplaceOpt"
|
||||
|
|
@ -299,22 +248,10 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
maxlength="100"
|
||||
v-model="scope.row.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input maxlength="100" v-model="scope.row.remark" placeholder="请输入备注" clearable style="width: 100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
class-name="small-padding fixed-width"
|
||||
v-if="isView"
|
||||
>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" v-if="isView">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -454,6 +391,7 @@ export default {
|
|||
deptOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
typeId: null,
|
||||
types: 2,
|
||||
unitId: null,
|
||||
proId: null,
|
||||
|
|
@ -475,6 +413,8 @@ export default {
|
|||
leaseApplyDetails: [],
|
||||
wholeTypeName: '',
|
||||
},
|
||||
typeListDev: [], // 规格型号
|
||||
selectParams: {},
|
||||
typeList: [
|
||||
{ id: '0', name: '工程租赁' },
|
||||
{ id: '1', name: '长期领用' },
|
||||
|
|
@ -544,7 +484,7 @@ export default {
|
|||
|
||||
// 设备 树显示 配置
|
||||
deviceTypeTreeProps: {
|
||||
multiple: true,
|
||||
// multiple: true,
|
||||
value: 'id',
|
||||
},
|
||||
// 选中的设备类型
|
||||
|
|
@ -646,7 +586,7 @@ export default {
|
|||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTree() {
|
||||
const params = {
|
||||
level: 4,
|
||||
level: 3,
|
||||
}
|
||||
getDeviceTypeTree(params).then((res) => {
|
||||
this.deviceTypeTree = res.data
|
||||
|
|
@ -716,8 +656,7 @@ export default {
|
|||
this.queryParams.costBearingParty = data.costBearingParty
|
||||
this.queryParams.proId = data.proId
|
||||
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone
|
||||
this.queryParams.leaseApplyInfo.leasePerson =
|
||||
data.leaseApplyInfoList[0].leasePerson
|
||||
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson
|
||||
this.queryParams.agreementCode = data.agreementCode
|
||||
this.queryParams.agreementId = data.agreementId
|
||||
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
||||
|
|
@ -733,11 +672,14 @@ export default {
|
|||
this.leaseApplyDetails.forEach((item) => {
|
||||
try {
|
||||
selectList.push(this.getParentsById(this.deviceTypeTree, item.typeId))
|
||||
console.log('🚀 ~ 以大代小 ~ item:')
|
||||
// 是否以大代小
|
||||
// if (item.isReplace == 1) {
|
||||
const res = getMaTypeDataById({ id: item.maTypeId })
|
||||
this.$set(item, 'isReplaceOpt', res.data)
|
||||
// }
|
||||
if (item.isReplace == 1) {
|
||||
getMaTypeDataById({ id: item.maTypeId }).then((res) => {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ res:', res)
|
||||
this.$set(item, 'isReplaceOpt', res.data)
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
}
|
||||
|
|
@ -767,8 +709,7 @@ export default {
|
|||
this.queryParams.proId = data.proId
|
||||
this.queryParams.costBearingParty = data.costBearingParty
|
||||
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone
|
||||
this.queryParams.leaseApplyInfo.leasePerson =
|
||||
data.leaseApplyInfoList[0].leasePerson
|
||||
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson
|
||||
this.queryParams.agreementCode = data.agreementCode
|
||||
this.queryParams.agreementId = data.agreementId
|
||||
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
||||
|
|
@ -789,12 +730,18 @@ export default {
|
|||
template.unitCn = item.unitName
|
||||
template.typeCn = item.typeName
|
||||
template.guigeCn = item.typeModelName
|
||||
template.typeName = item.typeName
|
||||
template.typeModelName = item.typeModelName
|
||||
template.remark = item.remark
|
||||
template.preNum = item.preNum
|
||||
template.deviceNum = item.deviceNum
|
||||
template.status = item.status
|
||||
template.parenntId = item.parenntId
|
||||
template.num = item.num
|
||||
template.isReplace = item.isReplace
|
||||
template.maTypeId = item.maTypeId
|
||||
template.replaceTypeId = item.replaceTypeId
|
||||
template.maModel = item.maModel
|
||||
return template
|
||||
},
|
||||
|
||||
|
|
@ -856,10 +803,7 @@ export default {
|
|||
if (!valid) {
|
||||
return false
|
||||
} else {
|
||||
if (
|
||||
this.leaseApplyDetails.length === 0 &&
|
||||
this.wholeTypeNameList.length === 0
|
||||
) {
|
||||
if (this.leaseApplyDetails.length === 0 && this.wholeTypeNameList.length === 0) {
|
||||
this.$message.error('请添加机具类型或成套设备')
|
||||
return
|
||||
}
|
||||
|
|
@ -916,11 +860,7 @@ export default {
|
|||
if (this.taskId) {
|
||||
this.leaseApplyInfoList.forEach((v) => {
|
||||
v = Object.assign(v, this.queryParams.leaseApplyInfo)
|
||||
this.$set(
|
||||
v,
|
||||
'leaseApplyDetails',
|
||||
this.queryParams.leaseApplyDetails,
|
||||
)
|
||||
this.$set(v, 'leaseApplyDetails', this.queryParams.leaseApplyDetails)
|
||||
})
|
||||
if (this.$route.query.isBack) {
|
||||
this.queryParams.souceByRefuse = 1
|
||||
|
|
@ -960,12 +900,12 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
// this.deviceType.forEach((e, index) => {
|
||||
// if (e[3] === row.typeId) {
|
||||
// this.deviceType.splice(index, 1)
|
||||
// this.propsKey++
|
||||
// }
|
||||
// })
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -985,134 +925,161 @@ export default {
|
|||
},
|
||||
/////// 设备类型树 切换
|
||||
deviceTypeChange(val) {
|
||||
// console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList)
|
||||
|
||||
// if (val.length > 0) {
|
||||
// for (let i in val) {
|
||||
// console.log(val[i], '----+++')
|
||||
// }
|
||||
// }
|
||||
let tempList = []
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
|
||||
const itemsMap = new Map(items.map((item) => [item, true]))
|
||||
|
||||
deviceTypeList.forEach((device) => {
|
||||
console.log('🚀 ~ deviceTypeList.forEach ~ device:', device)
|
||||
if (itemsMap.has(device.data.id)) {
|
||||
const { num, companyId, id, unitName } = device.data
|
||||
tempList.push({
|
||||
createBy: this.user.name,
|
||||
typeId: id,
|
||||
num,
|
||||
companyId,
|
||||
unitCn: unitName,
|
||||
typeCn: device.pathLabels[2],
|
||||
guigeCn: device.pathLabels[3],
|
||||
// 第三级id
|
||||
maTypeId: device.path[2],
|
||||
// 是否以大代小
|
||||
isReplaceId: device.data.isReplaceId,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const newDataList = [...this.leaseApplyDetails, ...tempList]
|
||||
const map = new Map()
|
||||
for (let item of newDataList) {
|
||||
if (!map.has(item.typeId)) {
|
||||
map.set(item.typeId, item)
|
||||
}
|
||||
this.queryParams.typeId = ''
|
||||
this.typeListDev = []
|
||||
this.$nextTick(() => {
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
this.selectParams = {
|
||||
createBy: this.user.name,
|
||||
companyId: deviceTypeList[0].data.companyId,
|
||||
// num: deviceTypeList[0].data.num,
|
||||
typeCn: deviceTypeList[0].data.label,
|
||||
typeModelName: deviceTypeList[0].data.label,
|
||||
maTypeId: deviceTypeList[0].data.id,
|
||||
}
|
||||
const newArray = [...map.values()]
|
||||
|
||||
this.getMaTypeDataByIdFun(val[val.length - 1])
|
||||
})
|
||||
|
||||
let newArray_array = []
|
||||
items.forEach((e) => {
|
||||
newArray.forEach((j) => {
|
||||
if (e == j.typeId) {
|
||||
newArray_array.push(j)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.leaseApplyDetails = newArray_array
|
||||
// this.leaseApplyDetails.forEach(async (item) => {
|
||||
// console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
||||
// try {
|
||||
// if (item.isReplaceOpt) {
|
||||
// return
|
||||
// }
|
||||
// const res = await getMaTypeDataById({ id: item.maTypeId })
|
||||
// this.$set(item, 'isReplaceOpt', res.data)
|
||||
// console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
|
||||
// } catch (error) {
|
||||
// console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
// }
|
||||
// })
|
||||
// let tempList = []
|
||||
// if (val.length > 0) {
|
||||
// const items = val.map((e) => {
|
||||
// return e[3]
|
||||
// })
|
||||
|
||||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
||||
// const itemsMap = new Map(items.map((item) => [item, true]))
|
||||
|
||||
const promises = this.leaseApplyDetails.map(async (item, index) => {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
||||
if (item.isReplaceOpt) {
|
||||
return item
|
||||
}
|
||||
try {
|
||||
await delay(index * 100) // 每次请求之间延迟100毫秒
|
||||
const res = await getMaTypeDataById({ id: item.maTypeId })
|
||||
this.$set(item, 'isReplaceOpt', res.data)
|
||||
console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
Promise.all(promises).then((results) => {
|
||||
this.leaseApplyDetails = results
|
||||
console.log('All requests completed')
|
||||
})
|
||||
} else {
|
||||
this.leaseApplyDetails = []
|
||||
}
|
||||
|
||||
// const templateList = deviceTypeList.map((e) => {
|
||||
// let { num, companyId, id, unitName } = e.data
|
||||
// return {
|
||||
// deviceTypeList.forEach((device) => {
|
||||
// console.log('🚀 ~ deviceTypeList.forEach ~ device:', device)
|
||||
// if (itemsMap.has(device.data.id)) {
|
||||
// const { num, companyId, id, unitName } = device.data
|
||||
// tempList.push({
|
||||
// createBy: this.user.name,
|
||||
// typeId: id,
|
||||
// num,
|
||||
// companyId,
|
||||
// typeId: id,
|
||||
// unitCn: unitName,
|
||||
// typeCn: e.pathLabels[2],
|
||||
// guigeCn: e.pathLabels[3],
|
||||
// typeCn: device.pathLabels[2],
|
||||
// guigeCn: device.pathLabels[3],
|
||||
// // 第三级id
|
||||
// maTypeId: device.path[2],
|
||||
// // 是否以大代小
|
||||
// isReplaceId: device.data.isReplaceId,
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// this.leaseApplyDetails = [...new Set(templateList)]
|
||||
// console.log(templateList, '----')
|
||||
// })
|
||||
|
||||
// let nodes = null
|
||||
// nodes =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
// ? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// if (nodes[0].level != 4) {
|
||||
// return
|
||||
// }
|
||||
// // console.log(this.leaseApplyDetails)
|
||||
// // console.log(nodes[0].data.id)
|
||||
// for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
// if (this.leaseApplyDetails[i].typeId == nodes[0].data.id) {
|
||||
// this.leaseApplyDetails.splice(i, 1)
|
||||
// break
|
||||
// const newDataList = [...this.leaseApplyDetails, ...tempList]
|
||||
// const map = new Map()
|
||||
// for (let item of newDataList) {
|
||||
// if (!map.has(item.typeId)) {
|
||||
// map.set(item.typeId, item)
|
||||
// }
|
||||
// }
|
||||
// const newArray = [...map.values()]
|
||||
|
||||
// let newArray_array = []
|
||||
// items.forEach((e) => {
|
||||
// newArray.forEach((j) => {
|
||||
// if (e == j.typeId) {
|
||||
// newArray_array.push(j)
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// this.leaseApplyDetails = newArray_array
|
||||
// // this.leaseApplyDetails.forEach(async (item) => {
|
||||
// // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
||||
// // try {
|
||||
// // if (item.isReplaceOpt) {
|
||||
// // return
|
||||
// // }
|
||||
// // const res = await getMaTypeDataById({ id: item.maTypeId })
|
||||
// // this.$set(item, 'isReplaceOpt', res.data)
|
||||
// // console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
|
||||
// // } catch (error) {
|
||||
// // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
// // }
|
||||
// // })
|
||||
|
||||
// const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
||||
|
||||
// const promises = this.leaseApplyDetails.map(async (item, index) => {
|
||||
// console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
||||
// if (item.isReplaceOpt) {
|
||||
// return item
|
||||
// }
|
||||
// try {
|
||||
// await delay(index * 100) // 每次请求之间延迟100毫秒
|
||||
// const res = await getMaTypeDataById({ id: item.maTypeId })
|
||||
// this.$set(item, 'isReplaceOpt', res.data)
|
||||
// console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
|
||||
// } catch (error) {
|
||||
// console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
// }
|
||||
// return item
|
||||
// })
|
||||
|
||||
// Promise.all(promises).then((results) => {
|
||||
// this.leaseApplyDetails = results
|
||||
// console.log('All requests completed')
|
||||
// })
|
||||
// } else {
|
||||
// this.leaseApplyDetails = []
|
||||
// }
|
||||
// this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.deviceType = {}
|
||||
},
|
||||
// 获取规格型号
|
||||
async getMaTypeDataByIdFun(val) {
|
||||
const res = await getMaTypeDataById({ id: val })
|
||||
this.typeListDev = res.data
|
||||
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
||||
},
|
||||
// 选择规格型号
|
||||
changeType(e) {
|
||||
// console.log('🚀 ~ changeType ~ e:', e)
|
||||
if (!e) return
|
||||
// 获取选中的规格型号
|
||||
const selectType = this.typeListDev.find((item) => item.id == e)
|
||||
console.log('🚀 ~ changeType ~ selectType:', selectType)
|
||||
this.selectParams.typeId = selectType.id
|
||||
this.selectParams.guigeCn = selectType.name
|
||||
this.selectParams.typeName = selectType.name
|
||||
this.selectParams.unitCn = selectType.unit
|
||||
this.selectParams.isReplace = selectType.isReplace
|
||||
this.selectParams.num = selectType.num
|
||||
// this.selectParams.leasePrice = selectType.leasePrice
|
||||
this.selectParams.preNum = 1
|
||||
console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams)
|
||||
// 判断是否重复
|
||||
const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id)
|
||||
// console.log('🚀 ~ changeType ~ isRepeat:', isRepeat)
|
||||
if (isRepeat) {
|
||||
this.$message.error('当前设备已添加,不可重复添加!')
|
||||
return
|
||||
}
|
||||
this.leaseApplyDetails.push({ ...this.selectParams })
|
||||
|
||||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
||||
const promises = this.leaseApplyDetails.map(async (item, index) => {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
||||
if (item.isReplaceOpt) {
|
||||
return item
|
||||
}
|
||||
try {
|
||||
await delay(index * 100) // 每次请求之间延迟100毫秒
|
||||
const res = await getMaTypeDataById({ id: this.selectParams.maTypeId })
|
||||
this.$set(item, 'isReplaceOpt', res.data)
|
||||
console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
Promise.all(promises).then((results) => {
|
||||
this.leaseApplyDetails = results
|
||||
console.log('All requests completed')
|
||||
})
|
||||
console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
||||
},
|
||||
//// 将数据处理成 表格中需要的数据
|
||||
handelTableItemData(node) {
|
||||
|
|
@ -1127,9 +1094,7 @@ export default {
|
|||
template.guigeCn = node.pathLabels[3]
|
||||
|
||||
if (this.taskId) {
|
||||
const index = this.leaseApplyInfoList.find(
|
||||
(key) => key.companyId == node.data.companyId,
|
||||
)
|
||||
const index = this.leaseApplyInfoList.find((key) => key.companyId == node.data.companyId)
|
||||
template.parenntId = index ? index.id : ''
|
||||
}
|
||||
|
||||
|
|
@ -1198,10 +1163,17 @@ export default {
|
|||
|
||||
/* 更改数量 */
|
||||
onChangeInput(val, v) {
|
||||
this.wholeTypeNameList[v].childrenList.forEach(
|
||||
(e) => (e.deviceNum = e.initNum * val),
|
||||
)
|
||||
this.wholeTypeNameList[v].childrenList.forEach((e) => (e.deviceNum = e.initNum * val))
|
||||
},
|
||||
// 以大代小
|
||||
handleReplaceType(e, row) {
|
||||
console.log('🚀 ~ handleReplaceType ~ e:', e)
|
||||
console.log('🚀 ~ handleReplaceType ~ row:', row)
|
||||
const obj = row.isReplaceOpt.find((item) => item.id == e)
|
||||
console.log('🚀 ~ handleReplaceType ~ obj:', obj)
|
||||
row.leasePrice = obj.leasePrice
|
||||
row.maModel = obj.name
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -675,6 +675,8 @@ export default {
|
|||
this.$set(obj, 'outNum', row.outNum) //待出库数量
|
||||
this.$set(obj, 'inputNum', 1) //出库数量
|
||||
this.$set(obj, 'num', row.num) //库存
|
||||
this.$set(obj, 'maModel', row.maModel) // 以大代小 规格
|
||||
this.$set(obj, 'maName', row.maName) // 以大代小 类型
|
||||
this.outNumList = [obj]
|
||||
},
|
||||
handleOutQuery() {
|
||||
|
|
@ -720,12 +722,14 @@ export default {
|
|||
outNum: 1,
|
||||
taskId: this.outObj.taskId,
|
||||
leaseType: this.leaseType,
|
||||
maModel: this.outObj.maModel,
|
||||
maName: this.outObj.maName,
|
||||
// remark: this.outCodeList.find((v) => v.maId == item).remark,
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
// console.log(params, '编码出库时参数')
|
||||
console.log(params, '编码出库时参数')
|
||||
// console.log(params)
|
||||
submitOut(params).then((response) => {
|
||||
this.$modal.msgSuccess('出库成功')
|
||||
|
|
|
|||
|
|
@ -883,14 +883,14 @@ export default {
|
|||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] == row.typeId) {
|
||||
this.$nextTick(() => {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
})
|
||||
}
|
||||
})
|
||||
// this.deviceType.forEach((e, index) => {
|
||||
// if (e[3] == row.typeId) {
|
||||
// this.$nextTick(() => {
|
||||
// this.deviceType.splice(index, 1)
|
||||
// this.propsKey++
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
style="width: 240px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="status">
|
||||
<el-form-item label="类型名称" prop="status">
|
||||
<el-cascader
|
||||
:key="propsKey"
|
||||
v-model="deviceType"
|
||||
|
|
@ -65,12 +65,24 @@
|
|||
filterable
|
||||
collapse-tags
|
||||
style="width: 240px"
|
||||
placeholder="规格型号"
|
||||
placeholder="类型名称"
|
||||
ref="deviceTypeCascader"
|
||||
popper-class="popper-select"
|
||||
@change="deviceTypeChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="typeId">
|
||||
<el-select
|
||||
v-model="queryParams.typeId"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="请选择规格型号"
|
||||
@change="changeType"
|
||||
>
|
||||
<el-option v-for="item in typeListDev" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退料人" prop="backPerson">
|
||||
<el-input
|
||||
v-model="queryParams.backPerson"
|
||||
|
|
@ -282,6 +294,8 @@ import {
|
|||
getUseNumByTypeId,
|
||||
getTaskDetail,
|
||||
submitUpdateBackApply,
|
||||
getMaTypeDataById,
|
||||
getPreAuditNum,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { submitBackApplyApi } from '@/api/claimAndRefund/return'
|
||||
import {
|
||||
|
|
@ -373,8 +387,8 @@ export default {
|
|||
deptOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
typeId: null,
|
||||
types: 2,
|
||||
|
||||
unitId: null,
|
||||
proId: null,
|
||||
agreementId: null, //协议id
|
||||
|
|
@ -395,6 +409,8 @@ export default {
|
|||
//退料详情集合
|
||||
leaseApplyDetails: [],
|
||||
},
|
||||
typeListDev: [], // 规格型号
|
||||
selectParams: {},
|
||||
leaseApplyDetails: [],
|
||||
//退料详情单条模板
|
||||
leaseApplyDetailsItem: {
|
||||
|
|
@ -467,7 +483,7 @@ export default {
|
|||
label: 'typeName',
|
||||
// multiple: false,
|
||||
value: 'typeId',
|
||||
multiple: true,
|
||||
// multiple: true,
|
||||
},
|
||||
// 选中的设备类型
|
||||
deviceType: [],
|
||||
|
|
@ -588,19 +604,34 @@ export default {
|
|||
|
||||
getUseTypeTreee(params).then((res) => {
|
||||
this.deviceTypeTree = res.data
|
||||
// console.log('🚀 ~ getUseTypeTreee ~ this.deviceTypeTree:', this.deviceTypeTree)
|
||||
|
||||
// 递归循环 只要前3级
|
||||
const recursion = (data, level = 1) => {
|
||||
if (data) {
|
||||
data.forEach((item) => {
|
||||
if (item.children) {
|
||||
recursion(item.children, level + 1)
|
||||
}
|
||||
if (level == 3) {
|
||||
delete item.children
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
recursion(this.deviceTypeTree)
|
||||
console.log('🚀 ~ 循环后 ~ this.deviceTypeTree:', this.deviceTypeTree)
|
||||
|
||||
// console.log(this.deviceTypeTree, this.leaseApplyDetails, '6666')
|
||||
|
||||
let selectList = []
|
||||
this.leaseApplyDetails.forEach((e) => {
|
||||
selectList.push(
|
||||
this.getParentsById(this.deviceTypeTree, e.typeId),
|
||||
)
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.deviceType = selectList
|
||||
this.propsKey++
|
||||
})
|
||||
// let selectList = []
|
||||
// this.leaseApplyDetails.forEach((e) => {
|
||||
// selectList.push(
|
||||
// this.getParentsById(this.deviceTypeTree, e.typeId),
|
||||
// )
|
||||
// })
|
||||
// this.$nextTick(() => {
|
||||
// this.deviceType = selectList
|
||||
// this.propsKey++
|
||||
// })
|
||||
})
|
||||
},
|
||||
getParentsById(list, id) {
|
||||
|
|
@ -941,14 +972,14 @@ export default {
|
|||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] == row.typeId) {
|
||||
this.$nextTick(() => {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
})
|
||||
}
|
||||
})
|
||||
// this.deviceType.forEach((e, index) => {
|
||||
// if (e[3] == row.typeId) {
|
||||
// this.$nextTick(() => {
|
||||
// this.deviceType.splice(index, 1)
|
||||
// this.propsKey++
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -974,98 +1005,113 @@ export default {
|
|||
|
||||
/////// 设备类型树 切换
|
||||
async deviceTypeChange(val) {
|
||||
console.log(val, '*******************')
|
||||
// let nodes = null
|
||||
// console.log(
|
||||
// 'vall1211221122',
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length,
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes(),
|
||||
// [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)],
|
||||
// )
|
||||
// nodes =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
// ? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// console.log('nodes', nodes)
|
||||
// // const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
|
||||
// nodes[0].data.useNum = nodes[0].data.num
|
||||
// if (nodes[0].level != 4) {
|
||||
// return
|
||||
// }
|
||||
// if (nodes[0].data.useNum < 1) {
|
||||
// this.$modal.msgError('所选机具类型当前无在用!')
|
||||
// return
|
||||
// }
|
||||
// for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
// if (this.leaseApplyDetails[i].typeId == nodes[0].data.typeId) {
|
||||
// this.leaseApplyDetails.splice(i, 1)
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.$refs.cascader.$refs.panel.clearCheckedNodes()
|
||||
// // 设置为空可以让节点不高亮显示
|
||||
// this.$refs.cascader.$refs.panel.activePath = []
|
||||
// this.deviceType = {}
|
||||
|
||||
const deviceTypeList =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
this.queryParams.typeId = ''
|
||||
this.typeListDev = []
|
||||
// console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
this.$nextTick(() => {
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
|
||||
this.selectParams = {
|
||||
createBy: this.createBy,
|
||||
companyId: deviceTypeList[0].data.companyId,
|
||||
// preNum: 1,
|
||||
// num: deviceTypeList[0].data.num,
|
||||
// useNum: deviceTypeList[0].data.num,
|
||||
typeName: deviceTypeList[0].data.typeName,
|
||||
}
|
||||
// console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
|
||||
this.getMaTypeDataByIdFun(val[val.length - 1])
|
||||
})
|
||||
// console.log(val, '*******************')
|
||||
|
||||
// const deviceTypeList =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// let tempList = []
|
||||
|
||||
// if (val.length > 0) {
|
||||
// for (let i in val) {
|
||||
// console.log(val[i], '----+++')
|
||||
// const items = val.map((e) => {
|
||||
// return e[3]
|
||||
// })
|
||||
// for (let i in items) {
|
||||
// for (let z in deviceTypeList) {
|
||||
// if (deviceTypeList[z].data.typeId == items[i]) {
|
||||
// let { num, companyId, typeId, unitNames } =
|
||||
// deviceTypeList[z].data
|
||||
// tempList.push({
|
||||
// createBy: this.createBy,
|
||||
// typeId,
|
||||
// preNum: num,
|
||||
// num,
|
||||
// companyId,
|
||||
// unitNames,
|
||||
// useNum: num,
|
||||
// typeName: deviceTypeList[z].pathLabels[2],
|
||||
// typeCode: deviceTypeList[z].pathLabels[3],
|
||||
// })
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// const newDataList = [...this.leaseApplyDetails, ...tempList]
|
||||
// const map = new Map()
|
||||
// for (let item of newDataList) {
|
||||
// if (!map.has(item.typeId * 1)) {
|
||||
// map.set(item.typeId * 1, item)
|
||||
// }
|
||||
// }
|
||||
// const newArray = [...map.values()]
|
||||
|
||||
// console.log(newArray, 'newArray', items, 'items')
|
||||
|
||||
// let newArray_array = []
|
||||
// items.forEach((e) => {
|
||||
// newArray.forEach((j) => {
|
||||
// if (e == j.typeId) {
|
||||
// newArray_array.push(j)
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// this.leaseApplyDetails = newArray_array
|
||||
// } else {
|
||||
// this.leaseApplyDetails = []
|
||||
// }
|
||||
let tempList = []
|
||||
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
for (let i in items) {
|
||||
for (let z in deviceTypeList) {
|
||||
if (deviceTypeList[z].data.typeId == items[i]) {
|
||||
let { num, companyId, typeId, unitNames } =
|
||||
deviceTypeList[z].data
|
||||
tempList.push({
|
||||
createBy: this.createBy,
|
||||
typeId,
|
||||
preNum: num,
|
||||
num,
|
||||
companyId,
|
||||
unitNames,
|
||||
useNum: num,
|
||||
typeName: deviceTypeList[z].pathLabels[2],
|
||||
typeCode: deviceTypeList[z].pathLabels[3],
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const newDataList = [...this.leaseApplyDetails, ...tempList]
|
||||
const map = new Map()
|
||||
for (let item of newDataList) {
|
||||
if (!map.has(item.typeId * 1)) {
|
||||
map.set(item.typeId * 1, item)
|
||||
}
|
||||
}
|
||||
const newArray = [...map.values()]
|
||||
|
||||
console.log(newArray, 'newArray', items, 'items')
|
||||
|
||||
let newArray_array = []
|
||||
items.forEach((e) => {
|
||||
newArray.forEach((j) => {
|
||||
if (e == j.typeId) {
|
||||
newArray_array.push(j)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.leaseApplyDetails = newArray_array
|
||||
} else {
|
||||
this.leaseApplyDetails = []
|
||||
},
|
||||
// 获取规格型号
|
||||
async getMaTypeDataByIdFun(val) {
|
||||
const res = await getMaTypeDataById({ id: val })
|
||||
this.typeListDev = res.data
|
||||
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
||||
},
|
||||
// 选择规格型号
|
||||
async changeType(e) {
|
||||
// console.log('🚀 ~ changeType ~ e:', e)
|
||||
if (!e) return
|
||||
// 获取选中的规格型号
|
||||
const selectType = this.typeListDev.find((item) => item.id == e)
|
||||
console.log('🚀 ~ changeType ~ selectType:', selectType)
|
||||
this.selectParams.typeId = selectType.id
|
||||
this.selectParams.typeCode = selectType.name
|
||||
this.selectParams.unitNames = selectType.unit
|
||||
this.selectParams.num = selectType.num
|
||||
this.selectParams.preNum = selectType.num
|
||||
this.selectParams.useNum = selectType.num
|
||||
console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams)
|
||||
// 判断是否重复
|
||||
const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id)
|
||||
// console.log('🚀 ~ changeType ~ isRepeat:', isRepeat)
|
||||
if (isRepeat) {
|
||||
this.$message.error('当前设备已添加,不可重复添加!')
|
||||
return
|
||||
}
|
||||
const { data: outNum } = await getPreAuditNum({
|
||||
typeId: selectType.id,
|
||||
agreementId: this.queryParams.agreementId,
|
||||
})
|
||||
console.log('🚀 ~ deviceTypeChange ~ outNum:', outNum)
|
||||
this.selectParams.outNum = outNum
|
||||
this.leaseApplyDetails.push({...this.selectParams})
|
||||
console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
||||
},
|
||||
//// 将数据处理成 表格中需要的数据
|
||||
handelTableItemData(node) {
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<el-form-item :prop="'premiumList.' + index + '.technical'" label="技术鉴定:">
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.technical"
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
|
|
@ -84,6 +84,7 @@
|
|||
maxlength="10"
|
||||
style="width: 350px"
|
||||
:disabled="!isRequired"
|
||||
@blur="getPartCost(domain)"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
|
|
@ -102,6 +103,7 @@
|
|||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
disabled
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairContent'" label="维修内容:">
|
||||
|
|
@ -115,7 +117,7 @@
|
|||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.fileList'" label="维修内容:">
|
||||
<el-form-item :prop="'premiumList.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
|
|
@ -184,9 +186,9 @@
|
|||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.technical'" label="技术鉴定:">
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.technical"
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
|
|
@ -275,6 +277,7 @@
|
|||
maxlength="10"
|
||||
style="width: 350px"
|
||||
:disabled="!isRequired"
|
||||
@blur="getPartCost(domain)"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
|
|
@ -293,6 +296,7 @@
|
|||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
disabled
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairContent'" label="维修内容:">
|
||||
|
|
@ -306,7 +310,7 @@
|
|||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.fileList'" label="维修内容:">
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
|
|
@ -367,7 +371,13 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { submitRepairApplyApi, getUserSelectApi, getRepairMaTypeListApi, listPartType } from '@/api/repairTest/repair'
|
||||
import {
|
||||
submitRepairApplyApi,
|
||||
getUserSelectApi,
|
||||
getRepairMaTypeListApi,
|
||||
listPartType,
|
||||
getCostByPidAndNumApi,
|
||||
} from '@/api/repairTest/repair'
|
||||
// import { listPartType, } from "@/api/store/tools";
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
|
@ -436,8 +446,8 @@ export default {
|
|||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
isCharge: '',
|
||||
fileList: [], // 附件
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -455,6 +465,7 @@ export default {
|
|||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
fileList: [], // 附件
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -526,6 +537,7 @@ export default {
|
|||
})
|
||||
},
|
||||
init() {
|
||||
console.log('this.rowObj', this.rowObj)
|
||||
if (this.rowObj.code !== null && this.rowObj.code !== '') {
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
|
|
@ -535,6 +547,12 @@ export default {
|
|||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainTwo()
|
||||
}
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
getUserSelectApi({ roleIds: [133] }).then((response) => {
|
||||
this.userSelectList = response.data
|
||||
})
|
||||
|
|
@ -565,6 +583,8 @@ export default {
|
|||
repairContent: '',
|
||||
repairNum: 1,
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
delDomain(domain, type) {
|
||||
|
|
@ -589,6 +609,8 @@ export default {
|
|||
repairContent: '',
|
||||
repairNum: '',
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
|
|
@ -730,6 +752,21 @@ export default {
|
|||
fileUrl: file.response.data.fileUrl,
|
||||
})
|
||||
},
|
||||
// 获取配件总费用
|
||||
async getPartCost(domain) {
|
||||
console.log('🚀 ~ getPartCost ~ domain:', domain)
|
||||
try {
|
||||
const params = {
|
||||
partId: domain.partId,
|
||||
partNum: domain.partNum,
|
||||
}
|
||||
const res = await getCostByPidAndNumApi(params)
|
||||
console.log('🚀 ~ getPartCost ~ res:', res)
|
||||
domain.partCost = res.data
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getPartCost ~ error:', error)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,14 @@
|
|||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<el-form-item prop="repairRemark" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="dynamicValidateForm.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报废原因:" prop="scrapReason" :rules="{ required: true, message: '请输入报废原因', trigger: 'blur'}">
|
||||
<el-input
|
||||
v-model="dynamicValidateForm.scrapReason"
|
||||
|
|
@ -73,6 +81,14 @@
|
|||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<el-form-item prop="repairRemark" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="dynamicValidateFormTwo.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="报废数量:"
|
||||
prop="scrapNum"
|
||||
|
|
@ -123,8 +139,6 @@
|
|||
:limit="3"
|
||||
:multiple="true"
|
||||
@remove="handleRemove"
|
||||
@preview="handlePreview"
|
||||
@before-remove="beforeRemove"
|
||||
@success="handleSuccess"
|
||||
>
|
||||
<template>
|
||||
|
|
@ -266,6 +280,18 @@ export default {
|
|||
submit() {
|
||||
this.$refs['dynamicValidateForm'].validate(valid => {
|
||||
if (valid) {
|
||||
let fileList = []
|
||||
if (this.fileList.length > 0) {
|
||||
this.fileList.forEach(item => {
|
||||
if (item.response && item.response.code == 200) {
|
||||
fileList.push({
|
||||
fileName: item.response.data.fileName,
|
||||
fileUrl: item.response.data.fileUrl,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('fileList', fileList)
|
||||
// 编码管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -278,6 +304,8 @@ export default {
|
|||
scrapType: this.dynamicValidateForm.scrapType,
|
||||
fileIds: this.fileIds.length > 0 ? this.fileIds : '',
|
||||
scrapNum: 1,
|
||||
repairRemark: this.dynamicValidateForm.repairRemark,
|
||||
fileList: fileList,
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
|
|
@ -303,6 +331,18 @@ export default {
|
|||
submitTwo() {
|
||||
this.$refs['dynamicValidateFormTwo'].validate(valid => {
|
||||
if (valid) {
|
||||
let fileList = []
|
||||
if (this.fileList.length > 0) {
|
||||
this.fileList.forEach(item => {
|
||||
if (item.response && item.response.code == 200) {
|
||||
fileList.push({
|
||||
fileName: item.response.data.fileName,
|
||||
fileUrl: item.response.data.fileUrl,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('fileList', fileList)
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -316,6 +356,8 @@ export default {
|
|||
scrapType: this.dynamicValidateFormTwo.scrapType,
|
||||
fileIds: this.fileIds.length > 0 ? this.fileIds : '',
|
||||
scrapNum: this.dynamicValidateFormTwo.scrapNum,
|
||||
repairRemark: this.dynamicValidateFormTwo.repairRemark,
|
||||
fileList: fileList,
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
|
|
@ -346,6 +388,7 @@ export default {
|
|||
})
|
||||
},
|
||||
init() {
|
||||
console.log('init', this.rowObj)
|
||||
// 清除验证
|
||||
if (this.$refs.dynamicValidateForm) this.$refs.dynamicValidateForm.clearValidate()
|
||||
if (this.$refs.dynamicValidateFormTwo) this.$refs.dynamicValidateFormTwo.clearValidate()
|
||||
|
|
@ -353,25 +396,31 @@ export default {
|
|||
this.dynamicValidateForm = {
|
||||
scrapReason: '',
|
||||
scrapType: 1,
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
}
|
||||
this.dynamicValidateFormTwo = {
|
||||
scrapNum: '',
|
||||
scrapReason: '',
|
||||
scrapType: 1,
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
}
|
||||
this.isShow = false
|
||||
} else {
|
||||
this.dynamicValidateForm = {
|
||||
scrapReason: '',
|
||||
scrapType: 1,
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
}
|
||||
this.dynamicValidateFormTwo = {
|
||||
scrapNum: '',
|
||||
scrapReason: '',
|
||||
scrapType: 1,
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
}
|
||||
this.isShow = true
|
||||
}
|
||||
// this.dynamicValidateForm.repairRemark = this.rowObj.repairRemark
|
||||
// this.dynamicValidateFormTwo.repairRemark = this.rowObj.repairRemark
|
||||
getInfo().then(res => {
|
||||
this.companyId = res.user.companyId
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,825 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
:before-close="cancel"
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogShowFlag"
|
||||
append-to-body
|
||||
width="600px"
|
||||
>
|
||||
<div class="form_box_one">
|
||||
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateForm.premiumList" :key="domain.key" class="bor_box">
|
||||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<!-- :rules="{
|
||||
required: true,
|
||||
message: '保费不能为空',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partName'" label="配件名称:">
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partType'"
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumList.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
:prop="'premiumList.' + index + '.partPrice'"
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: meneyIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partPrice'"
|
||||
label="费用(元):"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partNum'"
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
// validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairContent'" label="维修内容:">
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
list-type="picture-card"
|
||||
accept="image/*,application/pdf,application/msword"
|
||||
multiple
|
||||
:limit="5"
|
||||
:file-list="domain.fileList"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="(res, file, fileList) => handleSuccess(file, fileList, domain)"
|
||||
style="width: 350px"
|
||||
>
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{ file }">
|
||||
<img
|
||||
v-if="/\.(pdf|PDF)$/i.test(file.name)"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="pdfImg"
|
||||
alt=""
|
||||
/>
|
||||
<img
|
||||
v-else-if="/\.(doc|docx)$/i.test(file.name)"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="wordImg"
|
||||
alt=""
|
||||
/>
|
||||
<img v-else class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-preview" @click="handlePreview(file)">
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
<span class="el-upload-list__item-delete" @click="handleRemove(file, domain)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code !== null && rowObj.code !== ''">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_box_two">
|
||||
<el-form
|
||||
ref="dynamicValidateFormTwo"
|
||||
:model="dynamicValidateFormTwo"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div v-for="(domain, index) in dynamicValidateFormTwo.premiumListTwo" :key="domain.key" class="bor_box">
|
||||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
<!-- :rules="{
|
||||
required: true,
|
||||
message: '保费不能为空',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:prop="'premiumListTwo.' + index + '.repairNum'"
|
||||
label="维修数量:"
|
||||
:rules="{
|
||||
required: true,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.repairNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件名称:">
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumListTwo.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
:prop="'premiumListTwo.' + index + '.partPrice'"
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: meneyIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item v-if="domain.partType == 1" label="配件单价(元):">
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="维修内容:">
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
list-type="picture-card"
|
||||
accept="image/*,application/pdf,application/msword"
|
||||
multiple
|
||||
:limit="5"
|
||||
:file-list="domain.fileList"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="(res, file, fileList) => handleSuccess(file, fileList, domain)"
|
||||
style="width: 350px"
|
||||
>
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{ file }">
|
||||
<img
|
||||
v-if="/\.(pdf|PDF)$/i.test(file.name)"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="pdfImg"
|
||||
alt=""
|
||||
/>
|
||||
<img
|
||||
v-else-if="/\.(doc|docx)$/i.test(file.name)"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="wordImg"
|
||||
alt=""
|
||||
/>
|
||||
<img v-else class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-preview" @click="handlePreview(file)">
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
<span class="el-upload-list__item-delete" @click="handleRemove(file, domain)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- <el-button @click.prevent="removeDomain(domain, index)"-->
|
||||
<!-- >删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <div class="add_box">
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="addDomainTwo"
|
||||
>添加配件
|
||||
</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code == null || rowObj.code == ''">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitTwo">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
submitRepairApplyApi,
|
||||
getUserSelectApi,
|
||||
getRepairMaTypeListApi,
|
||||
listPartType,
|
||||
getSupplierSelectApi,
|
||||
} from '@/api/repairTest/repair'
|
||||
// import { listPartType, } from "@/api/store/tools";
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getInfo } from '@/api/login'
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
props: {
|
||||
// 弹窗是否显示
|
||||
isShowFlag: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 对应操作数据键值
|
||||
priKey: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
dialogTitle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
rowObj: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isShowFlag(val) {
|
||||
if (val) {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dialogShowFlag: {
|
||||
get() {
|
||||
return this.isShowFlag
|
||||
},
|
||||
set(v) {
|
||||
this.$emit('update:isShowFlag', v)
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload', // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + localStorage.getItem('token'),
|
||||
},
|
||||
pdfImg: require('@/assets/images/pdf.png'),
|
||||
wordImg: require('@/assets/images/word.png'),
|
||||
supplierSelectList: [],
|
||||
fullscreenLoading: false,
|
||||
dynamicValidateForm: {
|
||||
premiumList: [
|
||||
{
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
fileList: [],
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
dynamicValidateFormTwo: {
|
||||
premiumListTwo: [
|
||||
{
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
fileList: [],
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
userSelectList: [],
|
||||
companyId: '',
|
||||
taskId: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('taskId', (taskId) => {
|
||||
this.taskId = taskId
|
||||
})
|
||||
this.getTree()
|
||||
},
|
||||
methods: {
|
||||
//正则校验配件费用
|
||||
meneyIntegerValidator(rule, value, callback) {
|
||||
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
if (value === '' || reg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的数'))
|
||||
}
|
||||
},
|
||||
//正则校验配件数量--维修数量
|
||||
numberIntegerValidator(rule, value, callback) {
|
||||
const reg = /^\+?[1-9][0-9]*$/
|
||||
if (reg.test(value) && value <= this.rowObj.repairNum) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的并且小于维修总量的正整数'))
|
||||
}
|
||||
},
|
||||
getTree() {
|
||||
listPartType().then((response) => {
|
||||
this.deptList = this.handleTree(response.data, 'paId')
|
||||
})
|
||||
},
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.paId,
|
||||
label: node.paName,
|
||||
children: node.children,
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
let params = {
|
||||
taskId: this.taskId,
|
||||
}
|
||||
this.loading = true
|
||||
getRepairMaTypeListApi(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.repairList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
init() {
|
||||
if (this.rowObj.code !== null && this.rowObj.code !== '') {
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainOne()
|
||||
} else {
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainTwo()
|
||||
}
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
getSupplierSelectApi().then((res) => {
|
||||
this.supplierSelectList = res.data
|
||||
})
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.dialogShowFlag = false
|
||||
// this.$refs["form"].resetFields();
|
||||
// this.dynamicValidateForm.premiumList = [];
|
||||
},
|
||||
addDomainOne() {
|
||||
// 选择配件 partId
|
||||
// 是否收费 partType
|
||||
// 配件数量 partNum
|
||||
// 配件费用 partCost
|
||||
// 维修内容 repairContent
|
||||
// 维修数量 repairNum
|
||||
this.dynamicValidateForm.premiumList.push({
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: 0,
|
||||
partNum: '',
|
||||
partCost: '',
|
||||
repairContent: '',
|
||||
supplierId: '',
|
||||
partPrice: '',
|
||||
repairNum: 1,
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
addDomainTwo() {
|
||||
this.dynamicValidateFormTwo.premiumListTwo.push({
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: 0,
|
||||
partNum: '',
|
||||
partCost: '',
|
||||
repairContent: '',
|
||||
repairNum: '',
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs['dynamicValidateForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.partCost = item.partPrice
|
||||
})
|
||||
this.dynamicValidateForm.premiumList.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
// this.dynamicValidateForm.premiumList[0].partCost = this.dynamicValidateForm.premiumList[0].partPrice;
|
||||
// 编码管理传递参数
|
||||
console.log('this.dynamicValidateForm.premiumList1111)', this.dynamicValidateForm.premiumList)
|
||||
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
maId: this.rowObj.maId,
|
||||
typeId: this.rowObj.typeId,
|
||||
id: this.rowObj.id,
|
||||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateForm.premiumList),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
this.dialogShowFlag = false
|
||||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
submitTwo() {
|
||||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.dynamicValidateFormTwo.premiumListTwo[0].partCost = this.dynamicValidateFormTwo.premiumListTwo[0].partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((item) => {
|
||||
item.partCost = item.partPrice
|
||||
})
|
||||
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
|
||||
console.log(
|
||||
'this.dynamicValidateFormTwo.premiumListTwo2222',
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
)
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
maId: this.rowObj.maId,
|
||||
typeId: this.rowObj.typeId,
|
||||
id: this.rowObj.id,
|
||||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateFormTwo.premiumListTwo),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
this.dialogShowFlag = false
|
||||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleRemove(file, domain) {
|
||||
// console.log('🚀 ~ handleRemove ~ this.$refs.upload_attach:', this.$refs.upload_attach[0].uploadFiles)
|
||||
// console.log('🚀 ~ handleRemove ~ row:', domain.fileList)
|
||||
// console.log('🚀 ~ handleRemove ~ file:', file)
|
||||
let fileList = this.$refs.upload_attach[0].uploadFiles
|
||||
this.$refs.upload_attach[0].uploadFiles = fileList.filter((item) => item.name !== file.name)
|
||||
// console.log('🚀 ~ handleRemove ~ fileList:', fileList)
|
||||
domain.fileList = this.$refs.upload_attach[0].uploadFiles.map((item) => {
|
||||
return {
|
||||
fileName: item.name,
|
||||
fileUrl: item.url,
|
||||
}
|
||||
})
|
||||
console.log('🚀 ~ domain.fileList:', domain.fileList)
|
||||
},
|
||||
handlePreview(file) {
|
||||
if (file.response) {
|
||||
window.open(file.response.data.fileUrl)
|
||||
} else {
|
||||
window.open(file.fileUrl)
|
||||
}
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(
|
||||
`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
||||
files.length + fileList.length
|
||||
} 个文件`,
|
||||
)
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isLtMB = file.size / 1024 / 1024 < 20
|
||||
if (!isLtMB) {
|
||||
this.$message.error('上传文件大小不能超过 20MB!')
|
||||
}
|
||||
return isLtMB
|
||||
},
|
||||
beforeRemove(file) {
|
||||
return this.$confirm(`确定移除 ${file.name} ?`)
|
||||
},
|
||||
handleSuccess(file, fileList, row) {
|
||||
console.log('🚀 ~ handleSuccess ~ row:', row)
|
||||
console.log('🚀 ~ handleSuccess ~ file:', file)
|
||||
if (!row.fileList) {
|
||||
row.fileList = []
|
||||
}
|
||||
row.fileList.push({
|
||||
fileName: file.response.data.fileName,
|
||||
fileUrl: file.response.data.fileUrl,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.form_box_one {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.form_box_title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form_box_line {
|
||||
margin: 8px 0;
|
||||
width: 100%;
|
||||
border-bottom: 2px solid #1a1c22;
|
||||
}
|
||||
|
||||
.form_box_item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.add_box {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-right: 3%;
|
||||
}
|
||||
}
|
||||
|
||||
.form_box_two {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.form_box_title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form_box_line {
|
||||
margin: 8px 0;
|
||||
width: 100%;
|
||||
border-bottom: 2px solid #1a1c22;
|
||||
}
|
||||
|
||||
.form_box_item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.add_box {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-right: 3%;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-right: 3%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -9,17 +9,8 @@
|
|||
width="600px"
|
||||
>
|
||||
<div class="form_box_one">
|
||||
<el-form
|
||||
ref="dynamicValidateForm"
|
||||
:model="dynamicValidateForm"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(domain, index) in dynamicValidateForm.premiumList"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateForm.premiumList" :key="domain.key" class="bor_box">
|
||||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -29,10 +20,15 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partName'"
|
||||
label="配件名称:"
|
||||
>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partName'" label="配件名称:">
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
|
|
@ -51,10 +47,7 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
|
|
@ -97,7 +90,7 @@
|
|||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partPrice'"
|
||||
label="费用(元):"
|
||||
label="配件单价(元):"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
|
|
@ -124,10 +117,7 @@
|
|||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.repairContent'"
|
||||
label="维修内容:"
|
||||
>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairContent'" label="维修内容:">
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
|
|
@ -138,7 +128,7 @@
|
|||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.fileList'" label="维修内容:">
|
||||
<el-form-item :prop="'premiumList.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
|
|
@ -183,11 +173,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code !== null && rowObj.code !== ''"
|
||||
>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code !== null && rowObj.code !== ''">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
</div>
|
||||
|
|
@ -199,13 +185,7 @@
|
|||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
domain, index
|
||||
) in dynamicValidateFormTwo.premiumListTwo"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<div v-for="(domain, index) in dynamicValidateFormTwo.premiumListTwo" :key="domain.key" class="bor_box">
|
||||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -215,6 +195,14 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairRemark'" label="技术鉴定:">
|
||||
<el-input
|
||||
v-model="domain.repairRemark"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:prop="'premiumListTwo.' + index + '.repairNum'"
|
||||
label="维修数量:"
|
||||
|
|
@ -250,10 +238,7 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
|
|
@ -293,10 +278,7 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
label="配件单价(元):"
|
||||
>
|
||||
<el-form-item v-if="domain.partType == 1" label="配件单价(元):">
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
|
|
@ -333,7 +315,7 @@
|
|||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.fileList'" label="维修内容:">
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.fileList'" label="附件:">
|
||||
<el-upload
|
||||
ref="upload_attach"
|
||||
class="upload-demo"
|
||||
|
|
@ -391,11 +373,7 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</el-form>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code == null || rowObj.code == ''"
|
||||
>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code == null || rowObj.code == ''">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitTwo">保存</el-button>
|
||||
</div>
|
||||
|
|
@ -479,6 +457,7 @@ export default {
|
|||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
fileList: [],
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -496,6 +475,7 @@ export default {
|
|||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: '',
|
||||
fileList: [],
|
||||
repairRemark: '', // 技术鉴定
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -514,8 +494,7 @@ export default {
|
|||
methods: {
|
||||
//正则校验配件费用
|
||||
meneyIntegerValidator(rule, value, callback) {
|
||||
const reg =
|
||||
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
if (value === '' || reg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
|
|
@ -570,6 +549,12 @@ export default {
|
|||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainTwo()
|
||||
}
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((item) => {
|
||||
item.repairRemark = this.rowObj.repairRemark
|
||||
})
|
||||
getSupplierSelectApi().then((res) => {
|
||||
this.supplierSelectList = res.data
|
||||
})
|
||||
|
|
@ -600,6 +585,8 @@ export default {
|
|||
partPrice: '',
|
||||
repairNum: 1,
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
addDomainTwo() {
|
||||
|
|
@ -613,6 +600,8 @@ export default {
|
|||
repairContent: '',
|
||||
repairNum: '',
|
||||
key: Date.now(),
|
||||
repairRemark: this.rowObj.repairRemark || '',
|
||||
fileList: [],
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
|
|
@ -628,10 +617,7 @@ export default {
|
|||
})
|
||||
// this.dynamicValidateForm.premiumList[0].partCost = this.dynamicValidateForm.premiumList[0].partPrice;
|
||||
// 编码管理传递参数
|
||||
console.log(
|
||||
'this.dynamicValidateForm.premiumList1111)',
|
||||
this.dynamicValidateForm.premiumList,
|
||||
)
|
||||
console.log('this.dynamicValidateForm.premiumList1111)', this.dynamicValidateForm.premiumList)
|
||||
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -641,9 +627,7 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateForm.premiumList,
|
||||
),
|
||||
partStrList: JSON.stringify(this.dynamicValidateForm.premiumList),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
|
|
@ -668,11 +652,9 @@ export default {
|
|||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.dynamicValidateFormTwo.premiumListTwo[0].partCost = this.dynamicValidateFormTwo.premiumListTwo[0].partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach(
|
||||
(item) => {
|
||||
item.partCost = item.partPrice
|
||||
},
|
||||
)
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((item) => {
|
||||
item.partCost = item.partPrice
|
||||
})
|
||||
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
|
|
@ -693,9 +675,7 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
),
|
||||
partStrList: JSON.stringify(this.dynamicValidateFormTwo.premiumListTwo),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params)
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ module.exports = {
|
|||
// target: `https://z.csgmall.com.cn`,
|
||||
|
||||
// target: `http://192.168.0.15:39080`, //韩
|
||||
// target: `http://192.168.2.122:39080`, //超
|
||||
target: `http://192.168.0.133:39080`, //超
|
||||
|
||||
// target: `http://192.168.2.74:49080`, //旭/
|
||||
// target: `http://192.168.2.17:39080`, //帅
|
||||
target: `http://192.168.0.60:39080`, //福
|
||||
// target: `http://192.168.0.60:39080`, //福
|
||||
// target: `http://192.168.0.96:39080`, //马
|
||||
|
||||
//******** 注意事项 ********* */
|
||||
|
|
|
|||
Loading…
Reference in New Issue