维修管理
This commit is contained in:
parent
8c5cf9aac4
commit
2a59185686
|
|
@ -54,3 +54,22 @@ export function saveCodeList(data) {
|
|||
})
|
||||
}
|
||||
|
||||
//维修提交
|
||||
export function sendList(data) {
|
||||
return request({
|
||||
url: '/material/repair/endRepairTask',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
//维修合格
|
||||
export function auditPass(data) {
|
||||
return request({
|
||||
url: '/material/repair/completeRepair',
|
||||
method: 'post',
|
||||
data: data,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
<el-button size="mini" type="warning" @click="handleRepair(scope.row)"
|
||||
>维修</el-button
|
||||
>
|
||||
<el-button size="mini" type="success">合格</el-button>
|
||||
<el-button size="mini" type="success" @click="handleAddSingle(scope.row)">合格</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
<el-button type="primary" size="mini" @click="saveCodeDialog"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button type="normal" size="mini" @click="openCode = false"
|
||||
<el-button type="normal" size="mini" @click="openCode=false"
|
||||
>取消</el-button
|
||||
>
|
||||
</div>
|
||||
|
|
@ -538,10 +538,10 @@
|
|||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="报废原因" prop="scrapReason">
|
||||
<!-- <el-form-item label="报废原因" prop="scrapReason">
|
||||
<el-select
|
||||
v-model="scrapForm.scrapReason"
|
||||
placeholder="损坏原因"
|
||||
placeholder="报废原因"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 250px"
|
||||
|
|
@ -553,10 +553,10 @@
|
|||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="损坏原因" prop="damageReason">
|
||||
</el-form-item> -->
|
||||
<el-form-item label="损坏原因" prop="scrapType">
|
||||
<el-select
|
||||
v-model="scrapForm.damageReason"
|
||||
v-model="scrapForm.scrapType"
|
||||
placeholder="损坏原因"
|
||||
clearable
|
||||
filterable
|
||||
|
|
@ -568,24 +568,24 @@
|
|||
:label="item.label"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他原因" prop="remark">
|
||||
<el-input
|
||||
v-model="scrapForm.otherReason"
|
||||
placeholder="请输入其他原因"
|
||||
clearable
|
||||
maxlength="150"
|
||||
type="textarea"
|
||||
style="width: 250px"
|
||||
rows="4"
|
||||
/>
|
||||
<el-form-item label="报废原因" prop="scrapReason">
|
||||
<el-input
|
||||
v-model="scrapForm.scrapReason"
|
||||
placeholder="请输入报废原因"
|
||||
clearable
|
||||
maxlength="150"
|
||||
type="textarea"
|
||||
style="width: 300px"
|
||||
rows="4"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-form-item label="照片">
|
||||
<el-upload
|
||||
action="#"
|
||||
:limit="3"
|
||||
:file-list="fileList"
|
||||
:show-file-list="true"
|
||||
:auto-upload="false"
|
||||
|
|
@ -651,6 +651,7 @@
|
|||
maxlength="20"
|
||||
type="number"
|
||||
style="width: 265px"
|
||||
@input="waitRepairCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -750,6 +751,7 @@
|
|||
maxlength="20"
|
||||
type="number"
|
||||
style="width: 265px"
|
||||
@input="waitRepairCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -880,25 +882,10 @@
|
|||
maxlength="20"
|
||||
type="number"
|
||||
style="width: 250px"
|
||||
@input="waitRepairCount"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="报废原因" prop="scrapReason">
|
||||
<el-select
|
||||
v-model="formRight.scrapReason"
|
||||
placeholder="报废原因"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in damageReasonList"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="损坏原因" prop="scrapType">
|
||||
<el-select
|
||||
v-model="formRight.scrapType"
|
||||
|
|
@ -915,37 +902,35 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他原因" prop="otherReason">
|
||||
<el-form-item label="报废原因" prop="scrapReason">
|
||||
<el-input
|
||||
v-model="formRight.otherReason"
|
||||
placeholder="请输入其他原因"
|
||||
v-model="formRight.scrapReason"
|
||||
placeholder="请输入报废原因"
|
||||
clearable
|
||||
maxlength="150"
|
||||
type="textarea"
|
||||
style="width: 300px"
|
||||
rows="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="picture">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:headers="upload.headers"
|
||||
drag
|
||||
:action="upload.url"
|
||||
:show-file-list="false"
|
||||
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
|
||||
:on-success="handleFileSuccess3"
|
||||
:auto-upload="true"
|
||||
style="margin-left: 100px"
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或<em>点击上传</em>
|
||||
</div>
|
||||
<!-- <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div> -->
|
||||
</el-upload>
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片">
|
||||
<el-upload
|
||||
action="#"
|
||||
:file-list="fileList"
|
||||
:show-file-list="true"
|
||||
:auto-upload="false"
|
||||
:key="uploadKey"
|
||||
list-type="picture-card"
|
||||
accept=".png, .jpg, .jpeg"
|
||||
:on-change="handleChange"
|
||||
:class="{ disabled: uploadDisabled }"
|
||||
:on-preview="picturePreview"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -959,7 +944,7 @@
|
|||
align-items: center;
|
||||
"
|
||||
>
|
||||
<el-button type="primary" size="mini" @click="saveNumAll"
|
||||
<el-button type="primary" size="mini" :disabled="flagSave" @click="saveNumAll"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button type="normal" size="mini" @click="saveCancelAll"
|
||||
|
|
@ -981,6 +966,7 @@ import {
|
|||
getAppRepairMaTypeList,
|
||||
partTypeTreeList,
|
||||
saveCodeList,
|
||||
auditPass,
|
||||
} from "@/api/repair/repair.js";
|
||||
|
||||
import {
|
||||
|
|
@ -1013,7 +999,7 @@ export default {
|
|||
uploadKey: Date.now(),
|
||||
partItems: [{ partType: "", partNum: "", isCharge: "" }],
|
||||
partItemsMiddle: [
|
||||
{ partName: "", partNum: "", partPrice: "", isCharge: "" },
|
||||
{ partName: "", partNum: "", partPrice: "0", isCharge: "" },
|
||||
],
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
|
|
@ -1115,8 +1101,8 @@ export default {
|
|||
fileUrl: "",
|
||||
},
|
||||
damageReasonList: [
|
||||
{ label: "自然损坏", id: "自然损坏" },
|
||||
{ label: "人为损坏", id: "人为损坏" },
|
||||
{ label: "自然损坏", id: 0 },
|
||||
{ label: "人为损坏", id: 1 },
|
||||
], //自然损坏、人为损坏
|
||||
scrapRules: {},
|
||||
//树状勾选
|
||||
|
|
@ -1137,17 +1123,105 @@ export default {
|
|||
//数量维修
|
||||
openNum: false,
|
||||
partTypeTreeTwo: [],
|
||||
formLeft: {},
|
||||
formMiddle: {},
|
||||
formRight:{},
|
||||
rulesLeft: {},
|
||||
rulesMiddle: {},
|
||||
rulesRight: {},
|
||||
|
||||
//数量维修三部分
|
||||
formLeft: {
|
||||
repairNum:0
|
||||
},
|
||||
formMiddle: {
|
||||
repairNum:0
|
||||
},
|
||||
formRight:{
|
||||
scrapNum:0
|
||||
},
|
||||
|
||||
rulesLeft: {
|
||||
repairNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入内部维修数量",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
rulesMiddle: {
|
||||
repairNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入返厂维修数量",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
partPrice: [
|
||||
{
|
||||
required: false,
|
||||
message: "请输入金额",
|
||||
trigger: "blur",
|
||||
},
|
||||
// {
|
||||
// validator: (rule, value, callback) => {
|
||||
// const regex = /^[+-]?(0|[1-9]\d*)(\.\d+)?$/;
|
||||
// if(!regex.test(value)){
|
||||
// return callback(new Error('请勿输入非数字'));
|
||||
// }
|
||||
// const pat = parseFloat(value);
|
||||
// console.log('pat',pat)
|
||||
// if(pat.toString().includes('.')==true){
|
||||
// if (pat <0 ||pat.toString().split(".")[1].length>6) {
|
||||
// callback(new Error('请必须输入大于0的数据且小数点后最多保留六位'));
|
||||
// } else {
|
||||
// callback();
|
||||
// }
|
||||
// }else{
|
||||
// if (pat<0) {
|
||||
// callback(new Error('请必须输入大于0的数据且小数点后最多保留六位'));
|
||||
// }else{
|
||||
// callback();
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
]
|
||||
},
|
||||
rulesRight: {
|
||||
scrapNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入返厂维修数量",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
|
||||
scrapType: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择损坏原因",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
scrapReason: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入报废原因",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
//文件数组
|
||||
fileList: [],
|
||||
//暂存的文件数组
|
||||
fileListTemp:[],
|
||||
|
||||
typeTemp: "",
|
||||
typeNameTemp: "",
|
||||
typeeTmp: "",
|
||||
//待维修数量
|
||||
disrepairNumTemp: undefined,
|
||||
//数量维修是否能保存
|
||||
flagSave: false,
|
||||
//合格勾选对象数组
|
||||
idsList:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -1193,31 +1267,42 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.queryParams.equipmentList = selection;
|
||||
this.idsList = [];
|
||||
this.ids = selection.map((item) => item.id);
|
||||
selection.forEach((item) => {
|
||||
this.idsList.push(item.id);
|
||||
});
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 批量合格按钮操作 */
|
||||
handleAdd() {
|
||||
if (this.queryParams.equipmentList.length == 0) {
|
||||
this.$message.error("请先勾选数据");
|
||||
return;
|
||||
if (this.ids.length == 0) {
|
||||
this.$alert("请至少勾选一条数据", "提示", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确定",
|
||||
});
|
||||
}else{
|
||||
auditPass(this.idsList).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("通过成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(this.queryParams);
|
||||
// this.queryParams.backApplyInfo = {
|
||||
// remark: this.queryParams.remark,
|
||||
// agreementId: this.queryParams.agreementId,
|
||||
// backTime: this.queryParams.backTime,
|
||||
// }
|
||||
// let params = {
|
||||
// backApplyInfo: this.queryParams.backApplyInfo,
|
||||
// backApplyDetailsList:
|
||||
// this.queryParams.equipmentList,
|
||||
// }
|
||||
// const res = await editBackApply(params)
|
||||
// if (res.code == 200) {
|
||||
// this.$message({ type: 'success', message: res.msg })
|
||||
// setTimeout(() => {
|
||||
// this.$emit('goBackPage')
|
||||
// }, 1000)
|
||||
// }
|
||||
},
|
||||
//单个合格按钮操作
|
||||
handleAddSingle(row){
|
||||
const ids = [];
|
||||
ids.push(row.id);
|
||||
this.$modal
|
||||
.confirm("是否确认合格所选择的数据项?")
|
||||
.then(function () {
|
||||
return auditPass(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess("合格成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
|
|
@ -1287,43 +1372,6 @@ export default {
|
|||
this.openNum = true;
|
||||
});
|
||||
}
|
||||
// this.repairRowData = row;
|
||||
// this.repairDeviceList = [];
|
||||
// this.repairRowData.repairDeviceList = [
|
||||
// {
|
||||
// materialName: "速差自控器",
|
||||
// typeName: "G-J-10",
|
||||
// maId: "1",
|
||||
// maCode: "W202407-00001",
|
||||
// maStatus: "待修",
|
||||
// apDetection: "",
|
||||
// partTableList: [],
|
||||
// backTableList: [],
|
||||
// bmFileInfos: [],
|
||||
// },
|
||||
// {
|
||||
// materialName: "速差自控器",
|
||||
// typeName: "G-J-10",
|
||||
// maId: "2",
|
||||
// maCode: "W202407-00002",
|
||||
// maStatus: "待修",
|
||||
// apDetection: "",
|
||||
// partTableList: [],
|
||||
// backTableList: [],
|
||||
// bmFileInfos: [],
|
||||
// },
|
||||
// {
|
||||
// materialName: "速差自控器",
|
||||
// typeName: "G-J-10",
|
||||
// maId: "3",
|
||||
// maCode: "W202407-00003",
|
||||
// maStatus: "待修",
|
||||
// apDetection: "",
|
||||
// partTableList: [],
|
||||
// backTableList: [],
|
||||
// bmFileInfos: [],
|
||||
// },
|
||||
// ];
|
||||
if (
|
||||
this.repairRowData.repairDeviceList &&
|
||||
this.repairRowData.repairDeviceList.length > 0
|
||||
|
|
@ -1341,12 +1389,12 @@ export default {
|
|||
},
|
||||
// 编码维修弹窗保存
|
||||
saveCodeDialog() {
|
||||
console.log(this.repairRowData);
|
||||
console.log(this.repairDeviceList);
|
||||
this.repairRowData.repairDeviceList = this.repairDeviceList;
|
||||
saveCodeList(this.repairRowData.repairDeviceList).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.fileList = [];
|
||||
this.fileListTemp = [];
|
||||
}
|
||||
});
|
||||
this.openCode = false;
|
||||
|
|
@ -1397,8 +1445,6 @@ export default {
|
|||
},
|
||||
// 图片上传
|
||||
handleChange(file, fileList) {
|
||||
console.log(file);
|
||||
console.log(fileList);
|
||||
if (this.beforeUpload(file) == false) {
|
||||
fileList.splice(fileList.length - 1, 1);
|
||||
}
|
||||
|
|
@ -1429,25 +1475,66 @@ export default {
|
|||
});
|
||||
this.fileList.splice(sum, 1);
|
||||
},
|
||||
// 保存按钮
|
||||
saveSubmit() {
|
||||
// 待报废保存按钮
|
||||
async saveSubmit() {
|
||||
this.uploadKey = Date.now();
|
||||
scrapRowData;
|
||||
if(this.fileList.length!=0){
|
||||
await this.getImaUpload(),
|
||||
await this.addWaitRepairPic(this.scrapForm);
|
||||
}else{
|
||||
await this.addWaitRepairPic(this.scrapForm);
|
||||
}
|
||||
this.scrapRowData.repairType = 3
|
||||
this.scrapRowData.codeScrapRepairPartList.push(this.scrapForm)
|
||||
|
||||
this.openScrap = false;
|
||||
this.fileList = [];
|
||||
this.reset();
|
||||
},
|
||||
// 取消按钮
|
||||
//上传文件库
|
||||
async getImaUpload(){
|
||||
this.fileListTemp = [];
|
||||
const reqData = new FormData()
|
||||
const {fileTwo} = await this.getFileData()
|
||||
let res = await imgUpLoadThree(fileTwo);
|
||||
console.log('res',res)
|
||||
if (res.code === 200) {
|
||||
res.data.forEach(item=>{
|
||||
let objTwo = { 'name': item.name, 'url': item.url,};
|
||||
this.fileListTemp.push(objTwo);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError(res.msg);
|
||||
}
|
||||
},
|
||||
|
||||
//提交时循环fileList 获取raw文件
|
||||
async getFileData() {
|
||||
const fileTwo = []
|
||||
this.fileList.forEach(item => {
|
||||
if (item?.hasOwnProperty('raw')) {
|
||||
fileTwo.push(item.raw)
|
||||
}
|
||||
})
|
||||
return { fileTwo }
|
||||
},
|
||||
|
||||
async addWaitRepairPic(scrapForm){
|
||||
this.scrapForm.fileList=this.fileListTemp
|
||||
this.openScrap = false;
|
||||
|
||||
},
|
||||
|
||||
// 待报废取消按钮
|
||||
saveCancel() {
|
||||
this.uploadKey = Date.now();
|
||||
this.openScrap = false;
|
||||
this.fileList = [];
|
||||
this.reset();
|
||||
this.fileListTemp = [];
|
||||
this.resetForm("scrapForm");
|
||||
},
|
||||
|
||||
//内部维修
|
||||
openInnerDialog(row) {
|
||||
console.log("index", row.index);
|
||||
console.log("index2", row);
|
||||
this.innerRowData = row;
|
||||
this.partTableList = [];
|
||||
if (
|
||||
|
|
@ -1558,8 +1645,6 @@ export default {
|
|||
},
|
||||
//内部维修- 弹窗保存
|
||||
saveInnerDialog() {
|
||||
console.log(this.innerRowData);
|
||||
console.log(this.partTableList);
|
||||
const isNum = this.partTableList.some(
|
||||
(item) => item.partNum == 0 || item.partNum == undefined
|
||||
);
|
||||
|
|
@ -1619,8 +1704,6 @@ export default {
|
|||
},
|
||||
//返场维修- 弹窗保存
|
||||
saveBackDialog() {
|
||||
console.log(this.backRowData);
|
||||
console.log(this.backTableList);
|
||||
if (this.backTableList.length > 0) {
|
||||
this.$refs["backForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
@ -1672,11 +1755,7 @@ export default {
|
|||
// 待报废-打开
|
||||
openScrapDialog(row) {
|
||||
this.scrapRowData = row;
|
||||
// if(this.scrapRowData.backTableList&&this.scrapRowData.backTableList.length>0){
|
||||
// this.scrapForm = this.scrapRowData.scrapForm;
|
||||
// }else{
|
||||
this.scrapForm = {};
|
||||
// }
|
||||
this.openScrap = true;
|
||||
},
|
||||
// 待报废弹窗文件上传成功处理-编码弹窗上传
|
||||
|
|
@ -1716,6 +1795,8 @@ export default {
|
|||
|
||||
//数量管理保存
|
||||
saveNumAll() {
|
||||
this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
|
||||
if(valid){
|
||||
for (let i = 0; i < this.partItems.length; i++) {
|
||||
this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
|
||||
isCharge: this.partItems[i].isCharge,
|
||||
|
|
@ -1734,24 +1815,47 @@ export default {
|
|||
repairNum: this.formMiddle.repairNum,
|
||||
});
|
||||
}
|
||||
this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push({
|
||||
scrapReason: this.formRight.scrapReason,
|
||||
scrapNum: this.formRight.scrapNum,
|
||||
scrapType: this.formRight.scrapType,
|
||||
otherReason: this.formRight.otherReason,
|
||||
})
|
||||
this.uploadKey = Date.now();
|
||||
if(this.fileList.length!=0){
|
||||
await this.getImaUpload(),
|
||||
this.formRight.fileList = this.fileListTemp;
|
||||
}else{
|
||||
this.formRight.fileList = this.fileListTemp;
|
||||
}
|
||||
console.log('this.formRight',this.formRight)
|
||||
this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
|
||||
this.innerRowData.repairDeviceList[0].repairType = 1;
|
||||
saveCodeList(this.innerRowData.repairDeviceList).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.fileList=[];
|
||||
this.fileListTemp=[];
|
||||
this.openNum=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//数量管理取消
|
||||
saveCancelAll(){
|
||||
this.fileList=[];
|
||||
this.fileListTemp=[];
|
||||
this.openNum=false;
|
||||
}
|
||||
},
|
||||
|
||||
//待维修数量限制统计
|
||||
waitRepairCount(){
|
||||
console.log('this.formLeft.repairNum',this.formLeft.repairNum)
|
||||
console.log('this.formMiddle.repairNum',this.formMiddle.repairNum)
|
||||
console.log('this.formRight.scrapNum',this.formRight.scrapNum)
|
||||
console.log('this.disrepairNumTemp',this.disrepairNumTemp)
|
||||
if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum)) >this.disrepairNumTemp){
|
||||
this.flagSave = true;
|
||||
this.$message.error("输入的数字之和大于"+this.disrepairNumTemp);
|
||||
}else{
|
||||
this.flagSave = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@
|
|||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.back_task_status"
|
||||
v-for="dict in dict.type.repair_task_status"
|
||||
v-if="dict.value == 0 || dict.value == 1 || dict.value == 2"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -60,7 +61,7 @@
|
|||
<el-button type="primary" plain size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain size="mini">提交</el-button>
|
||||
<el-button type="warning" plain size="mini" @click="handleSend">提交</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain size="mini" @click="handleReject">退回</el-button>
|
||||
|
|
@ -89,15 +90,15 @@
|
|||
<el-table-column label="创建人" align="center" prop="createName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="状态" align="center" :show-overflow-tooltip="true" prop="repairStatusCode">
|
||||
<!-- <template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.back_task_status" :value="scope.row.repairStatusCode"/>
|
||||
</template> -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.repair_task_status" :value="scope.row.repairStatusCode"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" plain icon="el-icon-zoom-in" @click="handleSee(scope.row)" >查看</el-button>
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="handleUpdate(scope.row)">维修</el-button>
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-edit" v-if="scope.row.repairStatusCode!='1'" @click="handleUpdate(scope.row)">维修</el-button>
|
||||
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleReject(scope.row)">驳回</el-button>
|
||||
<el-button size="mini" type="success" @click="handlePrint(scope.row)">维修任务单</el-button>
|
||||
</template>
|
||||
|
|
@ -341,15 +342,16 @@
|
|||
|
||||
import {
|
||||
getRepairTaskList,
|
||||
rejectRepair
|
||||
rejectRepair,
|
||||
sendList,
|
||||
} from '@/api/repair/repair.js'
|
||||
|
||||
import { getInfo, h } from '@/api/login'
|
||||
|
||||
import vueEasyPrint from "vue-easy-print";
|
||||
import vueEasyPrint from "vue-easy-print";
|
||||
export default {
|
||||
name: '',
|
||||
dicts: ['back_task_status'],
|
||||
dicts: ['repair_task_status'],
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
|
|
@ -392,6 +394,10 @@ export default {
|
|||
proList: [],
|
||||
//维修单显示
|
||||
openPrint:false,
|
||||
printData: {},
|
||||
//选择的taskId数组
|
||||
ids:[],
|
||||
taskList:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -438,12 +444,12 @@ export default {
|
|||
this.$refs.queryForm.resetFields()
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.taskId)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// // 多选框选中数据
|
||||
// handleSelectionChange(selection) {
|
||||
// this.ids = selection.map((item) => item.taskId)
|
||||
// this.single = selection.length != 1
|
||||
// this.multiple = !selection.length
|
||||
// },
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$emit('handelAdd')
|
||||
|
|
@ -479,13 +485,40 @@ export default {
|
|||
`维修任务单_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
//查看维修任务单
|
||||
//查看维修任务单
|
||||
handlePrint(row) {
|
||||
this.openPrint = true;
|
||||
this.title = "机具设备维修任务单";
|
||||
},
|
||||
//提交
|
||||
handleSend(row){
|
||||
if (this.ids.length == 0) {
|
||||
this.$alert("请至少勾选一条要提交的数据", "提示", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确定",
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
sendList(this.taskList).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("通过成功");
|
||||
}
|
||||
this.getList()
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.taskList = [];
|
||||
this.ids = selection.map((item) => item.taskId);
|
||||
selection.forEach((item) => {
|
||||
this.taskList.push({ taskId: item.taskId });
|
||||
});
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue