Merge branch 'dev-sy-11-8' into material-ui

This commit is contained in:
BianLzhaoMin 2024-11-08 17:45:49 +08:00
commit 543f3ce2d1
13 changed files with 2213 additions and 2224 deletions

View File

@ -1,100 +1,94 @@
import request from '@/utils/request'
//机具类型管理列表信息
export function getListNewBuyBind(query) {
return request({
url: '/material/purchase/bind/list',
method: 'get',
params: query,
})
/**
* 获取新购待绑定列表数据
*/
export function getNewBuyBindListApi(query) {
return request({
url: '/material/purchase_check_info/list',
method: 'get',
params: query,
})
}
//任务 详情
export function getListDetail(query) {
return request({
url: '/material/purchase/bind/details',
method: 'get',
params: query,
})
/**
* 获取新购待绑定列表详情
*/
export function getNewBuyBindListDetailsApi(query) {
return request({
url: '/material/purchase_check_info/getInfo',
method: 'get',
params: query,
})
}
//任务 详情
export function bindAllData(data) {
return request({
url: '/material/purchase/bind/bind',
method: 'post',
data: data,
})
return request({
url: '/material/purchase/bind/bind',
method: 'post',
data: data,
})
}
//二级页面 详情
export function getListDetailById(query) {
return request({
url: '/material/purchase/bind/getById',
method: 'get',
params: query,
})
return request({
url: '/material/purchase/bind/getById',
method: 'get',
params: query,
})
}
// 导出
export function exportNewBuy(data) {
return request({
url: '/material/purchase/bind/downloadQrCode',
method: 'post',
responseType: 'blob',
data: data
})
return request({
url: '/material/purchase/bind/downloadQrCode',
method: 'post',
responseType: 'blob',
data: data,
})
}
//人员 详情
export function getNoticePeople(query) {
return request({
url: '/material/purchase_notice_person/list',
method: 'get',
params: query,
})
return request({
url: '/material/purchase_notice_person/list',
method: 'get',
params: query,
})
}
// 人员--删除
export function delPeople(ids) {
return request({
url: '/material/purchase_notice_person/' + ids,
method: 'delete',
})
return request({
url: '/material/purchase_notice_person/' + ids,
method: 'delete',
})
}
// 人员管理--新增
export function addNoticeUser(data) {
return request({
url: '/material/purchase_notice_person/batchAddNoticePerson',
method: 'post',
data: data,
})
return request({
url: '/material/purchase_notice_person/batchAddNoticePerson',
method: 'post',
data: data,
})
}
// 仓库管理--修改
export function bmNoticeInfo(data) {
return request({
url: '/material/purchase_notice_person/batchSendSms',
method: 'put',
data: data,
})
return request({
url: '/material/purchase_notice_person/batchSendSms',
method: 'put',
data: data,
})
}
//机具类型管理列表信息
export function getUserAll() {
return request({
url: '/system/user/list',
method: 'get',
})
return request({
url: '/system/user/list',
method: 'get',
})
}

View File

@ -0,0 +1 @@
<svg t="1731053426545" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2855" width="200" height="200"><path d="M875.32 149.699c-27.217-27.18-63.372-42.142-101.831-42.142h-0.105c-31.462 0.027-61.359 10.016-86.457 28.887l-1.16 0.87-161.647 161.88-0.14 0.14c-27.672 28.254-42.905 64.094-42.89 100.94 0.027 20.042 4.086 39.436 12.063 57.64a0.262 0.262 0 0 0 0.012 0.025l0.009 0.022a141.288 141.288 0 0 0 2.372 5.152l36.82-17.882a98.08 98.08 0 0 1-1.686-3.664l-18.8 8.19 18.78-8.237c-5.712-13.022-8.617-26.917-8.636-41.283-0.01-26.017 11.047-51.654 31.136-72.196l159.48-159.706c17.729-12.97 38.715-19.827 60.78-19.846h0.075c27.53 0 53.419 10.714 72.904 30.173 19.503 19.477 30.253 45.38 30.272 72.944 0.02 22.075-6.81 43.067-19.761 60.8L708.683 460.838l-0.867 1.155c-19.7 26.249-49.78 41.321-82.528 41.35h-0.073c-14.315 0-28.162-2.872-41.161-8.536l-16.352 37.524c18.187 7.926 37.535 11.944 57.515 11.944h0.102c22.722-0.02 45.358-5.47 65.464-15.76 18.984-9.718 35.85-23.79 48.865-40.757l148.308-148.516 0.867-1.153c18.855-25.117 28.806-55.035 28.778-86.513-0.026-38.494-15.042-74.674-42.28-101.877zM254.521 915.475c-38.46 0.001-74.616-14.961-101.833-42.141-27.241-27.204-42.256-63.383-42.28-101.876-0.027-36.83 15.202-72.67 42.883-100.917l0.135-0.137 161.659-161.888 1.157-0.871c25.088-18.871 54.982-28.86 86.45-28.888h0.102c20 0 39.357 4.029 57.544 11.975L443.95 528.24c-12.987-5.674-26.832-8.55-41.153-8.55h-0.073c-22.067 0.019-43.048 6.876-60.766 19.842L182.463 699.254c-20.09 20.53-31.142 46.16-31.124 72.177 0.018 27.56 10.768 53.462 30.272 72.939 19.486 19.459 45.376 30.172 72.906 30.172h0.075c32.762-0.03 62.842-15.1 82.525-41.345l0.87-1.159L486.22 683.609c12.947-17.75 19.778-38.745 19.769-60.814-0.02-14.372-2.919-28.247-8.612-41.216l37.481-16.453c7.976 18.17 12.034 37.56 12.063 57.633 0.012 31.482-9.937 61.39-28.773 86.518l-0.871 1.16-148.323 148.518c-13.008 16.967-29.873 31.041-48.862 40.76-20.105 10.29-42.745 15.74-65.468 15.76h-0.104zM610.72 385.692l28.963 28.922-222.397 222.712-28.963-28.922L610.72 385.692z" fill="#f59a44" p-id="2856"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
<svg t="1731052815351" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2822" width="200" height="200"><path d="M421.639981 0H43.809703A43.943391 43.943391 0 0 0 0 43.809703v377.830278a43.943391 43.943391 0 0 0 43.809703 43.742859h377.830278a43.943391 43.943391 0 0 0 43.809703-43.809703V43.809703A43.943391 43.943391 0 0 0 421.639981 0z m-49.27756 372.362421H93.087263V93.087263h279.275158zM980.176928 0H602.34665a43.930022 43.930022 0 0 0-43.809703 43.809703v377.830278a43.930022 43.930022 0 0 0 43.809703 43.742859h377.830278A43.943391 43.943391 0 0 0 1024.053475 421.639981V43.809703A43.943391 43.943391 0 0 0 980.176928 0z m-49.27756 372.362421H651.637579V93.087263h279.261789zM421.639981 558.536947H43.809703A43.930022 43.930022 0 0 0 0 602.34665v377.843647a43.943391 43.943391 0 0 0 43.809703 43.809703h377.830278a43.943391 43.943391 0 0 0 43.809703-43.809703V602.34665a43.930022 43.930022 0 0 0-43.809703-43.809703z m-49.27756 372.362421H93.087263v-279.275158h279.275158z" fill="#1afa29" p-id="2823"></path><path d="M930.899368 1023.986631h49.27756A43.943391 43.943391 0 0 0 1024.053475 980.176928v-49.27756h-93.154107zM744.711473 930.899368h93.087263v93.087263h-93.087263z" fill="#1afa29" p-id="2824"></path><path d="M980.176928 558.536947h-49.27756v186.174526h-93.087263V558.536947H602.34665a43.930022 43.930022 0 0 0-43.809703 43.809703v377.843647a43.930022 43.930022 0 0 0 43.809703 43.809703h49.290929V744.711473h93.087263v93.087263H1024.053475V602.34665a43.930022 43.930022 0 0 0-43.809702-43.809703z m0 0" fill="#1afa29" p-id="2825"></path><path d="M175.225443 791.261789a57.486031 57.486031 0 1 0 28.743015-49.798945 57.486031 57.486031 0 0 0-28.743015 49.798945z m0 0M175.225443 232.764949a57.486031 57.486031 0 1 0 28.743015-49.798946 57.486031 57.486031 0 0 0-28.743015 49.798946z m0 0M733.76239 232.764949a57.486031 57.486031 0 1 0 28.743015-49.798946 57.486031 57.486031 0 0 0-28.743015 49.798946z m0 0" fill="#1afa29" p-id="2826"></path></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,89 +1,110 @@
<template>
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span
v-if="(item.raw.listClass == 'default' || item.raw.listClass == '') && (item.raw.cssClass == '' || item.raw.cssClass == null)"
:key="item.value"
:index="index"
:class="item.raw.cssClass"
>{{ item.label + ' ' }}</span
>
<el-tag
v-else
:disable-transitions="true"
:key="item.value"
:index="index"
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
:class="item.raw.cssClass"
>
{{ item.label + ' ' }}
</el-tag>
</template>
</template>
<template v-if="unmatch && showValue">
{{ unmatchArray | handleArray }}
</template>
</div>
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span
v-if="
(item.raw.listClass == 'default' ||
item.raw.listClass == '') &&
(item.raw.cssClass == '' || item.raw.cssClass == null)
"
:key="item.value"
:index="index"
:class="item.raw.cssClass"
>{{ item.label + ' ' }}</span
>
<el-tag
v-else
:disable-transitions="true"
:key="item.value"
:index="index"
:type="
item.raw.listClass == 'primary'
? ''
: item.raw.listClass
"
:class="item.raw.cssClass"
size="mini"
>
{{ item.label + ' ' }}
</el-tag>
</template>
</template>
<template v-if="unmatch && showValue">
{{ unmatchArray | handleArray }}
</template>
</div>
</template>
<script>
export default {
name: "DictTag",
props: {
options: {
type: Array,
default: null,
name: 'DictTag',
props: {
options: {
type: Array,
default: null,
},
value: [Number, String, Array],
// value
showValue: {
type: Boolean,
default: true,
},
separator: {
type: String,
default: ',',
},
},
value: [Number, String, Array],
// value
showValue: {
type: Boolean,
default: true,
},
separator: {
type: String,
default: ","
}
},
data() {
return {
unmatchArray: [], //
}
},
computed: {
values() {
if (this.value === null || typeof this.value === 'undefined' || this.value === '') return []
return Array.isArray(this.value) ? this.value.map(item => '' + item) : String(this.value).split(this.separator)
},
unmatch() {
this.unmatchArray = []
// value
if (this.value === null || typeof this.value === 'undefined' || this.value === '' || this.options.length === 0) return false
//
let unmatch = false //
this.values.forEach(item => {
if (!this.options.some(v => v.value === item)) {
this.unmatchArray.push(item)
unmatch = true // true
data() {
return {
unmatchArray: [], //
}
})
return unmatch //
},
},
filters: {
handleArray(array) {
if (array.length === 0) return '';
return array.reduce((pre, cur) => {
return pre + ' ' + cur;
})
computed: {
values() {
if (
this.value === null ||
typeof this.value === 'undefined' ||
this.value === ''
)
return []
return Array.isArray(this.value)
? this.value.map((item) => '' + item)
: String(this.value).split(this.separator)
},
unmatch() {
this.unmatchArray = []
// value
if (
this.value === null ||
typeof this.value === 'undefined' ||
this.value === '' ||
this.options.length === 0
)
return false
//
let unmatch = false //
this.values.forEach((item) => {
if (!this.options.some((v) => v.value === item)) {
this.unmatchArray.push(item)
unmatch = true // true
}
})
return unmatch //
},
},
}
};
filters: {
handleArray(array) {
if (array.length === 0) return ''
return array.reduce((pre, cur) => {
return pre + ' ' + cur
})
},
},
}
</script>
<style scoped>
.el-tag + .el-tag {
margin-left: 10px;
margin-left: 10px;
}
</style>

View File

@ -1,83 +1,85 @@
import { Message, MessageBox, Notification, Loading } from 'element-ui'
let loadingInstance;
let loadingInstance
export default {
// 消息提示
msg(content) {
Message.info(content)
},
// 错误消息
msgError(content) {
Message.error(content)
},
// 成功消息
msgSuccess(content) {
Message.success(content)
},
// 警告消息
msgWarning(content) {
Message.warning(content)
},
// 弹出提示
alert(content) {
MessageBox.alert(content, "系统提示")
},
// 错误提示
alertError(content) {
MessageBox.alert(content, "系统提示", { type: 'error' })
},
// 成功提示
alertSuccess(content) {
MessageBox.alert(content, "系统提示", { type: 'success' })
},
// 警告提示
alertWarning(content) {
MessageBox.alert(content, "系统提示", { type: 'warning' })
},
// 通知提示
notify(content) {
Notification.info(content)
},
// 错误通知
notifyError(content) {
Notification.error(content);
},
// 成功通知
notifySuccess(content) {
Notification.success(content)
},
// 警告通知
notifyWarning(content) {
Notification.warning(content)
},
// 确认窗体
confirm(content) {
return MessageBox.confirm(content, "系统提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
})
},
// 提交内容
prompt(content) {
return MessageBox.prompt(content, "系统提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
})
},
// 打开遮罩层
loading(content) {
loadingInstance = Loading.service({
lock: true,
text: content,
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
})
},
// 关闭遮罩层
closeLoading() {
loadingInstance.close();
}
// 消息提示
msg(content) {
Message.info(content)
},
// 错误消息
msgError(content) {
Message.closeAll()
Message.error(content)
},
// 成功消息
msgSuccess(content) {
Message.closeAll()
Message.success(content)
},
// 警告消息
msgWarning(content) {
Message.warning(content)
},
// 弹出提示
alert(content) {
MessageBox.alert(content, '系统提示')
},
// 错误提示
alertError(content) {
MessageBox.alert(content, '系统提示', { type: 'error' })
},
// 成功提示
alertSuccess(content) {
MessageBox.alert(content, '系统提示', { type: 'success' })
},
// 警告提示
alertWarning(content) {
MessageBox.alert(content, '系统提示', { type: 'warning' })
},
// 通知提示
notify(content) {
Notification.info(content)
},
// 错误通知
notifyError(content) {
Notification.error(content)
},
// 成功通知
notifySuccess(content) {
Notification.success(content)
},
// 警告通知
notifyWarning(content) {
Notification.warning(content)
},
// 确认窗体
confirm(content) {
return MessageBox.confirm(content, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
},
// 提交内容
prompt(content) {
return MessageBox.prompt(content, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
},
// 打开遮罩层
loading(content) {
loadingInstance = Loading.service({
lock: true,
text: content,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
},
// 关闭遮罩层
closeLoading() {
loadingInstance.close()
},
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
<template>
<!-- 新购验收绑定主页列表 -->
<div>
<el-form
:model="queryParams"
@ -6,38 +7,39 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="50px"
label-width="100px"
>
<el-form-item label="日期">
<el-form-item label="日期">
<el-date-picker
v-model="queryParams.dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
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="status" label-width="100px">
<el-form-item label="设备状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择设备状态"
clearable
filterable
style="width: 240px"
placeholder="请选择设备状态"
v-model="queryParams.status"
>
<el-option
v-for="typeItem in typesList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.purchase_task_status"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord" label-width="100px">
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
@ -83,493 +85,209 @@
</el-row>
<el-table
v-loading="loading"
:data="bindList"
@selection-change="handleSelectionChange"
border
:data="bindList"
v-loading="loading"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
label="序号"
type="index"
/>
<el-table-column align="center" label="序号" type="index" />
<el-table-column
align="center"
label="到货时间"
prop="arrivalTime"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="采购单号"
align="center"
prop="purchaseCode"
:show-overflow-tooltip="true"
prop="code"
show-overflow-tooltip
/>
<el-table-column
label="采购物资"
align="center"
prop="purchaseMaterial"
:show-overflow-tooltip="true"
prop="purchaseMaTypeName"
show-overflow-tooltip
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
:show-overflow-tooltip="true"
prop="purchaseMaNumber"
show-overflow-tooltip
/>
<el-table-column
label="创建人"
align="center"
prop="createBy"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="状态"
align="center"
prop="statusName"
:show-overflow-tooltip="true"
>
<el-table-column label="状态" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">
<dict-tag
:value="row.taskStatus"
:options="dict.type.purchase_task_status"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="scope">
<template slot-scope="{ row }">
<el-button
plain
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
@click="handleView(row)"
>查看</el-button
>
<el-button
plain
size="mini"
type="warning"
icon="el-icon-paperclip"
@click="handleBind(scope.row)"
v-hasPermi="['newPurchase:tools:edit']"
>编码绑定</el-button
@click="handleBind(row)"
>
<svg-icon icon-class="bind-icon" />
编码绑定
</el-button>
<el-button
plain
size="mini"
type="danger"
icon="el-icon-close"
@click="handleNotice(scope.row)"
v-if="scope.row.statusName != '已驳回'"
@click="handleNotice(row)"
>驳回</el-button
>
>
<el-button
plain
size="mini"
type="success"
icon="success"
@click="handleBindQr(scope.row)"
>二维码绑定</el-button
@click="onDownloadQr(row)"
>
<svg-icon icon-class="qr-icon" />
下载
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-show="total > 0"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 新购查看弹窗 -->
<el-dialog :title="titleBind" :visible.sync="showBind" width="1000px" append-to-body >
<el-form :model="queryBind" ref="queryFormBind" size="small" :inline="true" v-show="showSearch" label-width="68px">
</el-form>
<el-table v-loading="loadingTwo" :data="getListBind" width="800px" height = "600px" >
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryBind.pageNum - 1) * queryBind.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="类型名称" align="center" prop="materialName" sortable/>
<el-table-column label="规格型号" align="center" prop="materialModel" sortable/>
<el-table-column label="设备编码" align="center" prop="maCode" sortable/>
<el-table-column label="绑定人员" align="center" prop="createBy" sortable/>
<el-table-column label="绑定时间" align="center" prop="createTime" sortable/>
<el-table-column label="出厂编号" align="center" prop="outFacCode" sortable/>
<el-table-column label="出厂时间" align="center" prop="productDate" sortable/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryBind.pageNum"
:limit.sync="queryBind.pageSize"
@pagination="getListBind"
/>
</el-dialog>
</div>
</template>
<script>
import {
getListNewBuy,
getPurchaseCheckInfo,
getAcceptanceForm,
purchaseCheckInfoRemove,
getNoticePeople,
getUserAll,
addNoticeUser,
bmNoticeInfo,
} from '@/api/purchase/goodsArrived'
import {
getListNewBuyBind,
getListDetail,
} from '@/api/purchase/goodsBind'
// import {
// getRepairedList,
// getRepairedDetailList,
// inputByType,
// getTypeList,
// } from '@/api/store/warehousing'
// import vueEasyPrint from 'vue-easy-print'
// import { getLeaseAuditListAll } from '@/api/claimAndRefund/receive'
import { getNewBuyBindListApi } from '@/api/purchase/goodsBind'
export default {
name: 'Home',
// dicts: ['sys_normal_disable'],
// components: { vueEasyPrint },
dicts: ['purchase_task_status'],
data() {
return {
//
loading: true,
loadingTwo: true,
updateTime:"",
//
dateRange: [],
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
showBind: false,
peopleOpen: false,
//
total: 0,
totalTwo: 0,
//
typesList: [],
modelList: [],
//
bindList: [],
getListBind:[],
configUserList: [],
phoneNumbers:[],
//
chosenUserList: [],
userList: [],
//
title: '',
titleBind: '',
//
dateRange: [],
//
total: 0, //
loading: true, //
showSearch: true, //
bindList: [], //
queryTime: [], //
selectList: [], //
//
queryParams: {
pageNum: 1,
pageSize: 10,
time: null, //
name: undefined,
typeId: '',
status: '',
endTime: '',
keyWord: '',
startTime: '',
taskStatus: 3,
},
queryBind: {
pageNum: 1,
pageSize: 10,
},
openPrint: false,
printData: {},
printTableData: [],
//
supplierStr: '',
}
},
created() {
this.getList()
// this.getTypeList()
},
methods: {
// -
handleSelectionUser(selection) {
// console.log(selection)
this.chosenUserList = selection
},
// getTypeList() {
// getTypeList({ level: '3' }).then((response) => {
// this.typesList = response.data
// })
// getTypeList({ level: '4' }).then((response) => {
// this.modelList = response.data
// })
// },
getList() {
this.loading = true
const params = {
keyWord: this.queryParams.keyWord,
startTime: this.queryParams.dateRange && this.queryParams.dateRange[0],
endTime: this.queryParams.dateRange && this.queryParams.dateRange[1],
status: this.queryParams.status,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
// 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 = ''
}
getListNewBuyBind(this.addDateRange(params)).then(
(response) => {
this.bindList = response.rows
this.total = response.total
this.loading = false
},
)
},
/** 搜索按钮操作 */
//
async getList() {
this.loading = true
const res = await getNewBuyBindListApi(this.queryParams)
this.bindList = res.rows
this.total = res.total
this.loading = false
},
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
//
resetQuery() {
this.queryParams.time = []
this.queryTime = []
this.resetForm('queryForm')
this.queryParams.keyWord = ''
this.handleQuery()
this.queryParams.pageNum = 1
this.queryParams.endTime = ''
this.queryParams.pageSize = 10
this.queryParams.startTime = ''
this.getList()
},
// /** */
// handleAdd() {
// this.$emit('addTools')
// },
/** 查看按钮操作 */
//
handleView(row) {
this.loadingTwo = true;
getListDetail({taskId: row.taskId}).then((response) => {
this.getListBind = response.rows;
this.showBind = true
this.titleBind = "查看"
this.loadingTwo = false
})
this.$emit('openBindTools', row.taskId, row.id, 1)
},
/** 编码绑定按钮操作 */
//
handleBind(row) {
this.$emit('bindTools', row.taskId)
this.$emit('openBindTools', row.taskId, row.id, 2)
},
/** 编码绑定按钮操作 */
handleBindQr(row) {
this.$emit('bindQrTools', row.taskId)
},
//----
getNowTime() {
var today = new Date()
var year = today.getFullYear() //
var month = today.getMonth() + 1 //
var day = today.getDate() //
return year + '-' + month + '-' + day
},
handleNotice(row){
this.reset()
this.showBind = true;
const taskId = row.taskId;
getNoticePeople({taskId: taskId}).then((response) => {
this.getListBind = response.rows;
this.showBind = true
this.loadingTwo = false
this.title = '通知'
//
handleNotice(row) {
this.$confirm('是否确定驳回', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
},
addUserOpen() {
this.getAllUserList()
this.peopleOpen = true
},
//
configNotice() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.configUserList.forEach((item, index) => {
item.telphone = item.telphone
item.remark = this.form.remark
this.phoneNumbers.push(item.telphone)
})
let param = {
phoneNumbers: this.phoneNumbers,
content: this.form.remark,
}
if (this.configUserList.length > 0) {
bmNoticeInfo(param).then((response) => {
console.log(response)
if (response.code == 200) {
this.$message({
message: '操作成功',
type: 'success',
})
this.noticeOpen = false
this.getTaskInfo()
}
})
} else {
this.$message({
message: '请选择通知人员!',
type: 'error',
})
}
}
})
},
//
cancel() {
this.showBind = false;
this.reset();
},
//
reset() {
this.form = {};
this.resetForm("form");
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.taskId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 验收按钮 */
handleAccept(row) {
// let query = { taskId: row.taskId }
// this.$tab.closeOpenPage({
// path: '/store/newBuy/newDevicesAccept',
// query,
// })
this.$emit('acceptTools', row.taskId)
},
//
handleCode(row) {
// let query = { taskId: row.taskId }
// this.$tab
// .closeOpenPage({
// path: '/store/newBuy/newDevicesCode',
// query,
// })
// .then(() => {
// this.$tab.refreshPage()
// })
this.$emit('codingTools', row.taskId)
},
//
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 = '机具设备到货验收单'
},
//
print() {
this.$refs.remarksPrintRef.print()
},
/** 删除按钮操作 */
handleDelete(row) {
// console.log(row)
const taskIds = row.taskId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return purchaseCheckInfoRemove(taskIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.then(() => {})
.catch(() => {})
},
handleDeletePeople(row){
const ids = row.id
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return deletePeople(ids)
})
.then(() => {
this.handleNotice(row)
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
//
onDownloadQr() {
console.log('二维码下载')
},
},
/** 导出按钮操作 */
//
handleExport() {
this.download(
'material/purchase_check_info/export',
{
...this.queryParams,
},
`新购工机具验收_${new Date().getTime()}.xlsx`,
)
console.log('数据导出')
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
}
},
deep: true,
immediate: true,
//
handleSelectionChange(list) {
this.selectList = list
},
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 70px !important;
margin-bottom: 10px;
}
</style>

View File

@ -1,79 +1,65 @@
<template>
<!-- 新购验收绑定 -->
<div class="app-container">
<PageHeader
v-if="isShowComponent != 'Home'"
:pageContent="pageContent"
@goBack="goBack"
/>
<component
:is="isShowComponent"
:isEdit="isEdit"
:editTaskId="editTaskId"
:queryTaskId="queryTaskId"
:isView="isView"
:codingTaskId="codingTaskId"
@bindTools="bindTools"
@bindQrTools="bindQrTools"
@addToolsSuccess="addToolsSuccess"
/>
</div>
<!-- 新购验收绑定 -->
<div class="app-container">
<PageHeader
@goBack="goBack"
:pageContent="pageContent"
v-if="isShowComponent != 'Home'"
/>
<keep-alive include="Home">
<component
:queryId="queryId"
:is="isShowComponent"
:queryType="queryType"
:queryTaskId="queryTaskId"
@openBindTools="openBindTools"
/>
</keep-alive>
</div>
</template>
<script>
import PageHeader from "@/components/pageHeader";
import Home from "./component/home.vue"; //
import BindTools from './component/bindTools.vue' //
import BindQrTools from './component/bindQrTools.vue' //
import Home from './component/home.vue' //
import PageHeader from '@/components/pageHeader'
import BindTools from './component/bindTools.vue' //
export default {
components: {
Home,
PageHeader,
BindTools,
BindQrTools,
},
data() {
return {
isShowComponent: "Home",
pageContent: "新增机具",
isEdit: false,
editTaskId: "",
queryTaskId: "",
isView: false,
codingTaskId: "",
};
},
methods: {
/* 编码绑定 */
bindTools(taskId) {
this.editTaskId = taskId
this.queryTaskId = ''
this.pageContent = '编码绑定'
this.isShowComponent = 'BindTools'
},
/* 新增成功 */
addToolsSuccess() {
this.isShowComponent = 'Home'
},
/* 二维码绑定 */
bindQrTools(taskId) {
this.pageContent = '二维码绑定'
this.editTaskId = taskId
this.isShowComponent = 'BindQrTools'
},
/* 编辑工机具 */
editTools(id) {
this.isEdit = true
this.pageContent = '编辑机具'
this.editTaskId = id
this.isShowComponent = 'BindTools'
},
/* 返回按钮 */
goBack() {
this.isShowComponent = "Home";
components: {
Home,
BindTools,
PageHeader,
},
},
};
</script>
data() {
return {
queryType: '', //
pageContent: '', //
queryTaskId: '', // taskId
queryId: '', // id
isShowComponent: 'Home',
}
},
methods: {
//
openBindTools(taskId, id, type) {
this.queryId = id
this.queryType = type
this.queryTaskId = taskId
if (type === 1) {
//
this.pageContent = '查看'
this.isShowComponent = 'BindTools'
}
if (type === 2) {
//
this.pageContent = '编码绑定'
this.isShowComponent = 'BindTools'
}
},
//
goBack() {
this.isShowComponent = 'Home'
},
},
}
</script>

View File

@ -1,454 +1,562 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item prop="dateRange">
<el-date-picker
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键词"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
/>
</el-form-item>
<el-form-item prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择任务状态" clearable>
<el-option
v-for="item in taskStatusList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item prop="dateRange">
<el-date-picker
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键词"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
/>
</el-form-item>
<el-form-item prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
placeholder="请选择任务状态"
clearable
>
<el-option
v-for="item in taskStatusList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</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
size="mini"
:disabled="multiple"
@click="acceptancePurchase"
>
入库
</el-button>
</el-col>
<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
size="mini"
:disabled="multiple"
@click="acceptancePurchase"
>
入库
</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>
</el-row>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="tableList"
ref="multipleTable"
row-key="teamId"
@selection-change="handleSelectionChange"
border
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
/>
<el-table-column
label="序号"
align="center"
width="80"
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="arrivalTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购单号"
align="center"
prop="code"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购物资"
align="center"
prop="purchaseMaTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseMaNumber"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元含税)"
align="center"
prop="purchaseTaxPrice"
width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元不含税)"
align="center"
prop="purchasePrice"
width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="税率"
align="center"
prop="taxRate"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物资厂家"
align="center"
prop="supplier"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作人"
align="center"
prop="createBy"
: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">
<span v-if="scope.row.taskStatus == 0">待提交</span>
<span v-if="scope.row.taskStatus == 1">待通知</span>
<span v-if="scope.row.taskStatus == 2">待验收</span>
<span v-if="scope.row.taskStatus == 3">待绑定</span>
<span v-if="scope.row.taskStatus == 4">待入库</span>
<span v-if="scope.row.taskStatus == 5">已完成</span>
<span v-if="scope.row.taskStatus == 6">驳回待验收</span>
<span v-if="scope.row.taskStatus == 7">驳回待绑定</span>
<span v-if="scope.row.taskStatus == 8">驳回待入库</span>
<span v-if="scope.row.taskStatus == 9">入库进行中</span>
<span v-if="scope.row.taskStatus == 10">未完成</span>
<!-- <span v-else>/</span> -->
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button size="mini" @click="handleView(scope.row)">
查看
</el-button>
<el-button
size="mini"
type="primary"
@click="handleUpdate(scope.row)"
>
入库
</el-button>
<el-button
size="mini"
type="warning"
@click="handlePrint(scope.row)"
>
入库单
</el-button>
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="teamId" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="序号" align="center" width="80" 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="arrivalTime" :show-overflow-tooltip="true"/>
<el-table-column label="采购单号" align="center" prop="code" :show-overflow-tooltip="true"/>
<el-table-column label="采购物资" align="center" prop="purchaseMaTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="采购数量" align="center" prop="purchaseMaNumber" :show-overflow-tooltip="true"/>
<el-table-column label="采购价格(元含税)" align="center" prop="purchaseTaxPrice" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="采购价格(元不含税)" align="center" prop="purchasePrice" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="税率" align="center" prop="taxRate" :show-overflow-tooltip="true"/>
<el-table-column label="物资厂家" align="center" prop="supplier" :show-overflow-tooltip="true"/>
<el-table-column label="操作人" align="center" prop="createBy" :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">
<span v-if="scope.row.taskStatus==0">待提交</span>
<span v-if="scope.row.taskStatus==1">待通知</span>
<span v-if="scope.row.taskStatus==2">待验收</span>
<span v-if="scope.row.taskStatus==3">待绑定</span>
<span v-if="scope.row.taskStatus==4">待入库</span>
<span v-if="scope.row.taskStatus==5">已完成</span>
<span v-if="scope.row.taskStatus==6">驳回待验收</span>
<span v-if="scope.row.taskStatus==7">驳回待绑定</span>
<span v-if="scope.row.taskStatus==8">驳回待入库</span>
<span v-if="scope.row.taskStatus==9">入库进行中</span>
<span v-if="scope.row.taskStatus==10">未完成</span>
<!-- <span v-else>/</span> -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 验收单弹窗 -->
<el-dialog
:title="title"
:visible.sync="openPrint"
width="1100px"
append-to-body
>
<div style="height: 500px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div
class="title"
style="
text-align: center;
font-weight: 600;
font-size: 16px;
"
>
机具设备到货验收单
</div>
<div
class="info"
style="margin-top: 10px; display: flex; flex-wrap: wrap"
>
<div
class="item"
style="
width: 100%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>单据编号{{ printData.code }}</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span
>生产厂家供应商{{
printData.supplierName
}}</span
>
</div>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleView(scope.row)"
>
查看
</el-button>
<el-button
size="mini"
type="primary"
@click="handleUpdate(scope.row)"
>
入库
</el-button>
<el-button
size="mini"
type="warning"
@click="handlePrint(scope.row)"
>
入库单
</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"
/>
<!-- 验收单弹窗 -->
<el-dialog
:title="title"
:visible.sync="openPrint"
width="1100px"
append-to-body
>
<div style="height: 500px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div
class="title"
style="
text-align: center;
font-weight: 600;
font-size: 16px;
"
>
机具设备到货验收单
</div>
<div
class="info"
style="margin-top: 10px; display: flex; flex-wrap: wrap"
>
<div
class="item"
style="
width: 100%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>单据编号{{printData.code}}</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>生产厂家供应商{{printData.supplierName}}</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>到货日期{{printData.arrivalDate}}</span>
</div>
</div>
<el-table
:data="printTableData"
class="table"
style="
margin-top: 20px;
width: 1000px;
padding-bottom: 1px;
"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column
label="序号"
align="center"
type="index"
row=2
/>
<el-table-column
label="物资名称"
align="center"
prop="maTypeName"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeName"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
/>
<el-table-column label="配送信息" align="center">
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>到货日期{{ printData.arrivalDate }}</span>
</div>
</div>
<el-table
:data="printTableData"
class="table"
style="
margin-top: 20px;
width: 1000px;
padding-bottom: 1px;
"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
/>
<el-table-column
label="验收结论"
align="center"
prop="checkResult"
/>
<el-table-column label="质保质量" align="center">
<el-table-column
label="实收份数"
align="center"
prop="checkNum"
/>
<el-table-column
label="符合要求"
align="center"
/>
</el-table-column>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
/>
label="序号"
align="center"
type="index"
row="2"
/>
<el-table-column
label="物资名称"
align="center"
prop="maTypeName"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeName"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
/>
<el-table-column label="配送信息" align="center">
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
/>
<el-table-column
label="验收结论"
align="center"
prop="checkResult"
/>
<el-table-column label="质保质量" align="center">
<el-table-column
label="实收份数"
align="center"
prop="checkNum"
/>
<el-table-column
label="符合要求"
align="center"
/>
</el-table-column>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
/>
<!-- <el-table-column-->
<!-- label="合格证及技术资料"-->
<!-- align="center"-->
<!-- prop=""-->
<!-- />-->
<!-- <el-table-column label="包装" align="center" prop="" />-->
</el-table>
<!-- <el-table-column-->
<!-- label="合格证及技术资料"-->
<!-- align="center"-->
<!-- prop=""-->
<!-- />-->
<!-- <el-table-column label="包装" align="center" prop="" />-->
</el-table>
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="width: 33%">
<div>
<span>供应科{{printData.supplyDept}}</span>
</div>
</div>
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="width: 33%">
<div>
<span>供应科{{ printData.supplyDept }}</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>生产技术科{{printData.productionTechDept}}</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span
>生产技术科{{
printData.productionTechDept
}}</span
>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>库管班{{printData.warehouseTeam}}</span>
</div>
</div>
</div>
</vue-easy-print>
</div>
<div class="item" style="width: 33%">
<div>
<span
>库管班{{ printData.warehouseTeam }}</span
>
</div>
</div>
</div>
</vue-easy-print>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
</div>
</template>
<script>
import { getPurchaseList,acceptancePurchase,getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
<script>
import {
getPurchaseList,
acceptancePurchase,
getPurchaseCheckFormByTaskId,
} from '@/api/purchase/goodsAccept'
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
name: "GoodsAcceptList",
data() {
return {
//
loading: false,
//
single: true,
//
multiple: true,
//
showSearch: true,
showHouse: false,
dateRange:[],
taskStatusList:[{id:'1',name:'待验收'},{id:'2',name:'验收合格'},{id:'3',name:'验收未通过'}],
ids:[],
//
total: 0,
//
tableList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:undefined,
taskStatus:undefined,
},
openPrint: false,
printData: {},
printTableData: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
if(this.dateRange.length>0){
this.queryParams.startTime=this.dateRange[0]
this.queryParams.endTime=this.dateRange[1]
}else{
this.queryParams.startTime=undefined
this.queryParams.endTime=undefined
}
this.queryParams.modelName="新购验收"
getPurchaseList(this.queryParams).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
this.queryParams.keyWord=null;
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
handleUpdate(row){
console.log(row)
let query = { Id:row.id,taskId: row.taskId,isView:"false" }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//
handleView(row){
console.log(row)
let query = { Id:row.id,taskId: row.taskId,isView:"true" }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//
acceptancePurchase(){
acceptancePurchase(this.ids).then((response) => {
this.$modal.msgSuccess('操作成功')
this.getList()
}).catch(() => {
this.$modal.msgError('操作失败')
})
},
//
handlePrint(row) {
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = '新购工机具验收单'
},
//
getPrintTable(taskId) {
getPurchaseCheckFormByTaskId(taskId).then((response) => {
this.printData = response.data
this.printTableData = response.data.materialList
// let supplierList = []
// this.printTableData.forEach((e) => {
// if (e.supplier) {
// supplierList.push(e.supplier)
// }
// })
// supplierList = [...new Set(supplierList)]
// this.supplierStr = supplierList.join(',')
})
},
//
print() {
this.$refs.remarksPrintRef.print()
},
name: 'GoodsAcceptList',
data() {
return {
//
loading: false,
//
single: true,
//
multiple: true,
//
showSearch: true,
showHouse: false,
dateRange: [],
taskStatusList: [
{ id: '1', name: '待验收' },
{ id: '2', name: '验收合格' },
{ id: '3', name: '验收未通过' },
],
ids: [],
//
total: 0,
//
tableList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
taskStatus: 4,
},
openPrint: false,
printData: {},
printTableData: [],
}
},
created() {
this.getList()
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
if (this.dateRange.length > 0) {
this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
} else {
this.queryParams.startTime = undefined
this.queryParams.endTime = undefined
}
// this.queryParams.modelName=""
getPurchaseList(this.queryParams).then((response) => {
this.tableList = response.rows
this.total = response.total
this.loading = false
})
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.dateRange = []
this.queryParams.keyWord = null
this.handleQuery()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
handleUpdate(row) {
console.log(row)
let query = { Id: row.id, taskId: row.taskId, isView: 'false' }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//
handleView(row) {
console.log(row)
let query = { Id: row.id, taskId: row.taskId, isView: 'true' }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//
acceptancePurchase() {
acceptancePurchase(this.ids)
.then((response) => {
this.$modal.msgSuccess('操作成功')
this.getList()
})
.catch(() => {
this.$modal.msgError('操作失败')
})
},
//
handlePrint(row) {
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = '新购工机具验收单'
},
//
getPrintTable(taskId) {
getPurchaseCheckFormByTaskId(taskId).then((response) => {
this.printData = response.data
this.printTableData = response.data.materialList
// let supplierList = []
// this.printTableData.forEach((e) => {
// if (e.supplier) {
// supplierList.push(e.supplier)
// }
// })
// supplierList = [...new Set(supplierList)]
// this.supplierStr = supplierList.join(',')
})
},
//
print() {
this.$refs.remarksPrintRef.print()
},
handleExport() {
// this.download('/material/ma_machine/export', {
// ...this.queryParams
// }, `_${new Date().getTime()}.xlsx`)
},
}
};
handleExport() {
// this.download('/material/ma_machine/export', {
// ...this.queryParams
// }, `_${new Date().getTime()}.xlsx`)
},
},
}
</script>
<style lang="scss" scoped>
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.deviceCode {
margin-top: 10px;
@ -465,4 +573,4 @@ export default {
display: none;
}
}
</style>
</style>

View File

@ -1,42 +1,98 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
style="width: 200px" class="filter-item ml-20" :maxlength="30"
<el-input
v-model="listQuery.ip"
placeholder="请输入IP地址"
style="width: 200px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-date-picker
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<el-select v-model="listQuery.grade" placeholder="请选择异常等级" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(levelList)" :key="item" :value="levelList[item]" :label="levelList[item]" />
<el-select
v-model="listQuery.grade"
placeholder="请选择异常等级"
style="width: 200px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(levelList)"
:key="item"
:value="levelList[item]"
:label="levelList[item]"
/>
</el-select>
<!-- <el-input v-model="listQuery.errType" placeholder="请输入异常类型"
style="width: 200px" class="filter-item" :maxlength="30"
@keyup.enter.native="handleFilter"
/> -->
<el-select v-model="listQuery.errType" placeholder="请选择异常类型" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(typeList)" :key="item" :value="typeList[item]" :label="typeList[item]" />
<el-select
v-model="listQuery.errType"
placeholder="请选择异常类型"
style="width: 200px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(typeList)"
:key="item"
:value="typeList[item]"
:label="typeList[item]"
/>
</el-select>
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="listQuery.logSort"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in timeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="listQuery.logDesc"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in sortList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
<el-button
style="margin-left: 20px"
class="filter-item"
type="primary"
@click="handleFilter"
>
查询
</el-button>
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
<el-button
style="margin-left: 20px"
class="filter-item"
@click="resetFilter"
>
重置
</el-button>
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
@ -55,28 +111,33 @@
:max-height="tableHeight"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
<template slot-scope="scope">
<span>{{
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operaUserName">
<template slot-scope="scope">
<span>{{ scope.row.operaUserName||'/' }}</span>
<span>{{ scope.row.operaUserName || "/" }}</span>
</template>
</el-table-column>
<el-table-column label="操作时间" align="center" prop="operTime" width="180"/>
<el-table-column label="IP地址" align="center" prop="ip"/>
<el-table-column label="操作模块" align="center" prop="model" >
<el-table-column
label="操作时间"
align="center"
prop="operTime"
width="180"
/>
<el-table-column label="IP地址" align="center" prop="ip" />
<el-table-column label="操作模块" align="center" prop="model">
<template slot-scope="scope">
<span>{{ scope.row.model||'/' }}</span>
<span>{{ scope.row.model || "/" }}</span>
</template>
</el-table-column>
<el-table-column label="异常类型" align="center" prop="errType" />
<el-table-column label="异常原因" align="center" prop="operateDetail"/>
<el-table-column label="异常等级" align="center" prop="grade"/>
<!-- <el-table-column label="事件结果" align="center" prop="failureReason"/> -->
<el-table-column label="异常原因" align="center" prop="operateDetail" />
<el-table-column label="异常等级" align="center" prop="grade" />
<!-- <el-table-column label="事件结果" align="center" prop="failureReason"/> -->
<el-table-column label="操作类型" align="center" prop="operType" />
<!--
<el-table-column label="操作详情" align="center" prop="operateDetail" />
@ -103,22 +164,21 @@
</template>
<script>
import Pagination from '@/components/Pagination'
import Pagination from "@/components/Pagination";
import _ from 'lodash/fp'
import { downloadFile } from '@/utils/download'
import { getErrLogs,downloadErrLogs } from '@/api/system/log'
import _ from "lodash/fp";
import { downloadFile } from "@/utils/download";
import { getErrLogs, downloadErrLogs } from "@/api/system/log";
const levelList = {
1:'高',
2:'中',
3:'低'
1: "高",
2: "中",
3: "低",
};
const typeList = {
1:'越权访问',
2:'IP异常',
1: "越权访问",
2: "IP异常",
// 3:'',
// 4:'',
// 5:'',
@ -139,84 +199,96 @@ export default {
listLoading: false,
tableHeight: 650,
typeList: typeList,
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:4,name:'ip'},{id:5,name:'异常等级'}],
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
timeList: [
{ id: 1, name: "时间" },
{ id: 2, name: "操作人" },
{ id: 4, name: "ip" },
{ id: 5, name: "异常等级" },
],
sortList: [
{ id: 1, name: "倒序" },
{ id: 2, name: "升序" },
],
listQuery: {
pageNum: 1,
pageSize: 10,
errType: '',
ip: '',
errLevel: '',
operTime:'',
errType: "",
ip: "",
errLevel: "",
operTime: "",
// logSort:1,
logDesc:1,
logDesc: 1,
},
rangeDate:[],
}
rangeDate: [],
};
},
created() {
// this.getList()
// this.getOperate()
},
mounted() {
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
this.getList()
this.listQuery.operTime =
this.getCurrentDate() + " - " + this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.getList();
},
methods: {
getStatus(val) {
return this.levelList[val]
return this.levelList[val];
},
//
getOperate(){
getOperate() {
// getOperateList().then((response) => {
// this.typeList = response.data
// })
},
getList() {
this.listLoading = true
if(this.rangeDate && this.rangeDate.length>0){
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
this.listLoading = true;
if (this.rangeDate && this.rangeDate.length > 0) {
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
}
getErrLogs(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
return item
})
this.total = response.total
})
setTimeout(()=>{
this.listLoading = false
},500)
this.list = response.rows.map((item) => {
return item;
});
this.total = response.total;
});
setTimeout(() => {
this.listLoading = false;
}, 500);
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
this.listQuery.pageNum = 1;
this.getList();
},
//
resetFilter() {
this.listQuery={
this.listQuery = {
pageNum: 1,
pageSize: 10,
errType: '',
ip: '',
grade: '',
errType: "",
ip: "",
grade: "",
// logSort:1,
logDesc:1,
logDesc: 1,
};
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
this.handleFilter()
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.handleFilter();
},
//
handleBackups() {
downloadErrLogs().then(res => {
downloadFile({ fileName: '异常日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8'})
})
downloadErrLogs().then((res) => {
downloadFile({
fileName: "异常日志.sql",
fileData: res,
fileType: "text/html;charset=UTF-8",
});
});
},
//
handleExport(){
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
@ -225,16 +297,15 @@ export default {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
if(month<10){
month = '0'+month
if (month < 10) {
month = "0" + month;
}
let day = now.getDate();
if(day<10){
day = '0'+day
if (day < 10) {
day = "0" + day;
}
return year + "-" + month + "-" + day;
}
}
}
},
},
};
</script>

View File

@ -1,231 +1,304 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
style="width: 200px" class="filter-item" :maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
style="width: 200px" class="filter-item ml-20" :maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-date-picker
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.operaUserName"
placeholder="请输入操作人"
style="width: 200px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.ip"
placeholder="请输入IP地址"
style="width: 200px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-date-picker
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<!-- <el-input v-model="listQuery.content" placeholder="请输入操作内容"
style="width: 200px" class="filter-item ml-20" :maxlength="30"
@keyup.enter.native="handleFilter"
/> -->
<el-select v-model="listQuery.result" placeholder="请选择事件结果" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
</el-select>
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
</el-select>
<el-select
v-model="listQuery.result"
placeholder="请选择事件结果"
style="width: 200px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(outcomeList)"
:key="item"
:value="outcomeList[item]"
:label="outcomeList[item]"
/>
</el-select>
<el-select
v-model="listQuery.operType"
placeholder="请选择操作类型"
style="width: 200px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(operateList)"
:key="item"
:value="operateList[item]"
:label="operateList[item]"
/>
</el-select>
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
查询
</el-button>
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
重置
</el-button>
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
<el-select
v-model="listQuery.logSort"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in timeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-select
v-model="listQuery.logDesc"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in sortList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-button
style="margin-left: 20px"
class="filter-item"
type="primary"
@click="handleFilter"
>
查询
</el-button>
<el-button
style="margin-left: 20px"
class="filter-item"
@click="resetFilter"
>
重置
</el-button>
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
备份
</el-button> -->
</div>
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
:max-height="tableHeight"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operaUserName" />
<el-table-column label="操作时间" align="center" prop="operTime" />
<el-table-column label="IP地址" align="center" prop="ip" />
<el-table-column label="操作模块" align="center" prop="model" />
<el-table-column label="操作类型" align="center" prop="operType" />
<el-table-column label="操作详情" align="center" prop="operateDetail" />
<el-table-column label="操作结果" align="center" prop="result">
<template slot-scope="{ row }">
{{ row.result}}
</template>
</el-table-column>
<el-table-column label="操作参数" align="center" prop="params" />
<el-table-column label="操作方法" align="center" prop="method" />
<el-table-column label="操作路径" align="center" prop="operUri" />
<el-table-column label="执行时间(ms)" align="center" prop="times" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
:max-height="tableHeight"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operaUserName" />
<el-table-column label="操作时间" align="center" prop="operTime" />
<el-table-column label="IP地址" align="center" prop="ip" />
<el-table-column label="操作模块" align="center" prop="model" />
<el-table-column label="操作类型" align="center" prop="operType" />
<el-table-column label="操作详情" align="center" prop="operateDetail" />
<el-table-column label="操作结果" align="center" prop="result">
<template slot-scope="{ row }">
{{ row.result }}
</template>
</el-table-column>
<el-table-column label="操作参数" align="center" prop="params" />
<el-table-column label="操作方法" align="center" prop="method" />
<el-table-column label="操作路径" align="center" prop="operUri" />
<el-table-column label="执行时间(ms)" align="center" prop="times" />
</el-table>
import _ from 'lodash/fp'
import { downloadFile } from '@/utils/download'
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
</div>
</template>
import { getYwLogs,downloadYwLogs } from '@/api/system/log'
<script>
import Pagination from "@/components/Pagination";
import _ from "lodash/fp";
import { downloadFile } from "@/utils/download";
const outcomeList = {
1:'成功',
2:'失败'
};
const operateList = {
1:'新增',
2:'修改',
3:'删除',
4:'查询',
5:'导出',
6:'下载',
7:'备份',
8:'登录',
9:'登出'
};
import { getYwLogs, downloadYwLogs } from "@/api/system/log";
export default {
components: { Pagination },
data() {
return {
tableKey: 0,
list: [],
outcomeList: outcomeList,
total: 0,
listLoading: false,
tableHeight: 650,
operateList: operateList,
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},],
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
listQuery: {
pageNum: 1,
pageSize: 10,
operaUserName: '',
ip: '',
content:'',
result: '',
operTime:'',
operType: '',
logSort:1,
logDesc:1,
},
rangeDate:[],
const outcomeList = {
1: "成功",
2: "失败",
};
const operateList = {
1: "新增",
2: "修改",
3: "删除",
4: "查询",
5: "导出",
6: "下载",
7: "备份",
8: "登录",
9: "登出",
};
export default {
components: { Pagination },
data() {
return {
tableKey: 0,
list: [],
outcomeList: outcomeList,
total: 0,
listLoading: false,
tableHeight: 650,
operateList: operateList,
timeList: [
{ id: 1, name: "时间" },
{ id: 2, name: "操作人" },
{ id: 3, name: "操作模块" },
{ id: 4, name: "ip" },
],
sortList: [
{ id: 1, name: "倒序" },
{ id: 2, name: "升序" },
],
listQuery: {
pageNum: 1,
pageSize: 10,
operaUserName: "",
ip: "",
content: "",
result: "",
operTime: "",
operType: "",
logSort: 1,
logDesc: 1,
},
rangeDate: [],
};
},
created() {
// this.getList()
// this.getOperate()
},
mounted() {
this.listQuery.operTime =
this.getCurrentDate() + " - " + this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.getList();
},
methods: {
getStatus(val) {
return this.outcomeList[val];
},
//
getOperate() {
// getOperateList().then((response) => {
// this.operateList = response.data
// })
},
getList() {
this.listLoading = true;
if (this.rangeDate && this.rangeDate.length > 0) {
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
}
getYwLogs(this.listQuery).then((response) => {
this.list = response.rows.map((item) => {
return item;
});
this.total = response.total;
});
setTimeout(() => {
this.listLoading = false;
}, 500);
},
created() {
// this.getList()
// this.getOperate()
//
handleFilter() {
this.listQuery.pageNum = 1;
this.getList();
},
mounted() {
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
this.getList()
//
resetFilter() {
this.listQuery = {
pageNum: 1,
pageSize: 10,
operaUserName: "",
ip: "",
content: "",
result: "",
operType: "",
logSort: 1,
logDesc: 1,
};
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.handleFilter();
},
methods: {
getStatus(val) {
return this.outcomeList[val]
},
//
getOperate(){
// getOperateList().then((response) => {
// this.operateList = response.data
// })
},
getList() {
this.listLoading = true
if(this.rangeDate && this.rangeDate.length>0){
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
}
getYwLogs(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
return item
})
this.total = response.total
})
setTimeout(()=>{
this.listLoading = false
},500)
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
},
//
resetFilter() {
this.listQuery={
pageNum: 1,
pageSize: 10,
operaUserName: '',
ip: '',
content:'',
result: '',
operType: '',
logSort:1,
logDesc:1,
};
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
this.handleFilter()
},
//
handleBackups() {
downloadYwLogs().then(res => {
downloadFile({ fileName: '业务日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8'})
})
},
//
handleExport(){
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
},
getCurrentDate() {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
if(month<10){
month = '0'+month
}
let day = now.getDate();
if(day<10){
day = '0'+day
}
return year + "-" + month + "-" + day;
//
handleBackups() {
downloadYwLogs().then((res) => {
downloadFile({
fileName: "业务日志.sql",
fileData: res,
fileType: "text/html;charset=UTF-8",
});
});
},
//
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
},
getCurrentDate() {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
}
}
</script>
let day = now.getDate();
if (day < 10) {
day = "0" + day;
}
return year + "-" + month + "-" + day;
},
},
};
</script>

View File

@ -1,45 +1,96 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
style="width: 200px" class="filter-item" :maxlength="30"
<el-input
v-model="listQuery.operaUserName"
placeholder="请输入操作人"
style="width: 200px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
style="width: 200px" class="filter-item ml-20" :maxlength="30"
<el-input
v-model="listQuery.ip"
placeholder="请输入IP地址"
style="width: 200px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-date-picker
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
v-model="rangeDate"
style="width: 300px"
class="filter-item ml-20"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<!-- <el-input v-model="listQuery.content" placeholder="请输入操作内容"
<!-- <el-input v-model="listQuery.content" placeholder="请输入操作内容"
style="width: 200px" class="filter-item ml-20" :maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-select v-model="listQuery.result" placeholder="请选择事件结果" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
</el-select>-->
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 200px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
<el-select
v-model="listQuery.operType"
placeholder="请选择操作类型"
style="width: 200px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(operateList)"
:key="item"
:value="operateList[item]"
:label="operateList[item]"
/>
</el-select>
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="listQuery.logSort"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in timeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="listQuery.logDesc"
clearable
filterable
style="width: 200px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option
v-for="item in sortList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
<el-button
style="margin-left: 20px"
class="filter-item"
type="primary"
@click="handleFilter"
>
查询
</el-button>
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
<el-button
style="margin-left: 20px"
class="filter-item"
@click="resetFilter"
>
重置
</el-button>
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
@ -58,8 +109,10 @@
:max-height="tableHeight"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
<template slot-scope="scope">
<span>{{
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operaUserName" />
@ -90,28 +143,27 @@
</template>
<script>
import Pagination from '@/components/Pagination'
import Pagination from "@/components/Pagination";
import _ from 'lodash/fp'
import { downloadFile } from '@/utils/download'
import { getSysLogs,downloadSysLogs } from '@/api/system/log'
import _ from "lodash/fp";
import { downloadFile } from "@/utils/download";
import { getSysLogs, downloadSysLogs } from "@/api/system/log";
const outcomeList = {
1:'成功',
2:'失败'
1: "成功",
2: "失败",
};
const operateList = {
1:'新增',
2:'修改',
3:'删除',
4:'查询',
5:'导出',
6:'下载',
7:'备份',
8:'登录',
9:'登出'
1: "新增",
2: "修改",
3: "删除",
4: "查询",
5: "导出",
6: "下载",
7: "备份",
8: "登录",
9: "登出",
};
export default {
@ -125,90 +177,101 @@ export default {
listLoading: false,
tableHeight: 650,
operateList: operateList,
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},],
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
timeList: [
{ id: 1, name: "时间" },
{ id: 2, name: "操作人" },
{ id: 3, name: "操作模块" },
{ id: 4, name: "ip" },
],
sortList: [
{ id: 1, name: "倒序" },
{ id: 2, name: "升序" },
],
listQuery: {
pageNum: 1,
pageSize: 10,
operaUserName: '',
ip: '',
content:'',
result: '',
operTime:'',
operaType: '',
logSort:1,
logDesc:1,
operaUserName: "",
ip: "",
content: "",
result: "",
operTime: "",
operaType: "",
logSort: 1,
logDesc: 1,
},
rangeDate:[],
}
rangeDate: [],
};
},
created() {
// this.getList()
// this.getOperate()
},
mounted() {
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
this.getList()
this.listQuery.operTime =
this.getCurrentDate() + " - " + this.getCurrentDate();
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.getList();
},
methods: {
getStatus(val) {
return this.outcomeList[val]
return this.outcomeList[val];
},
//
getOperate(){
getOperate() {
// getOperateList().then((response) => {
// this.operateList = response.data
// })
},
getList() {
this.listLoading = true
if(this.rangeDate && this.rangeDate.length>0){
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
this.listLoading = true;
if (this.rangeDate && this.rangeDate.length > 0) {
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
}
getSysLogs(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
return item
})
this.total = response.total
})
setTimeout(()=>{
this.listLoading = false
},500)
this.list = response.rows.map((item) => {
return item;
});
this.total = response.total;
});
setTimeout(() => {
this.listLoading = false;
}, 500);
},
//
handleFilter() {
this.listQuery.pageNum = 1
this.getList()
this.listQuery.pageNum = 1;
this.getList();
},
//
resetFilter() {
this.listQuery={
this.listQuery = {
pageNum: 1,
pageSize: 10,
operaUserName: '',
ip: '',
operaUserName: "",
ip: "",
content:'',
result: '',
operateType: '',
logSort:1,
logDesc:1,
content: "",
result: "",
operateType: "",
logSort: 1,
logDesc: 1,
};
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
this.handleFilter()
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
this.handleFilter();
},
//
handleBackups() {
downloadSysLogs().then(res => {
downloadFile({ fileName: '系统日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8' })
})
downloadSysLogs().then((res) => {
downloadFile({
fileName: "系统日志.sql",
fileData: res,
fileType: "text/html;charset=UTF-8",
});
});
},
//
handleExport(){
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
@ -217,16 +280,15 @@ export default {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
if(month<10){
month = '0'+month
if (month < 10) {
month = "0" + month;
}
let day = now.getDate();
if(day<10){
day = '0'+day
if (day < 10) {
day = "0" + day;
}
return year + "-" + month + "-" + day;
}
}
}
},
},
};
</script>

View File

@ -1,15 +1,15 @@
'use strict'
const path = require('path')
"use strict";
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir)
return path.join(__dirname, dir);
}
const CompressionPlugin = require('compression-webpack-plugin')
const CompressionPlugin = require("compression-webpack-plugin");
const name = process.env.VUE_APP_TITLE || '博诺思管理系统' // 网页标题
const name = process.env.VUE_APP_TITLE || "博诺思管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口
const port = process.env.port || process.env.npm_config_port || 80; // 端口
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@ -20,119 +20,118 @@ module.exports = {
// 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: 'dist',
outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
assetsDir: "static",
// 是否开启eslint保存检测有效值ture | false | 'error'
lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: process.env.NODE_ENV === "development",
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
// webpack-dev-server 相关配置
devServer: {
host: '0.0.0.0',
host: "0.0.0.0",
port: port,
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:18080`,
target: `http://192.168.2.72:18080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
["^" + process.env.VUE_APP_BASE_API]: "",
},
},
"/api" : {
"target" : "http://192.168.0.21:17861",
"/api": {
target: "http://192.168.0.21:17861",
//设置允许跨域——此处我经过测试发现可有可无
"changeOrigin" : true,
"pathRewrite" : {
"^/api" : ""
}
changeOrigin: true,
pathRewrite: {
"^/api": "",
},
},
},
disableHostCheck: true
disableHostCheck: true,
},
css: {
loaderOptions: {
sass: {
sassOptions: { outputStyle: "expanded" }
}
}
sassOptions: { outputStyle: "expanded" },
},
},
},
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
"@": resolve("src"),
},
},
plugins: [
// http://doc.bonus.vip/bonus-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: '[path][base].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false // 压缩后删除原文件
})
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: "[path][base].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false, // 压缩后删除原文件
}),
],
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.plugins.delete("preload"); // TODO: need test
config.plugins.delete("prefetch"); // TODO: need test
// set svg-sprite-loader
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module
.rule('icons')
.rule("icons")
.test(/\.svg$/)
.include.add(resolve('src/assets/icons'))
.include.add(resolve("src/assets/icons"))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: 'icon-[name]'
symbolId: "icon-[name]",
})
.end()
.end();
config.when(process.env.NODE_ENV !== 'development', config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
config.when(process.env.NODE_ENV !== "development", (config) => {
config
.plugin("ScriptExtHtmlWebpackPlugin")
.after("html")
.use("script-ext-html-webpack-plugin", [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
inline: /runtime\..*\.js$/,
},
])
.end();
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: "initial", // only package third parties that are initially dependent
},
elementUI: {
name: "chunk-elementUI", // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: "chunk-commons",
test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true,
},
},
});
config.optimization.runtimeChunk("single");
});
},
};