Merge remote-tracking branch 'origin/material-ui' into material-ui

This commit is contained in:
mashuai 2024-12-31 15:44:28 +08:00
commit 7eeb6c972f
10 changed files with 1927 additions and 4 deletions

79
src/api/code/code.js Normal file
View File

@ -0,0 +1,79 @@
import request from '@/utils/request'
//二维码列表接口
export function getQrCodeListApi(query) {
return request({
url: '/material/bm_qrcode_info/list',
method: 'get',
params: query,
})
}
//二维码-新增
export function addQrCodeApi(data) {
return request({
url: '/material/bm_qrcode_info/add',
method: 'post',
data: data,
})
}
//二维码-下载
export function downloadQrCodesApi(data) {
return request({
url: '/material/bm_qrcode_info/download',
method: 'post',
data: data,
responseType: 'blob',
})
}

View File

@ -0,0 +1,503 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="生成日期">
<el-date-picker
type="daterange"
v-model="queryTime"
range-separator="-"
style="width: 240px"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
start-placeholder="开始日期"
@change="onTimeChange"
></el-date-picker>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态" prop="bindStatus">
<el-select
v-model="queryParams.bindStatus"
placeholder="请选择状态"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="item in statusList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" :disabled="multiple" @click="handleExport">下载</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table border :data="tableList" v-loading="loading" ref="multipleTable" @selection-change="handleSelectionChange" row-key="qrId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"/>
<el-table-column label="序号" align="center" type="index">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="二维码编码" align="center" prop="qrCode" show-overflow-tooltip/>
<el-table-column label="物资名称" align="center" prop="typeName" show-overflow-tooltip/>
<el-table-column label="规格型号" align="center" prop="typeModelName" show-overflow-tooltip/>
<el-table-column label="设备犏码" align="center" prop="maCode" show-overflow-tooltip/>
<!-- <el-table-column label="二维码类型" align="center" prop="boxType" show-overflow-tooltip>
<template slot-scope="scope">
<dict-tag :options="dict.type.qr_box_type" :value="scope.row.boxType"/>
</template>
</el-table-column> -->
<el-table-column label="生产厂家" align="center" prop="supplierName" show-overflow-tooltip/>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
<el-table-column label="状态" align="center" prop="bindStatus" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.bindStatus==0">未绑定</span>
<span v-if="scope.row.bindStatus==1">已绑定</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{ row }">
<el-button size="mini" @click="handleView(row)">
查看
</el-button>
<!-- <el-button size="mini" type="danger" @click="handleNotice(row)">
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination :total="total"
v-show="total > 0"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 二维码设备新增 -->
<el-dialog title="二维码新增" :visible.sync="open" width="650px" append-to-body>
<el-form :model="dialogForm" ref="dialogForm" size="small" :rules="rules" label-width="120px" style="min-height: 350px;">
<el-form-item label="物资类型" prop="maTypeId">
<el-input
v-model="dialogForm.maTypeName"
placeholder="二维码物资类型" disabled
style="width: 100%"/>
</el-form-item>
<el-form-item label="类型规格:" prop="typeId">
<treeselect
v-model="dialogForm.typeId"
:options="equipmentTypeList" :normalizer="normalizer"
:show-count="true" style="width: 100%;" :disable-branch-nodes="true"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
placeholder="请选择二维码类型规格" @select="typeChange"
/>
</el-form-item>
<el-form-item label="生产厂家:" prop="supplierId">
<el-select
v-model="dialogForm.supplierId"
placeholder="生产厂家" style="width: 100%;"
clearable filterable
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item>
<el-form-item label="二维码数量:" prop="qrNum">
<el-input
v-model.number="dialogForm.qrNum"
placeholder="二维码数量"
type="number" min="1"
@input="checkNum()"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="备注:" prop="remark">
<el-input
v-model="dialogForm.remark"
placeholder="备注"
type="textarea" maxlength="200"
style="width: 100%"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: right">
<el-button type="primary" @click="confirmAdd"> </el-button>
<el-button @click="cancelDialog"> </el-button>
</div>
</el-dialog>
<!-- 二维码下载对话框 -->
<el-dialog title="二维码" :visible.sync="uploadOpen" width="450px" append-to-body :close-on-click-modal="false">
<div style="text-align: center" ref="codeBox">
<div class="uploadImg">
<div id="qrcode" class="qrcode" ref="codeItem"></div>
</div>
<div class="boxCode">编号{{ rowObj.qrCode }}</div>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="downloadCode"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getQrCodeListApi,addQrCodeApi,downloadQrCodesApi } from '@/api/code/code'
import { downloadFile } from '@/utils/download'
import QRCode from 'qrcodejs2';
import html2canvas from 'html2canvas';
import { getListFacturer } from '@/api/ma/supplier';
import { equipmentTypeTree } from '@/api/purchase/goodsArrived';
import qrcode from 'qrcodejs2';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: 'Home',
dicts: ['qr_box_type'],
components: { Treeselect },
data() {
return {
//
single: true,
//
multiple: true,
statusList: [{id:"",name:"全部"},{id:"0",name:"已绑定"},{id:"1",name:"未绑定"}],
total: 0, //
loading: false, //
showSearch: true, //
tableList: [], //
queryTime: [], //
selectList: [], //
//
queryParams: {
pageNum: 1,
pageSize: 10,
bindStatus: '',
endTime: '',
keyWord: '',
startTime: '',
// taskStatus: 3,
},
//
open:false,
dialogForm:{
maTypeName:null,
maTypeId:null,
typeId:null,
supplierId:null,
qrNum:null,
remark:null,
},
rules: {
maTypeId: [
{
required: true,
message: '请选择物资类型',
trigger: 'change',
},
],
typeId: [
{
required: true,
message: '请选择类型规格',
trigger: 'change',
},
],
supplierId: [
{
required: true,
message: '请选择生产厂家',
trigger: 'change',
},
],
qrNum: [
{
required: true,
message: '请输入二维码数量',
trigger: 'blur',
},
]
},
//
supplierList: [],
equipmentTypeList: [],
//
uploadOpen: false,
rowObj:{},
qrCode:""
}
},
created() {
this.getList()
this.supplierInfoList()
this.equipmentType()
},
methods: {
// change
onTimeChange(val) {
if (val.length > 0) {
const [time_1, time_2] = val
this.queryParams.startTime = time_1
this.queryParams.endTime = time_2
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
},
//
async getList() {
this.loading = true
const res = await getQrCodeListApi(this.queryParams)
this.tableList = res.rows
this.total = res.total
this.loading = false
},
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
resetQuery() {
this.$refs.multipleTable.clearSelection();
this.queryTime = []
this.resetForm('queryForm')
this.queryParams.pageNum = 1
this.queryParams.endTime = ''
this.queryParams.pageSize = 10
this.queryParams.startTime = ''
this.getList()
},
//
handleView(row) {
this.rowObj = row
this.uploadOpen = true
this.qrCode = row.qrCode
let str = row.qrCode
this.$nextTick(() => {
this.$refs.codeItem.innerHTML = ''
var qrcode = new QRCode(this.$refs.codeItem, {
text: str, //
width: 256,
height: 256,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H,
})
}, 500)
},
//
downloadCode(e) {
if (document.getElementById('qrcode').childNodes[0]) {
let element = this.$refs.codeBox
html2canvas(element).then((canvas) => {
// canvasURL
const image = canvas.toDataURL('image/png')
const alink = document.createElement('a')
alink.href = image
alink.download = this.qrCode
alink.click()
})
}
},
/** 物资厂家-下拉选 */
supplierInfoList() {
let param = {
pageNum: 1,
pageSize: 1000,
keyWord:undefined
}
getListFacturer(param).then((response) => {
this.supplierList = response.rows
})
},
/** 物资厂家-下拉选 */
supplierInfoList() {
let param = {
pageNum: 1,
pageSize: 1000,
keyWord:undefined
}
getListFacturer(param).then((response) => {
this.supplierList = response.rows
})
},
/** 机具类型 */
equipmentType() {
equipmentTypeTree({manageType:"0"}).then((response) => {//
this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (item2.children && item2.children.length > 0) {
item2.children.forEach((item3) => {
if (item3.children && item3.children.length > 0) {
item3.children.forEach((item4,index4) => {
item4.maTypeName = item3.typeName
item4.maTypeId = item3.typeId
})
}
})
}
})
}
})
})
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.typeId,
label: node.typeName,
children: node.children,
};
},
typeChange(e){
// console.log(e)
if(e.maTypeId&&e.maTypeId!=""){
this.dialogForm.typeId=e.typeId;
this.dialogForm.maTypeId=e.maTypeId;
this.dialogForm.maTypeName=e.maTypeName;
this.$refs.dialogForm.clearValidate()
}else{
this.$modal.msgError("所选类型无规格!");
setTimeout(()=>{
this.dialogForm.typeId=null;
this.dialogForm.maTypeId=null;
this.dialogForm.maTypeName=null;
},1000)
}
},
checkNum() {
this.dialogForm.qrNum=Number(String(this.dialogForm.qrNum).replace(/[^\d]/g,''))
if (this.dialogForm.qrNum <= 1) {
this.dialogForm.qrNum = 1;
}
},
//
handleAdd() {
this.open=true;
this.dialogForm={
maTypeName:null,
maTypeId:null,
typeId:null,
supplierId:null,
qrNum:null,
remark:null
},
this.resetForm('dialogForm')
},
cancelDialog(){
this.open=false;
this.resetForm('dialogForm')
},
//
confirmAdd(){
this.$refs.dialogForm.validate(async (valid) => {
if (!valid) {
return false
} else {
console.log(this.dialogForm)
const res = await addQrCodeApi(this.dialogForm)
if (res.code == 200) {
this.$message({ type: 'success', message: "新增成功" })
this.open=true;
this.resetQuery()
}
}
})
},
//
handleExport() {
console.log('数据导出')
console.log(this.selectList)
downloadQrCodesApi({qrIds:this.selectList}).then(res => {
downloadFile({ fileName: `二维码_${new Date().getTime()}.zip`, fileData: res, fileType: 'application/zip;charset=utf-8' })
this.$refs.multipleTable.clearSelection();
})
},
//
handleSelectionChange(validSelection) {
this.selectList = validSelection.map(item=>item.qrId);
this.single = validSelection.length !== 1;
this.multiple = !validSelection.length;
},
//
handleNotice(row) {
this.$confirm('是否确定删除二维码', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
let param = {
boxId:row.boxId
}
// return delQrCodeBoxApi(param);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
},
}
</script>
<style lang="scss" scoped>
// .qrcode{
// height: 300px;
// width: 300px;
// }
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.boxCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,367 @@
<template>
<div>
<el-form
:model="maForm"
ref="maForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="申请人:" prop="createBy">
<el-input
v-model="maForm.createBy"
placeholder="请输入申请人"
clearable
maxlength="50"
style="width: 240px"
disabled
/>
</el-form-item>
<el-form-item label="领料单号:" prop="repairNum">
<el-input
v-model="maForm.repairNum"
placeholder="请输入领料单号"
clearable
maxlength="50"
style="width: 240px"
disabled
/>
</el-form-item>
<el-form-item label="备注:" prop="remark">
<el-input
v-model="maForm.remark"
clearable
maxlength="200"
style="width: 240px"
disabled
/>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
:disabled="multiple"
@click="handlePassAll"
>通过</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-close"
size="mini"
:disabled="multiple"
@click="handleFailAll"
>驳回</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="equipmentList"
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/>
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="配件类型"
align="center"
prop="machineTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="配件名称"
align="center"
prop=""
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="规格型号"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="预领数量"
align="center"
prop="repairNum"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="审核状态"
align="center"
prop="status"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div v-if="scope.row.status == '0'" style="color: #e6a23c">
{{ "未审核" }}
</div>
<div v-if="scope.row.status == '1'" style="color: #67c23a">
{{ "已审核" }}
</div>
<div v-if="scope.row.status == '2'" style="color: #f56c6c">
{{ "驳回" }}
</div>
<!-- <div v-else style="color: red;"></div> -->
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
style="margin-bottom: 10px"
type="success"
v-if="scope.row.status == '0'"
@click="handlePass(scope.row)"
>通过
</el-button>
<el-button
size="mini"
type="danger"
@click="handleFail(scope.row)"
v-if="scope.row.status == '0'"
>驳回
</el-button>
<div v-if="scope.row.status != '0'">-</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="maForm.pageNum"
:limit.sync="maForm.pageSize"
@pagination="getTaskInfo"
/>
</div>
</template>
<script>
import { getAuditInfo, auditPass } from "@/api/repair/testExamine";
import { getToken } from "@/utils/auth";
export default {
name: "AddTools",
components: {
// UploadImg,
},
props: {
isEdit: {
type: Boolean,
default: () => {
return false;
},
},
queryTaskId: {
type: [String, Number],
default: () => {
return "";
},
},
queryId: {
type: [String, Number],
default: () => {
return "";
},
},
param: {
type: Object,
default: () => {
return "";
},
},
},
data() {
return {
paramTemp: {},
//ID
taskId: "",
//
loading: true,
total: 0,
//
uniteList: [],
//
projectList: [],
//
equipmentList: [],
passTemp: [],
faliTemp: [],
//
ids: [],
//
single: true,
//
multiple: true,
//
open: false,
rowData: {},
maForm: {
pageNum: 1,
pageSize: 10,
unitName: undefined,
projectName: undefined,
repairNum: undefined,
},
};
},
computed: {},
mounted() {
this.taskId = this.queryTaskId;
this.paramTemp = this.param;
this.getTaskInfo();
},
methods: {
//
selectable(row) {
if (row.status == "0") {
return true;
} else {
return false;
}
},
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.id);
selection.forEach((item) => {
this.passTemp.push({ id: item.id, status: "1",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
auditId:item.id,repairId:item.repairId,maId:item.maId, });
});
selection.forEach((item) => {
this.failTemp.push({ id: item.id, status: "2",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
auditId:item.id,repairId:item.repairId,maId:item.maId, });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
console.log(this.multiple)
},
//-
getTaskInfo() {
this.loading = true;
getAuditInfo({ taskId: this.taskId }).then((response) => {
this.maForm = this.paramTemp;
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handlePass(row) {
const param = [];
param.push({ id: row.id, status: "1",specificationType: row.specificationType,machineTypeName:row.machineTypeName,
unitName:row.unitName,repairNum:row.repairNum,repairedNum:row.repairedNum,typeId:row.typeId,taskId:row.taskId,
auditId:row.id,repairId:row.repairId,maId:row.maId, });
this.$modal
.confirm("是否确认通过所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("通过成功");
})
.catch(() => {});
},
//
handleFail(row) {
const param = [];
param.push({ id: row.id, status: "2",specificationType: row.specificationType,machineTypeName:row.machineTypeName,
unitName:row.unitName,repairNum:row.repairNum,repairedNum:row.repairedNum,typeId:row.typeId,taskId:row.taskId,
auditId:row.id,repairId:row.repairId,maId:row.maId,
});
this.$modal
.confirm("是否确认驳回所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("驳回成功");
})
.catch(() => {});
},
//
handlePassAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.passTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
}
this.getTaskInfo();
});
}
},
//
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.failTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
}
this.getTaskInfo();
});
}
},
},
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
.custom-textarea {
width: 300px;
height: 100px;
}
.accept-img {
color: #409eff;
.a-two {
margin-left: 20px;
}
}
.left-tip {
font-size: 16px;
letter-spacing: 1px;
}
</style>

View File

@ -0,0 +1,533 @@
<template>
<div>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 240px"
>
</el-date-picker>
</el-form-item>
<el-form-item label="关键字" prop="keyword">
<el-input
v-model="queryParams.keyword"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
placeholder="请选择状态"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="item in statusList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置
</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
@click="handlePassAll"
>通过
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-close"
size="mini"
@click="handleFailAll"
>驳回
</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="typeList"
row-key="id"
@selection-change="handleSelectionChange"
border
>
<!-- <el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/> -->
<el-table-column width="60" align="center" label="序号" type="index" :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"/>
<el-table-column
label="申请人"
align="center"
prop="createBy"
:show-overflow-tooltip="true"
/>
<el-table-column
label="申请时间"
align="center"
prop="createTime"
width="110px"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="申请配件"
align="center"
prop="itemType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单号"
align="center"
prop="repairNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核人"
align="center"
prop="teamName"
width="110px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
prop="taskStatus"
:show-overflow-tooltip="true"
>
<!-- <template slot-scope="scope">
<dict-tag
:options="dict.type.repair_task_status"
:value="scope.row.taskStatus"
/>
</template> -->
</el-table-column>
<el-table-column
label="备注"
align="center"
width="100"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
style="margin-bottom: 10px"
type="normal"
@click="handleView(scope.row)"
>查看
</el-button>
<el-button
size="mini"
style="margin-bottom: 10px"
type="primary"
@click="handleUpdate(scope.row)"
v-if="scope.row.status != '2'"
>审核
</el-button>
<!-- <el-button
size="mini"
type="danger"
@click="handleDeletePurchase(scope.row)"
v-if="scope.row.status == '0'"
>驳回
</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {
getListTestExamineApply,
} from "@/api/repair/testExamine";
import {
outerAudit,
} from "@/api/repair/repair";
import router from "@/router";
export default {
name: "Home",
dicts: ['repair_task_status'],
data() {
return {
//
loading: true,
loadingTwo: true,
updateTime: "",
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
statusList: [{id:"0",name:"待审核"},{id:"1",name:"已审核"},{id:"2",name:"已驳回"}],
//
typeList: [],
getListPeople: [],
configUserList: [],
phoneNumbers: [],
//
chosenUserList: [],
userList: [],
//
title: "",
//
dateRange: [],
statusDataRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
time: null, //
name: undefined,
taskStatus: "",
keyword: "",
},
form: {
remark: "",
},
//
rules: {
remark: [
{ required: true, message: "通知内容不能为空", trigger: "blur" },
],
},
openPrint: false,
open: false,
printData: {},
printTableData: [],
//
supplierStr: "",
//
leaseApplyDetails: [],
//
leaseApplyData: {},
passTemp: [],
faliTemp: [],
};
},
created() {
this.getList();
},
methods: {
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.taskId);
selection.forEach((item) => {
this.passTemp.push({ status: "1",taskId:item.taskId, });
});
selection.forEach((item) => {
this.failTemp.push({ status: "2",taskId:item.taskId, });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//
selectable(row) {
if (row.taskStatus == "10" || row.taskStatus == "6") {
return true;
} else {
return false;
}
},
getList() {
this.loading = true;
const params = {
keyword: this.queryParams.keyword,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
taskStatus: this.queryParams.taskStatus,
taskType:5,
};
getListTestExamineApply(this.addDateRange(params)).then((response) => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = [];
this.resetForm("queryForm");
this.queryParams.keyword = "";
this.handleQuery();
},
/** 通过按钮操作 */
handlePassAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
} else {
outerAudit(this.passTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
router.go(0); //
}
this.getTaskInfo();
});
}
},
/** 驳回按钮操作 */
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
} else {
outerAudit(this.failTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
router.go(0); //
}
this.getTaskInfo();
});
}
},
/** 查看按钮操作 */
handleView(row) {
this.$emit("queryTools", row.taskId, row.id, row);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$emit("addTools", row.taskId, row.id,row);
},
//----
getNowTime() {
var today = new Date();
var year = today.getFullYear(); //
var month = today.getMonth() + 1; //
var day = today.getDate(); //
return year + "-" + month + "-" + day;
},
//
reset() {
this.form = {
taskId: "",
remark: "",
};
this.resetForm("form");
},
//
getPrintTable(taskId) {
getAcceptanceForm({ taskId: taskId }).then((response) => {
this.printData = response.data;
this.printTableData = response.data.checkDetailsList;
let supplierList = [];
this.printTableData.forEach((e) => {
if (e.supplier) {
supplierList.push(e.supplier);
}
});
supplierList = [...new Set(supplierList)];
this.supplierStr = supplierList.join(",");
});
},
//
handlePrint(row) {
// this.query.taskId = row.taskId
// this.getPrintTable(row.taskId)
this.openPrint = true;
this.title = "机具设备到货验收单";
},
//
async handleLld(row) {
this.open = true;
var ids = row.id;
const res = await getApplyInfo(ids);
console.log(res);
this.leaseApplyDetails = res.data.leaseApplyDetailsList;
this.leaseApplyData = res.data.leaseApplyInfo;
console.log(this.leaseApplyData);
},
//
print() {
this.$refs.remarksPrintRef.print();
},
/** 删除按钮操作 */
handleDeletePurchase(row) {
// console.log(row)
let ids = [];
ids.push(row.id);
console.log("ids", ids);
this.$modal
.confirm("是否确认删除所选择的数据项?")
.then(function () {
return applyRemove(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/material/repair_audit_details/export",
{
...this.queryParams,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
},
`修试审核_${new Date().getTime()}.xlsx`
);
},
//
handleSend(row) {
const param = { id: row.id, taskId: row.taskId };
this.$modal
.confirm("是否确认发布所选择的数据项?")
.then(function () {
return applySend(param);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("发布成功");
})
.catch(() => {});
},
handleSendAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一个领料申请", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
applySendAll(this.sendTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("发布成功");
}
this.getList();
});
}
},
},
watch: {
$route: {
handler(to) {
if (to.query.keyword) {
this.queryParams.keyword = to.query.keyword;
}
},
deep: true,
immediate: true,
},
},
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 70px !important;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,364 @@
<template>
<div>
<el-form
:model="maForm"
ref="maForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="退料单位" prop="unitName">
<el-input
v-model="maForm.unitName"
placeholder="请输入退料单位"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<el-form-item label="工程名称" prop="projectName">
<el-input
v-model="maForm.projectName"
placeholder="请输入工程名称"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<el-form-item label="维修单号" prop="repairNum">
<el-input
v-model="maForm.repairNum"
placeholder="请输入维修单号"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="equipmentList"
row-key="id"
>
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="类型名称"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="machineTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计量单位"
align="center"
prop="unitName"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="退料数量"
align="center"
prop="repairNum"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="已修数量"
align="center"
prop="repairedNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="报废数量"
align="center"
prop="scrapNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="待修数量"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div>
{{ scope.row.repairNum - scope.row.repairedNum - scope.row.scrapNum }}
</div>
</template>
</el-table-column>
<el-table-column
label="管理模式"
align="center"
prop="alNum"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<!-- 0编码1数量 -->
<div v-if="scope.row.manageType==0">编码管理</div>
<div v-if="scope.row.manageType==1">数量管理</div>
</template>
</el-table-column>
<el-table-column
label="审核状态"
align="center"
prop="status"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div v-if="scope.row.status == '0'" style="color: #e6a23c">
{{ "未审核" }}
</div>
<div v-if="scope.row.status == '1'" style="color: #67c23a">
{{ "已审核" }}
</div>
<div v-if="scope.row.status == '2'" style="color: #f56c6c">
{{ "驳回" }}
</div>
<!-- <div v-else style="color: red;"></div> -->
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
style="margin-bottom: 10px"
type="primary"
v-if="scope.row.status == '0'"
@click="handlePass(scope.row)"
>通过
</el-button>
<el-button
size="mini"
type="danger"
@click="handleFail(scope.row)"
v-if="scope.row.status == '0'"
>驳回
</el-button>
<div v-if="scope.row.status != '0'">-</div>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="maForm.pageNum"
:limit.sync="maForm.pageSize"
@pagination="getTaskInfo"
/>
</div>
</template>
<script>
import { getAuditInfo, auditPass } from "@/api/repair/testExamine";
import { getToken } from "@/utils/auth";
export default {
name: "QueryTools",
components: {
// UploadImg,
},
props: {
isView: {
type: Boolean,
default: () => {
return false;
},
},
queryTaskId: {
type: [String, Number],
default: () => {
return "";
},
},
queryId: {
type: [String, Number],
default: () => {
return "";
},
},
param: {
type: Object,
default: () => {
return "";
},
},
},
data() {
return {
paramTemp: {},
//ID
taskId: "",
//
loading: true,
total: 0,
//
uniteList: [],
//
projectList: [],
//
equipmentList: [],
passTemp: [],
faliTemp: [],
//
ids: [],
//
single: true,
//
multiple: true,
//
open: false,
rowData: {},
maForm: {
pageNum: 1,
pageSize: 10,
unitName: undefined,
projectName: undefined,
repairNum: undefined,
},
};
},
computed: {},
mounted() {
this.taskId = this.queryTaskId;
this.paramTemp = this.param;
this.getTaskInfo();
},
methods: {
//
selectable(row) {
if (row.status == "0") {
return true;
} else {
return false;
}
},
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.id);
selection.forEach((item) => {
this.passTemp.push({ id: item.id, status: "1" });
});
selection.forEach((item) => {
this.failTemp.push({ id: item.id, status: "2" });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//-
getTaskInfo() {
this.loading = true;
getAuditInfo({ taskId: this.taskId }).then((response) => {
this.maForm = this.paramTemp;
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handlePass(row) {
const param = [];
param.push({ id: row.id, status: "1" });
this.$modal
.confirm("是否确认通过所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("通过成功");
})
.catch(() => {});
},
//
handleFail(row) {
const param = [];
param.push({ id: row.id, status: "2" });
this.$modal
.confirm("是否确认驳回所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("驳回成功");
})
.catch(() => {});
},
//
handlePassAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.passTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
}
this.getTaskInfo();
});
}
},
//
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.failTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
}
this.getTaskInfo();
});
}
},
},
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
.custom-textarea {
width: 300px;
height: 100px;
}
.accept-img {
color: #409eff;
.a-two {
margin-left: 20px;
}
}
.left-tip {
font-size: 16px;
letter-spacing: 1px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<!-- 配件领用 -->
<div class="app-container">
<PageHeaderApply
v-if="isShowComponent != 'Home'"
:pageContent="pageContent"
@goBack="goBack"
/>
<component
:is="isShowComponent"
:isEdit="isEdit"
:editTaskId="editTaskId"
:editId="editId"
:queryTaskId="queryTaskId"
:queryId="queryId"
:param="param"
:isView="isView"
:codingTaskId="codingTaskId"
@addTools="addTools"
@queryTools="queryTools"
/>
</div>
</template>
<script>
import PageHeaderApply from "@/components/pageHeaderApply";
import Home from "./component/homeApply.vue"; //
import AddTools from "./component/addToolsApply.vue"; //
import QueryTools from "./component/queryToolsApply.vue"; //
export default {
components: {
Home,
PageHeaderApply,
AddTools,
QueryTools,
},
data() {
return {
isShowComponent: "Home",
pageContent: "",
isEdit: false,
editTaskId: "",
editId: "",
queryId: "",
queryTaskId: "",
param: {},
isView: false,
codingTaskId: "",
};
},
methods: {
/* 编辑 */
addTools(taskId, id,row) {
this.isEdit = true;
this.pageContent = "审核";
this.queryTaskId = taskId;
this.queryId = id;
this.param = row;
this.isShowComponent = "AddTools";
},
/* 查询 */
queryTools(taskId, id, row) {
this.isView = true;
this.pageContent = "详情信息";
this.queryTaskId = taskId;
this.queryId = id;
this.param = row;
this.isShowComponent = "QueryTools";
},
/* 返回按钮 */
goBack() {
this.isShowComponent = "Home";
},
},
};
</script>

View File

@ -646,7 +646,7 @@
</el-col>
<el-col :span="4">
<div style="font-weight: 600;">
物资名称 {{ typeTemp }}
规格型号 {{ typeTemp }}
</div>
</el-col>
<el-col :span="4">

View File

@ -81,13 +81,13 @@
<el-table-column
label="类型名称"
align="center"
prop="specificationType"
prop="machineTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="machineTypeName"
prop="specificationType"
:show-overflow-tooltip="true"
/>
<el-table-column

View File

@ -114,7 +114,7 @@
align="center"
:selectable="selectable"
/>
<el-table-column width="60" align="center" label="序号" type="index" />
<el-table-column width="60" align="center" label="序号" type="index" :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"/>
<el-table-column
align="center"