需求修改

master
zhangdi 1 year ago
parent 29b9638840
commit 50af8b0554
  1. 314
      src/views/businessManagement/inspection/repair.vue
  2. 6
      src/views/businessManagement/repairManagement.vue
  3. 10
      src/views/components/workOrderDetail.vue
  4. 258
      src/views/goodsManagement/reciviceList.vue

@ -60,8 +60,9 @@
</div>
<el-form-item label="异常清单">
<el-table row-key="id" :span-method="errorSpanMethod" :data="errorForm.tableData" border
style="width: 98%" :summary-method="getSummaries" show-summary :row-class-name="tableRowClassName">
<el-table-column type="expand">
style="width: 98%" :summary-method="getSummaries" show-summary :row-class-name="tableRowClassName"
:expand-row-keys="expandedKeys">
<el-table-column type="expand" fixed="left">
<template slot-scope="props">
<el-table :data="props.row.detailGoodsList" stripe style="width: 100%">
<el-table-column prop="goodsName" align="center" label="物料名称">
@ -83,20 +84,20 @@
</el-table>
</template>
</el-table-column>
<el-table-column type="index" width="50" label="序号">
<el-table-column type="index" width="50" label="序号" fixed="left">
</el-table-column>
<el-table-column label="楼层" prop="floorName"></el-table-column>
<el-table-column label="房间名称" prop="deptName"></el-table-column>
<el-table-column label="专业/设备" prop="deviceName"></el-table-column>
<el-table-column label="巡检内容" prop="checkContent"></el-table-column>
<el-table-column label="工艺要求" prop="craft"></el-table-column>
<el-table-column label="状态" prop="status" v-if="errorForm.repairStatus != 1">
<el-table-column label="楼层" prop="floorName" width="150"></el-table-column>
<el-table-column label="房间名称" prop="deptName" width="150"></el-table-column>
<el-table-column label="专业/设备" prop="deviceName" width="150"></el-table-column>
<el-table-column label="巡检内容" prop="checkContent" width="150"></el-table-column>
<el-table-column label="工艺要求" prop="craft" width="150"></el-table-column>
<el-table-column label="状态" prop="status" v-if="errorForm.repairStatus != 1" width="100">
<template slot-scope="scope">
{{ scope.row.remark }}
{{ scope.row.status == 1 ? '异常' : '正常' }}
</template>
</el-table-column>
<el-table-column label="异常原因" prop="remark"></el-table-column>
<el-table-column label="异常原因" prop="remark" width="100"></el-table-column>
<!-- <el-table-column label="价格" prop="price" v-if="errorForm.repairStatus != 1"></el-table-column>
<el-table-column label="价格" prop="price" v-if="errorForm.repairStatus == 1">
<template slot-scope="scope">
@ -104,7 +105,8 @@
:disabled="viewType == 'view' || viewType == 'evaluate' || viewType == 'confirm'"></el-input>
</template>
</el-table-column> -->
<el-table-column prop="isRepair" align="center" label="是否维修" v-if="errorForm.repairStatus >= 3">
<el-table-column prop="isRepair" align="center" label="是否维修"
v-if="(errorForm.repairStatus >= 3) && (errorForm.repairStatus != 101)" width="150">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.isRepair" fill="red">
<el-radio :disabled="viewType == 'view' || viewType == 'evaluate' || dataTypes != 1"
@ -114,51 +116,72 @@
</el-radio-group>
</template>
</el-table-column>
<el-table-column prop="option" align="center" label="维修方案">
<el-table-column prop="repairOption" align="center" label="维修方案" width="150">
<template slot-scope="scope">
<el-input placeholder="请输入使用人签字" v-model="scope.row.option" style="width: 98%;"></el-input>
<el-input placeholder="请输入维修方案"
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"
v-model="scope.row.repairOption" style="width: 98%;"></el-input>
</template>
</el-table-column>
<el-table-column prop="isNeed" align="center" label="是否需要物料">
<el-table-column prop="isNeed" align="center" label="是否需要物料" width="120">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.isNeed" fill="red">
<!-- || errorForm.repairStatus != 1 -->
<el-radio :disabled="viewType == 'view' || errorForm.repairStatus != 1" :label="'1'"></el-radio>
<el-radio :disabled="viewType == 'view' || errorForm.repairStatus != 1" class="error_radio"
:label="'0'"></el-radio>
<el-radio
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"
:label="'1'"></el-radio>
<el-radio
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"
class="error_radio" :label="'0'"></el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column align="center" label="物料配置">
<el-table-column align="center" label="物料配置" width="120" v-if="errorForm.repairStatus == 1">
<template slot-scope="scope">
<el-button @click="setMaterial(scope.row)" :disabled="scope.row.isNeed == 0">物料配置</el-button>
<el-button @click="setMaterial(scope.row)" :disabled="scope.row.isNeed == 0"
size="mini">物料配置</el-button>
</template>
</el-table-column>
<!-- 维修完成 -->
<el-table-column align="center" label="维修完成图片" width="200"
v-if="errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8">
<template slot-scope="scope">
<div v-if="errorForm.repairStatus == 4">
<el-upload action="/api/blade-resource/oss/endpoint/put-file" list-type="picture-card"
:headers="headers" accept=".jpeg,.jpg,.png,.pdf" :file-list="scope.row.completeImgList"
:on-success="handleSuccess(scope.$index)" :on-remove="handleRemove(scope.$index)"
:before-upload="beforeAvatarUpload(scope.$index)">
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div v-else>
<img v-for="item in scope.row.completeImgList" :key="item" :src="item.url" alt=""
style="width: 148px; height: 148px;margin-right:10px;">
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
<!-- <el-form-item label="故障现象">
<el-input placeholder="请输入故障现象描述" type="textarea" v-model="errorForm.faultDescribe" style="width:98%;"
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input>
<el-form-item label="差旅费">
<el-input placeholder="请输入差旅费" v-model="errorForm.travelExpense" style="width:98%;"
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"
@input="actualAmount()"><template slot="append"></template></el-input>
</el-form-item>
<el-form-item label="故障产生原因">
<el-input placeholder="请输入故障产生原因" type="textarea" v-model="errorForm.faultCause" style="width:98%;"
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input>
</el-form-item> -->
<el-form-item label="处理结果">
<el-input placeholder="请输入处理结果" type="textarea" v-model="errorForm.processingResult" style="width:98%;"
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input>
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"></el-input>
</el-form-item>
<el-form-item label="差旅费">
<el-input placeholder="请输入差旅费" v-model="errorForm.travelExpense" style="width:98%;"
:disabled="viewType == 'view' || errorForm.repairStatus != 1"><template
<el-form-item label="维修总计"
v-if="errorForm.repairStatus == 2 || errorForm.repairStatus == 3 || errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8 || errorForm.repairStatus == 102">
<el-input placeholder="请输入" v-model="errorForm.actualAmount" style="width:98%;"
:disabled="viewType == 'view' || (errorForm.repairStatus != 2 && errorForm.repairStatus != 102)"><template
slot="append"></template></el-input>
</el-form-item>
<!-- <el-form-item label="巡检结论">
<el-input placeholder="请输入巡检结论" type="textarea" v-model="errorForm.inspectionConclusion"
style="width:98%;" :disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input>
</el-form-item> -->
</div>
</div>
<!-- 主管审核 -->
<div
v-show="((errorForm.repairStatus == 2 || errorForm.repairStatus == 102) || ((errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案')) && viewType != 'view'">
<div style="
@ -170,14 +193,14 @@
主管审核
</div>
<el-form-item label="审核结果">
<el-select placeholder="请选择审核结果" v-model="errorForm.approveResult" style="width: 98%;"
<el-select placeholder="请选择审核结果" v-model="errorForm.approveResultManager" style="width: 98%;"
:disabled="(errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案'">
<el-option label="通过" :value="1"></el-option>
<el-option label="驳回" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="errorForm.approveResult === 0" label="驳回意见">
<el-input type="textarea" v-model="errorForm.approveRemark" style="width: 98%;"
<el-form-item label="审核意见">
<el-input type="textarea" v-model="errorForm.approveRemarkManager" style="width: 98%;"
:disabled="(errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案'"></el-input>
</el-form-item>
<el-form-item
@ -188,22 +211,9 @@
</el-form-item>
</div>
<!-- 维修完成 -->
<div
v-show="errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8">
<el-form-item label="维修完成图片" prop="signaturePerson" v-if="errorForm.repairStatus == 4">
<el-upload action="/api/blade-resource/oss/endpoint/put-file" list-type="picture-card" :headers="headers"
accept=".jpeg,.jpg,.png,.pdf" :file-list="completeImgList" :on-success="handleSuccess"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="维修完成图片" prop="signaturePerson" v-else>
<img v-for="item in completeImgList" :key="item" :src="item.url" alt=""
style="width: 148px; height: 148px;margin-right:10px;">
</el-form-item>
</div>
<div v-show="dataTypes == 1 && errorForm.repairStatus == 3 && viewType != 'view'">
<!-- 客户确认审核效果 -->
<div v-show="errorForm.repairStatus == 3 && viewType != 'view'">
<div style="
color: #101010;
font-size: 20px;
@ -219,12 +229,12 @@
<el-option label="驳回" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="errorForm.approveResult === 0" label="驳回意见">
<el-form-item label="审核意见">
<el-input type="textarea" v-model="errorForm.approveRemark" style="width: 98%;"
:disabled="viewType == 'view'"></el-input>
</el-form-item>
</div>
<!-- 维修效果确认 -->
<div
v-show="(errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8)">
<div style="
@ -324,7 +334,13 @@
@click="clickTimeNo">不满意</div>
</div>
</div>
<el-form-item label="意见" label-width="60px"
v-show="(!errorForm.isOkQuality || !errorForm.isOkSecure || !errorForm.isOkValidity)">
<el-input type="textarea" v-model="errorForm.evaluationRemarks" placeholder="意见" style="width: 98%;"
:disabled="dialogType == 'view'||(errorForm.repairStatus==6||errorForm.repairStatus==7||errorForm.repairStatus==8)"></el-input>
</el-form-item>
</div>
<div
v-show="(rowStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8 || isEvalute) && errorForm.approveResult1 == 1">
<div style="
@ -563,7 +579,7 @@ export default {
dataTypes: '',//
headers: {},
completeImgList: [],//
expandedKeys: [],//
}
},
computed: {
@ -597,6 +613,9 @@ export default {
}
return '';
},
deleteColumn(row, index) {
this.tableData.splice(index, 1);
},
//
getSummaries(param) {
const { columns, data } = param;
@ -632,6 +651,10 @@ export default {
return sums;
},
//
actualAmount() {
},
closeName() {
if (this.nameImg == '') {
@ -691,7 +714,6 @@ export default {
item.detailGoodsList = data
}
})
console.log(11111, this.errorForm.tableData)
this.materialVisible = false
},
changeProduct(value, index) {
@ -835,6 +857,7 @@ export default {
let data = this.checkDeepData(res.data.data.details)
if (this.errorForm.repairStatus > 1) {
data.forEach(item => {
item.completeImgList = item.completeImgList != '' ? JSON.parse(item.completeImgList) : []
if (item.detailGoodsList.length > 0) {
item.isNeed = '1'
} else {
@ -844,11 +867,12 @@ export default {
}
this.errorForm.tableData = []
this.errorForm.tableData = data
this.getExpandedKeys(data)
this.errorForm.tableData.map(item => {
item.price = item.price == -1 ? '' : item.price
})
// completeImgList
this.completeImgList = this.errorForm.completeImgList != '' ? JSON.parse(this.errorForm.completeImgList) : []
this.errorForm.approveResult1 = this.errorForm.approveResult
this.nameImg = ''
this.getSpanArr(this.errorForm.tableData)
@ -875,6 +899,7 @@ export default {
if (this.errorForm.repairStatus > 1) {
data.forEach(item => {
item.completeImgList = JSON.parse(item.completeImgList)
if (item.detailGoodsList.length > 0) {
item.isNeed = '1'
} else {
@ -883,6 +908,7 @@ export default {
})
}
this.errorForm.tableData = data
this.getExpandedKeys(data)
})
},
@ -947,6 +973,7 @@ export default {
}
})
this.errorForm.tableData = data
this.getExpandedKeys(data)
}
@ -970,8 +997,13 @@ export default {
})
}
this.errorForm.tableData = data
this.errorForm.approveResult = ''
this.errorForm.approveRemark = ''
this.getExpandedKeys(data)
this.errorForm.approveResultManager = ''
this.errorForm.approveRemarkManager = ''
//
this.errorForm.actualAmount = (this.errorForm.totalPrice ? this.errorForm.totalPrice : 0) + this.errorForm.travelExpense ? Number(this.errorForm.travelExpense) : 0
}
})
},
@ -987,6 +1019,7 @@ export default {
this.errorForm.tableData.map(item => {
item.isRepair = 1
})
this.getExpandedKeys(data)
this.errorForm.approveResult = ''
this.errorForm.approveRemark = ''
}
@ -1006,7 +1039,8 @@ export default {
approveResult: this.errorForm.approveResult1,
approvePerson: this.userInfo.user_id,
approveTime: moment().format('YYYY-MM-DD HH:mm:ss'),
approveRemark: this.errorForm.approveRemark
approveRemark: this.errorForm.approveRemark,
}
customerRefuseFinish(query).then(res => {
if (res.data.code == 200) {
@ -1034,6 +1068,7 @@ export default {
signaturePerson: this.errorForm.signaturePerson,
signatureTime: this.errorForm.signatureTime,
approveResult: this.errorForm.approveResult1,
evaluationRemarks:this.errorForm.evaluationRemarks
}
customerConfirmFinish(query).then(res => {
if (res.data.code == 200) {
@ -1160,6 +1195,7 @@ export default {
startTime: item.startTime, //
isNeed: item.isNeed,// 01
detailGoodsList: item.detailGoodsList,//
repairOption: item.repairOption
})
})
@ -1174,6 +1210,7 @@ export default {
travelExpense: this.errorForm.travelExpense,//
inspectionConclusion: this.errorForm.inspectionConclusion,//
totalPrice: this.totalPrice,//
}
solutionSave(params).then(res => {
if (res.data.code == 200) {
@ -1188,9 +1225,16 @@ export default {
})
// }
} else if (this.viewType == 'check') {
if (this.errorForm.approveResult == 1) {
supervisorConfirm({ id: this.errorForm.id }).then(res => {
} else if (this.viewType == 'check') {//
if (this.errorForm.approveResultManager == 1) {
let query = {
id: this.errorForm.id, //id
approvePerson: this.userInfo.user_id, //
approveResultManager: this.errorForm.approveResultManager, //
approveRemarkManager: this.errorForm.approveRemarkManager, //
actualAmount: this.errorForm.actualAmount
}
supervisorConfirm(query).then(res => {
if (res.data.code == 200) {
this.$message.success('提交成功')
this.dialogerror = false
@ -1201,8 +1245,8 @@ export default {
let query = {
id: this.errorForm.id, //id
approvePerson: this.userInfo.user_id, //
approveResult: this.errorForm.approveResult, //
approveRemark: this.errorForm.approveRemark //
approveResultManager: this.errorForm.approveResultManager, //
approveRemarkManager: this.errorForm.approveRemarkManager //
}
supervisorRefuse(query).then(res => {
if (res.data.code == 200) {
@ -1266,8 +1310,36 @@ export default {
this.handleConfirm()
}
else if (this.viewType == 'repairupload') {
let query = []
this.errorForm.tableData.map(item => {
query.push({
id: item.id, // id
status: item.status, //01
taskId: this.errorForm.id, // ID
floorName: item.floorName, //
deptId: item.deptId, //
majorName: item.majorName, //
checkContent: item.checkContent, //
craft: item.craft, //
period: item.period, // 1: 2 3
picUrl: item.picUrl, //
signUrl: item.signUrl, //
remark: item.remark, //
price: item.price, //
startTime: item.startTime, //
isNeed: item.isNeed,// 01
detailGoodsList: item.detailGoodsList,//
repairOption: item.repairOption,
completeImgList: JSON.stringify(item.completeImgList)
})
})
//
servicemanSubmit({ id: this.errorForm.id, completeImgList: JSON.stringify(this.completeImgList) }).then(res => {
let dataTable = {
id: this.errorForm.id,
details: query,
}
servicemanSubmit(dataTable).then(res => {
if (res.data.code == 200) {
this.$message.success('维修完成')
this.dialogerror = false
@ -1333,10 +1405,11 @@ export default {
getRepairDetail({ id: row.id }).then(res => {
if (res.data.code == 200) {
this.errorForm = res.data.data
this.dialogerror = true
let data = this.checkDeepData(res.data.data.details)
if (this.errorForm.repairStatus > 1) {
data.forEach(item => {
item.completeImgList = JSON.parse(item.completeImgList)
if (item.detailGoodsList.length > 0) {
item.isNeed = '1'
} else {
@ -1345,30 +1418,107 @@ export default {
})
}
this.errorForm.tableData = data
// this.errorForm.approveResult = ''
// this.errorForm.approveRemark = ''
this.getExpandedKeys(data)
this.dialogerror = true
}
})
},
//
handleSuccess(response, file, fileList) {
this.completeImgList.push(
{
url: response.data.link, //--url
name: response.data.originalName //--
}
)
handleSuccess(index) {
return (response, file, fileList) => {
this.errorForm.tableData[index].completeImgList = []
fileList.map(item => {
this.errorForm.tableData[index].completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url })
})
}
},
//
handleRemove(file, fileList) {
handleRemove(index) {
return (file, fileList) => {
this.completeImgList = []
this.errorForm.tableData[index].completeImgList = []
fileList.map(item => {
this.completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url })
this.errorForm.tableData[index].completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url })
})
}
},
beforeAvatarUpload(index) {
return (file) => {
if (this.errorForm.tableData[index].completeImgList.length < 3) {
const isLt3M = file.size
const _this = this
return new Promise((resolve, reject) => {
const image = new Image()
let resultBlob = ''
image.src = URL.createObjectURL(file)
image.onload = () => {
// blob
resultBlob = _this.compressUpload(image, file)
const fs = new File([resultBlob], file.name, {
type: file.type,
width: 200,
height: 200
})
if (fs.size > 1024 * 1024 * 3) {
this.$message.warning('压缩后图片仍大于3Mb,请您手动压缩')
reject()
}
resolve(fs)
}
image.onerror = () => {
reject()
}
})
} else {
this.$message.error('故障视频与故障图片最多可上传3个')
return false
}
}
},
/* 图片压缩方法-canvas压缩 */
compressUpload(image, file) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
const width = image.width * 0.1 // *
const height = image.height * 0.1 // *
canvas.width = width //
canvas.height = height //
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(image, 0, 0, width, height)
const dataUrl = canvas.toDataURL(file.type) //
const blobData = this.dataURItoBlob(dataUrl, file.type) //
return blobData
},
/* base64转Blob对象 */
dataURItoBlob(data) {
let byteString
if (data.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(data.split(',')[1])
} else {
byteString = unescape(data.split(',')[1])
}
const mimeString = data.split(',')[0].split(':')[1].split(';')[0]
const ia = new Uint8Array(byteString.length)
for (let i = 0; i < byteString.length; i += 1) {
ia[i] = byteString.charCodeAt(i)
}
return new Blob([ia], { type: mimeString })
},
getExpandedKeys(table) {
this.expandedKeys = []
table.forEach(item => {
this.expandedKeys.push(item.id)
})
}
}
}
</script>

@ -239,7 +239,7 @@
<workOrderDetail v-if="repairVisible" :repairVisible='repairVisible' :detailId="workOrderDetailId" :repairTypeTitle="repairTypeTitle"
:dialogType="dialogType" @closeWorkOrderDetail="closeWorkOrderDetail"></workOrderDetail>
<!-- 日志弹窗 -->
<logDialog :orderId="logOrderId" :infoDialog="infoDialog" @closeLog="closeLog" type="repair"></logDialog>
<logDialog :orderId="logOrderId" :infoDialog="infoDialog" v-if="infoDialog" @closeLog="closeLog" type="repair"></logDialog>
</basic-container>
</template>
@ -424,7 +424,7 @@ export default {
repairPersonList: [],
rejectVisible:false,
rejectForm:{}, //
rejectRules: {
rejectRules: {
reason: { required: true, message: '请填写驳回原因', trigger: 'blur' }
},
cloneVisible: false,
@ -1061,4 +1061,4 @@ export default {
}
</script>
<style></style>
<style></style>

@ -88,9 +88,9 @@
@change="changeDevice">
<el-option v-for="item in deviceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<!-- <el-cascader :props="deviceProps" style="width:98%;" v-model="repairForm.deviceId" :disabled="dialogType == 'view'"
<!-- <el-cascader :props="deviceProps" style="width:98%;" v-model="repairForm.deviceId" :disabled="dialogType == 'view'"
filterable :filter-method="selectDevice" :before-filter="beforeFilter"></el-cascader> -->
<el-input v-if="dialogType == 'view' || dialogType == 'examine'" v-model="repairForm.deviceName" disabled
style="width:98%;"></el-input>
</el-form-item>
@ -693,7 +693,7 @@ export default {
this.repairForm.totalCost = ''
}
}
if(res.data.data.status == 103 && this.dialogType != 'view'){
this.repairRules = {
overPicture:{required: true,validator: this.fileMustUpload, trigger: 'blur'}
@ -803,7 +803,7 @@ export default {
console.log('val--------------->',val)
if (row.unifiedQuotation) {
// row.price = (row.unifiedQuotation * val).toFixed(2)
row.price = Math.trunc(row.unifiedQuotation * val * 100) / 100
row.price = Math.trunc(row.unifiedQuotation * val * 100) / 100
}
},
//
@ -1252,4 +1252,4 @@ export default {
}
</script>
<style></style>
<style></style>

@ -101,10 +101,84 @@
</logDialog>
<!-- 修改申领单 -->
<!-- <el-dialog title="修改物品申领单" :visible.sync="dialogReceive" :append-to-body="true" width="70%" class="proRecive"
:close-on-click-modal="false">
</el-dialog> -->
<el-dialog title="修改物品申领单" :visible.sync="dialogEditReceive" :append-to-body="true" width="70%"
class="proEditRecive" :close-on-click-modal="false">
<el-table :data="tableGoodsData" border>
<el-table-column width="50" align="center">
<template slot="header" slot-scope="scope">
<div @click="addColumn()"
style="width:30px;height: 30px;background: #409eff;border-radius: 50%;cursor: pointer;display: flex;align-items: center;justify-content: center;">
<i style="color:#fff;font-size: 20px;" class="el-icon-plus"></i>
</div>
</template>
<template slot-scope="scope">
<div @click="deleteColumn(scope.row, scope.$index)"
style="width:30px;height: 30px;background: #f56c6c;border-radius: 50%;cursor: pointer;display: flex;align-items: center;justify-content: center;">
<i style="color:#fff;font-size: 20px;" class="el-icon-delete"></i>
</div>
</template>
</el-table-column>
<el-table-column prop="productId" align="center" label="物料名称">
<template slot-scope="scope">
<el-select @change="((val) => { changeProduct(val, scope.$index) })"
@blur="((val) => { changeProduct(val, scope.$index) })" v-loadmore="loadmoreProduct"
v-model="scope.row.productId" filterable remote :remote-method="remoteMethodProduct" placeholder="请选择物品"
size="mini">
<el-option v-for="item in productLists" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="inventoryId" label="库存ID" align="center" width="120">
<template slot-scope="scope">
<el-input v-if="scope.row.productId == '1878677914447265793'" @change="clickInventoryId"
placeholder="请输入库存ID" v-model="scope.row.inventoryId" size="mini"></el-input>
<span v-else>{{ scope.row.inventoryId }}</span>
</template>
</el-table-column>
<el-table-column prop="rule" align="center" label="规格" width="120">
<template slot-scope="scope">
<el-input v-if="scope.row.productId == '1878677914447265793'" v-model="scope.row.rule" placeholder="请输入规格"
style="width:98%;" size="mini"></el-input>
<span v-else>{{ scope.row.rule }}</span>
</template>
</el-table-column>
<el-table-column prop="xh" align="center" label="型号" width="120">
<template slot-scope="scope">
<el-input v-if="scope.row.productId == '1878677914447265793'" v-model="scope.row.model" placeholder="请输入型号"
style="width:98%;" size="mini"></el-input>
<span v-else>{{ scope.row.xh }}</span>
</template>
</el-table-column>
<el-table-column prop="applyNum" align="center" label="数量" width="140">
<template slot-scope="scope">
<el-input-number style="width: 100%;" v-model="scope.row.applyNum" placeholder="请输入数量" :min="1"
size="mini" @change="changeNumber(scope.row.applyNum, scope.row)"></el-input-number>
</template>
</el-table-column>
<!-- <el-table-column prop="unit" align="center" label="单位" width="120">
<template slot-scope="scope">
<el-input v-if="scope.row.productId == '1878677914447265793'" v-model="scope.row.unit" placeholder="请输入单位"
style="width:98%;" size="mini"></el-input>
<span v-else>{{ scope.row.unit }}</span>
</template>
</el-table-column> -->
<el-table-column prop="price" align="center" label="价格" width="200">
<template slot-scope="scope">
<el-input v-if="scope.row.productId == '1878677914447265793'" v-model="scope.row.price" placeholder="请输入价格"
style="width:98%;" size="mini">
<template slot="append"></template>
</el-input>
<el-input v-else v-model="scope.row.price" disabled placeholder="请输入价格" style="width:98%;" size="mini">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="handleCancelFinish"> </el-button> -->
<el-button @click="handleFinishSub"> </el-button>
</span>
</el-dialog>
</basic-container>
</template>
@ -112,7 +186,7 @@
<script>
import SelectTree from '../../components/selectTree/tree.vue'
import { getReciviceList, getDetail, reciveGoods, returnGoods } from '@/api/goodsManagement/recivice'
import {applyGoods } from '@/api/goodsManagement/goods'
import { applyGoods, getGoodsList } from '@/api/goodsManagement/goods'
import { mapGetters } from "vuex";
import { dateFormat } from "../../util/date";
import logDialog from '../../components/order/logDialog.vue'
@ -366,6 +440,12 @@ export default {
logOrderId: '',//id
infoDialog: false,//
dialogEditReceive: false,//
tableGoodsData: [],//
productLists: [],
productCurrent: 1,
productSize: 9999,
}
},
computed: {
@ -376,6 +456,124 @@ export default {
this.onLoad()
},
methods: {
//
handleEdit(row) {
getDetail({ id: row.id }).then(res => {
this.viewType = 'edit'
this.receiveForm = res.data.data
this.receiveForm.tableData = res.data.data.details
this.getProductLists()
})
},
//
addColumn() {
let arr = JSON.parse(JSON.stringify(this.tableGoodsData))
arr.push({ productType: { node: undefined, data: {} }, inventoryId: '', productId: '', productName: '', rule: '', xh: '', applyNum: 0, unit: '', price: '',unifiedQuotation:'', productList: [] })
this.tableGoodsData = arr
},
deleteColumn(row, index) {
this.tableGoodsData.splice(index, 1);
},
changeProduct(value, index) {
let productValue = this.productLists.find(item => item.id == value)
if (typeof value == 'string') {
productValue.unifiedQuotation = productValue.unifiedQuotation == -1 ? 0 : productValue.unifiedQuotation
this.tableGoodsData[index] = productValue
this.tableGoodsData[index].price = productValue ? productValue.unifiedQuotation * 1 : ''
this.tableGoodsData[index].productName= productValue ? productValue.name : ''
// this.tableGoodsData[index].applyNum = 1
}
},
changeNumber(val, row) {
if (row.unifiedQuotation) {
row.price = (row.unifiedQuotation * val).toFixed(2)
}
},
remoteMethodProduct(query) {
this.productCurrent = 1
this.productSize = 10
this.getProductLists('search', query)
},
loadmoreProduct() {
if (this.productCurrent * this.productSize >= this.productTotals) return
this.productCurrent++
this.getProductLists('more')
},
//
getProductLists(type, val, inventoryId) {
getGoodsList({ current: this.productCurrent, size: this.productSize, name: val ? val : null, inventoryId: inventoryId ? inventoryId : null }).then(res => {
let data_ = res.data.data.records
this.tableGoodsData = []
data_.forEach(item => {
item.productId = item.id
})
if (type == 'more') {
this.productLists = this.productLists.concat(data_)
this.productTotals = res.data.data.total
} else {
this.productLists = data_
this.productTotals = res.data.data.total
}
// this.receiveForm.tableData
this.receiveForm.tableData.forEach(item => {
this.productLists.forEach(v => {
if (item.productId == v.id) {
v.price = v ? v.unifiedQuotation * item.applyNum : ''
item.id = v.id,
this.tableGoodsData.push({
...item,
unifiedQuotation:v.unifiedQuotation,
price:v ? v.unifiedQuotation * item.applyNum : '',
inventoryId:v.inventoryId,
productId:v.id,
productName:v.name
})
}
})
})
this.dialogEditReceive = true
})
},
//
handleFinishSub() {
if (this.viewType == 'edit') {
let data1 = []
this.tableGoodsData.map(item => {
data1.push({
productId: item.id, //id
productName: item.productName, //
brand: item.brand, //
xh: item.xh, //
rule: item.rule, //
applyNum: item.applyNum, //
productCode: item.inventoryId,
price: item.price,
unifiedQuotation: item.unifiedQuotation
})
})
if (this.tableGoodsData.find(item => item.applyNum == 0|| !item.applyNum)) {
this.$message.error('申领数量不可为0')
return false
}
let query1 = {
details: data1,
id: this.receiveForm.id,
code: this.receiveForm.code,
status: 0,
}
applyGoods(query1).then(res => {
if (res.data.code == 200) {
this.$message.success('提交成功')
this.onLoad()
this.dialogEditReceive = false
}
})
}
},
//
viewLog(row) {
this.infoDialog = true
@ -467,7 +665,7 @@ export default {
this.dialogReceive = true
}
},
//
//
handleImport(row) {
getDetail({ id: row.id }).then(res => {
this.viewType = 'import'
@ -514,24 +712,12 @@ export default {
// this.$message.success('')
// })
},
//
handleEdit(row) {
getDetail({ id: row.id }).then(res => {
this.viewType = 'edit'
this.receiveForm = res.data.data
this.receiveForm.tableData = res.data.data.details
this.receiveForm.tableData.map(item => {
item.returnNum = item.outNum
})
this.dialogReceive = true
})
},
//
deleteGoods(row) {
if (this.tableData.length == 1) {
this.$message.warning('请至少为一条物品进行入库操作')
} else {
console.log('this.table==========>', this.tableData)
this.$confirm("确定删除该条数据吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -548,12 +734,10 @@ export default {
},
//
handleSave() {
console.log('table---------->', this.tableData)
this.dialogVisible = false
},
//
changeCount(row, currentValue) {
console.log('row===========>', row)
if (row.count > row.goodsNumber) {
this.isShowTips = true
} else {
@ -572,7 +756,6 @@ export default {
// // this.$message.error('')
// // }
// else {
// console.log('this.receiveForm.tableData', this.receiveForm.tableData)
let data = []
this.receiveForm.tableData.map(item => {
data.push({
@ -589,7 +772,6 @@ export default {
isReturn: data.find(item => item.returnTime != '') ? 1 : 0, //
code: this.receiveForm.code
}
console.log('query===========>', query)
reciveGoods(query).then(res => {
if (res.data.code == 200) {
this.$message.success('出库成功')
@ -602,7 +784,6 @@ export default {
if (this.receiveForm.tableData.find(item => item.returnNum == 0)) {
this.$message.error('归还数量不可为0')
} else {
console.log('this.receiveForm.tableData', this.receiveForm.tableData)
let data = []
this.receiveForm.tableData.map(item => {
data.push({
@ -624,34 +805,6 @@ export default {
}
})
}
} else if (this.viewType == 'edit') {
let data1 = []
this.receiveForm.tableData.map(item => {
data1.push({
productId: item.id, //id
productName: item.goodsName, //
brand: item.brand, //
xh: item.model, //
rule: item.parameter, //
applyNum: 5, //
returnTime: item.returnTime !== '' ? item.returnTime + ' 23:59:59' : '',
productCode: item.productCode
})
})
let query1 = {
details: data1,
id: this.receiveForm.id,
code: this.receiveForm.code,
status: 0,
}
console.log(99898,query1)
applyGoods(query1).then(res => {
if (res.data.code == 200) {
this.$message.success('提交成功')
this.onLoad()
this.dialogReceive = false
}
})
}
}
@ -670,7 +823,6 @@ export default {
// { goodsId: 'WPID-002', goodsNo: 'WL-20240820-02', goodsName: '', goodsTypeName: '', majorTypeName: '', brand: '西', model: '50mm', parameter: '', applyNumber: 60, applyTime: '2024-07-12', applyUser: '',isReturn:2, unit: '', },
// ]
console.log('searchForm-------->', this.searchFrom)
let query = {
current: this.page.currentPage,
size: this.page.pageSize,

Loading…
Cancel
Save