Merge branch 'bns_hongchao' of http://192.168.0.56:3000/bonus/bonus-material-ui into zzyuanMaster

This commit is contained in:
zzyuan 2024-10-23 17:26:50 +08:00
commit ba330e88e4
18 changed files with 4498 additions and 316 deletions

View File

@ -43,13 +43,16 @@
"crypto-js": "^4.2.0",
"echarts": "5.4.0",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"file-saver": "^2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"html2canvas": "^1.4.1",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"jszip": "^3.10.1",
"nprogress": "0.2.0",
"qrcodejs2": "^0.0.2",
"quill": "1.3.7",
"screenfull": "5.0.2",
"sm-crypto": "^0.3.13",

View File

@ -9,6 +9,78 @@ export function getListNewBuy(query) {
})
}
//任务 详情
export function getPurchaseCheckInfo(id) {
return request({
url: '/material/purchase_check_info/'+ id,
method: 'get',
})
}
// 保存--新增
export function addPurchaseCheckInfo(data) {
return request({
url: '/material/purchase_check_info',
method: 'post',
data: data,
})
}
//人员 详情
export function getNoticePeople(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',
})
}
// 人员管理--新增
export function addNoticeUser(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,
})
}
//机具类型管理列表信息
export function getUserAll() {
return request({
url: '/system/user/list',
method: 'get',
})
}
//获取机具类型树2
export function equipmentTypeTree(query) {
return request({
url: '/material/ma_type/equipmentType',
method: 'get',
params: query,
})
}
//查看机具类型管理列表详细信息
export function getHouseDetail(id) {
return request({
@ -27,6 +99,8 @@ export function queryKeeperNameApi(query) {
})
}
// 仓库管理--删除
export function delHouse(id) {
return request({

View File

@ -0,0 +1,100 @@
import request from '@/utils/request'
//机具类型管理列表信息
export function getListNewBuyBind(query) {
return request({
url: '/material/purchase/bind/list',
method: 'get',
params: query,
})
}
//任务 详情
export function getListDetail(query) {
return request({
url: '/material/purchase/bind/details',
method: 'get',
params: query,
})
}
//任务 详情
export function bindAllData(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,
})
}
// 导出
export function exportNewBuy(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,
})
}
// 人员--删除
export function delPeople(ids) {
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,
})
}
// 仓库管理--修改
export function bmNoticeInfo(data) {
return request({
url: '/material/purchase_notice_person/batchSendSms',
method: 'put',
data: data,
})
}
//机具类型管理列表信息
export function getUserAll() {
return request({
url: '/system/user/list',
method: 'get',
})
}

View File

@ -38,6 +38,7 @@ import VueMeta from 'vue-meta'
// 字典数据组件
import DictData from '@/components/DictData'
import global_ from '@/utils/globalUrl'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
@ -48,7 +49,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.globalUrl = global_
// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)

View File

@ -8,7 +8,10 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
const whiteList = [
'/login', '/register',
'/qrCode/qrCodePage',
]
router.beforeEach((to, from, next) => {
NProgress.start()

View File

@ -74,6 +74,11 @@ export const constantRoutes = [
}
]
},
{
path: '/qrCode/qrCodePage',
component: () => import('@/views/qrCode/qrCode'),
hidden: true
},
{
path: '/user',
component: Layout,

76
src/utils/chapter.js Normal file
View File

@ -0,0 +1,76 @@
let chapter = (text, companyName) => {
let canvas = document.getElementById("canvas");
let context = canvas.getContext("2d");
//let text = "XXX专用章";
//let companyName = "XXX科技股份有限公司";
// 绘制印章边框
let width = canvas.width / 2;
let height = canvas.height / 2;
context.lineWidth = 3;
context.strokeStyle = "#f00";
context.beginPath();
context.arc(width, height, 80, 0, Math.PI * 2); //宽、高、半径
context.stroke();
//画五角星
create5star(context, width, height, 20, "#f00", 0);
// 绘制印章名称
context.font = "14px 宋体";
context.textBaseline = "middle"; //设置文本的垂直对齐方式
context.textAlign = "center"; //设置文本的水平对对齐方式
context.lineWidth = 1;
context.strokeStyle = "#f00";
context.strokeText(text, width, height + 50);
// 绘制印章单位
context.translate(width, height); // 平移到此位置,
context.font = "14px 宋体";
let count = companyName.length; // 字数
let angle = (4 * Math.PI) / (3 * (count - 1)); // 字间角度
let chars = companyName.split("");
let c;
for (let i = 0; i < count; i++) {
c = chars[i]; // 需要绘制的字符
if (i == 0) {
context.rotate((5 * Math.PI) / 6);
} else {
context.rotate(angle);
}
context.save();
context.translate(65, 0); // 平移到此位置,此时字和x轴垂直公司名称和最外圈的距离
context.rotate(Math.PI / 2); // 旋转90度,让字平行于x轴
context.strokeText(c, 0, 0); // 此点为字的中心点
context.restore();
}
//绘制五角星
function create5star(context, sx, sy, radius, color, rotato) {
context.save();
context.fillStyle = color;
context.translate(sx, sy); //移动坐标原点
context.rotate(Math.PI + rotato); //旋转
context.beginPath(); //创建路径
// let x = Math.sin(0);
// let y = Math.cos(0);
let dig = (Math.PI / 5) * 4;
for (let i = 0; i < 5; i++) {
//画五角星的五条边
let x = Math.sin(i * dig);
let y = Math.cos(i * dig);
context.lineTo(x * radius, y * radius);
}
context.closePath();
context.stroke();
context.fill();
context.restore();
}
};
export default chapter;

19
src/utils/globalUrl.js Normal file
View File

@ -0,0 +1,19 @@
// const qrUrl = 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode='; //测试
// const qrUrl = 'http://112.29.103.165:21626/qrCode/qrCodePage?qrCode='; //重庆
// const qrUrl = 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode='; //宁夏
// const qrUrl = 'https://z.csgmall.com.cn/gl/qrCode/qrCodePage?qrCode='; //南网
const qrUrl = 'http://192.168.0.110:80/qrCode/qrCodePage?qrCode='; //本地
// const qrUrl = process.env.NODE_ENV === 'production' ? 'http://192.168.0.14:18866/qrCode/qrCodePage?qrCode=' : 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode='
// let qrUrl = ''
const origin = window.location.origin
// qrUrl = origin + '/qrCode/qrCodePage?qrCode='
// if (origin == 'http://112.29.103.165:21626') {
// qrUrl = 'http://112.29.103.165:21626/qrCode/qrCodePage?qrCode='
// } else {
// qrUrl = 'http://192.168.0.14:18866/qrCode/qrCodePage?qrCode='
// }
export default {
qrUrl,
}

View File

@ -92,7 +92,7 @@
删除
</el-button>
</template>
</el-table-column>
</el-table-column>
</el-table>
<pagination

View File

@ -1,69 +1,48 @@
<template>
<!-- 新增工机具 -->
<div>
<!-- <el-form -->
<!-- :model="queryParams" -->
<!-- ref="queryForm" -->
<!-- size="small" -->
<!-- :inline="true" -->
<!-- label-width="100px" -->
<!-- > -->
<!-- <el-form-item label="出厂日期">
<el-date-picker
v-model="queryParams.productionTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
placeholder="出厂日期"
@change="changeTime"
></el-date-picker>
</el-form-item>
<el-form-item label="机具厂家" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
placeholder="机具厂家"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item> -->
<!-- </el-form> -->
<el-form
:model="maForm"
ref="maForm"
:rules="rules"
size="small"
:rules="rules"
:inline="true"
label-width="120px"
>
<el-form-item label="线下采购单编号" prop="purchaseNumber">
<el-input
placeholder="请输入线下采购单编号"
<el-form-item label="到货日期" prop="arrivalTime">
<el-date-picker
v-model="maForm.arrivalTime"
style="width: 240px"
v-model="maForm.purchaseNumber"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择到货日期"
></el-date-picker>
</el-form-item>
<el-form-item label="出厂日期" prop="productionTime">
<el-date-picker
v-model="maForm.productionTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择出厂日期"
@change="productionTimeChange"
></el-date-picker>
</el-form-item>
<el-form-item label="税率" prop="taxRate">
<el-input
v-model="maForm.taxRate"
placeholder="请输入税率"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="equipmentId">
<!-- <treeselect
v-model="queryParams.equipmentId"
default-expand-all
:options="equipmentTypeList"
placeholder="请选择规格型号"
@select="select"
:disable-branch-nodes="true"
style="width: 240px"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
/> -->
<el-form-item label="类型规格" prop="deviceType">
<el-cascader
:key="propsKey"
v-model="deviceType"
@ -79,40 +58,7 @@
@change="deviceTypeChange"
></el-cascader>
</el-form-item>
<el-form-item label="采购日期" prop="purchaseTime">
<el-date-picker
v-model="maForm.purchaseTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择采购日期"
></el-date-picker>
</el-form-item>
<el-form-item label="到货日期" prop="arrivalTime">
<el-date-picker
v-model="maForm.arrivalTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择到货日期"
></el-date-picker>
</el-form-item>
<el-form-item label="采购员" prop="purchaser">
<el-select
v-model="maForm.purchaser"
filterable
placeholder="请选择采购员"
style="width: 240px"
>
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.userName"
:value="item.userId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="maForm.remark"
@ -152,19 +98,19 @@
/>
<el-table-column
align="center"
label="机具名称"
prop="machineTypeName"
label="物资名称"
prop="maTypeName"
show-overflow-tooltip
></el-table-column>
<el-table-column
align="center"
label="规格型号"
prop="specificationType"
prop="typeName"
show-overflow-tooltip
/>
<el-table-column align="center" label="单位" prop="unitName" />
<el-table-column
label="购置单价(元)"
label="购置单价(元含税)"
prop="purchasePrice"
align="center"
>
@ -177,36 +123,35 @@
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="采购数量" prop="purchaseNum">
<el-table-column
label="购置单价(元不含税)"
prop="purchasePrice"
align="center"
>
<template slot-scope="scope">
<el-input-number
type="number"
:min="1"
clearable
v-model.number="scope.row.purchaseNum"
v-model="scope.row.purchasePrice"
controls-position="right"
style="width: 100%"
:min="0"
></el-input-number>
</template>
</el-table-column>
<el-table-column
label="机具厂家"
prop="supplierId"
label="是否为固定资产"
prop="productionTime"
align="center"
width="200"
>
<template slot-scope="scope">
<el-select
v-model="scope.row.supplierId"
placeholder="机具厂家"
placeholder="固定资产"
filterable
clearable
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
<el-option label="是" value="0"></el-option>
<el-option label="否" value="1"></el-option>
</el-select>
</template>
</el-table-column>
@ -228,16 +173,21 @@
></el-date-picker>
</template>
</el-table-column>
<el-table-column
label="相关配套资料"
align="center"
prop="checkUrlName"
>
<template slot-scope="scope">
<div @click="openGt(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ '报告管理' }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-document"
v-if="scope.row.manageType == 2"
@click="handleDetail(scope.row)"
>明细</el-button
>
<el-button
size="mini"
type="text"
@ -256,15 +206,67 @@
:holdingpoleData="holdingpoleData"
@close="onDialogClose"
></holdingpole-dialog>
<!-- 报告管理弹窗 -->
<!-- <el-dialog :title="title" :visible.sync="showGt" width="1000px" height="1000px" append-to-body @close="cancelGt">
<el-form :model="queryGt" ref="queryFormGt" size="small" :inline="true" label-width="68px"> </el-form>
<el-table v-loading="loadingTwo" :data="gtList" width="600px" height = "600px" >
<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>{{ (queryGt.pageNum - 1) * queryGt.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="杆塔id" align="center" prop="gtId" v-if="false" />
<el-table-column label="杆塔编号" align="center" prop="gtCode" sortable/>
<el-table-column label="杆塔经度" align="center" prop="lon" sortable/>
<el-table-column label="杆塔纬度" align="center" prop="lat" sortable/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdateGt(scope.row)"
v-hasPermi="['basic:device:edit']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDeleteGt(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <pagination
v-show="totalTwo>0"
:total="totalTwo"
:page.sync="queryGt.pageNum"
:limit.sync="queryGt.pageSize"
@pagination="getListGt"
/> -->
<!--
</el-dialog> -->
</div>
</template>
<script>
// import {
// addPurchaseCheckInfo,
// getPurchaseCheckInfo,
// updatePurchaseCheckInfo,
// } from '@/api/store/newBuy'
import {
getPurchaseCheckInfo,
equipmentTypeTree,
addPurchaseCheckInfo,
// getPurchaseCheckInfo,
updatePurchaseCheckInfo,
} from '@/api/baseGround/newBuy'
// import { getUserByRoleList } from '@/api/system/user'
// import { equipmentTypeTree, supplierInfoList } from '@/api/store/tools'
// import Treeselect from '@riophae/vue-treeselect'
@ -297,6 +299,7 @@ export default {
// isEdit: false,
//
loading: false,
loadingTwo: false,
//
ids: [],
//
@ -319,6 +322,7 @@ export default {
title: '',
//
open: false,
showGt:false,
//
openDataScope: false,
menuExpand: false,
@ -329,6 +333,12 @@ export default {
holdingpoleData: {},
//
dateRange: [],
queryGt: {
pageNum: 1,
pageSize: 10,
id:undefined,
typesList:[],
},
//
dataScopeOptions: [
{
@ -377,24 +387,17 @@ export default {
},
//
rules: {
purchaseNumber: [
{
required: true,
message: '请输入线下采购单编号',
trigger: 'blur',
},
],
purchaseTime: [
{
required: true,
message: '采购日期不能为空',
trigger: 'blur',
},
],
// deviceType: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
arrivalTime: [
{
required: true,
message: '到货日期不能为空',
message: '请选择到货日期',
trigger: 'blur',
},
],
@ -442,16 +445,36 @@ export default {
// }
if (this.isEdit) {
this.taskId = this.editTaskId
console.log('isEdit',this.isEdit)
this.id = this.editTaskId
this.getTaskInfo()
}
this.getUserList()
// this.getUserList()
// this.getList();
this.equipmentType()
this.supplierInfoList()
// this.supplierInfoList()
},
methods: {
getParentsById(list, id) {
for (let i in list) {
if (list[i].typeId == id) {
//value
return [list[i].typeId]
}
if (list[i].children) {
let node = this.getParentsById(list[i].children, id)
if (node !== undefined) {
//
node.unshift(list[i].typeId)
return node
}
}
}
},
/** 查询用户列表--采购员 */
getUserList() {
getUserByRoleList({ roleIds: [152] }).then((response) => {
@ -478,7 +501,7 @@ export default {
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.machineTypeName =
item4.maTypeName =
item3.typeName
item4.specificationType =
item4.typeName
@ -544,22 +567,39 @@ export default {
//---
getTaskInfo() {
// this.loading = true;
getPurchaseCheckInfo({
taskId: this.taskId,
keyWord: this.queryParams.keyWord,
}).then((response) => {
getPurchaseCheckInfo(this.id).then((response) => {
// this.taskInfo = response.data
this.maForm.purchaseTime = response.data.purchaseTime
this.maForm.arrivalTime = response.data.arrivalTime
this.maForm.purchaser = response.data.purchaser
this.maForm.remark = response.data.remark
this.maForm.purchaseNumber = response.data.purchaseNumber
this.equipmentList = response.data.checkDetailsList
this.equipmentList = response.data.purchaseCheckDetailsList
// this.loading = false;
})
},
//
openGt(row){
this.proId = row.proId;
this.title = "新购验收报告管理"
this.showGt = true;
this.loadingTwo = true
// this.getListGt();
},
cancelGt() {
this.showGt = false;
this.resetForm("queryFormGt");
},
// /** */
// resetQueryGt() {
// this.resetForm("queryFormGt");
// this.currentSelectionGt = []//
// this.handleQueryGt();
// },
getParentsById(list, id) {
for (let i in list) {
if (list[i].typeId == id) {
@ -629,23 +669,14 @@ export default {
/** 新增按钮操作 */
handleSave() {
console.log(this.equipmentList)
if (this.equipmentList.length > 0) {
this.$refs['maForm'].validate((valid) => {
if (valid) {
// console.log(this.maForm,'maForm')
// console.log(this.equipmentList,'equipmentList')
let isEmpty = true
this.equipmentList.forEach((item) => {
if (item.purchaseNum == '' || !item.purchaseNum) {
isEmpty = false
}
})
// console.log(this.taskId)
this.maForm.taskId = this.taskId
this.maForm.checkDetailsList = this.equipmentList
// console.log(this.maForm)
if (isEmpty) {
if (this.equipmentList.length > 0) {
this.$modal
.confirm('是否确认保存当前页面')
@ -675,7 +706,7 @@ export default {
console.log('新增')
this.loading = true
addPurchaseCheckInfo(
this.maForm,
// {purchaseCheckDetailsList: this.maForm.checkDetailsList,purchaseCheckInfo:}
).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess(
@ -699,19 +730,12 @@ export default {
'请先选择并添加机具类型!!!',
)
}
} else {
this.$modal.msgError('请填写采购数量!!!')
}
}
})
} else {
this.$modal.msgError('请先添加机具类型')
}
},
jumpList() {
const obj = { path: '/store/newBuy/newDevicesList' }
this.$tab.closeOpenPage(obj)
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
@ -762,6 +786,11 @@ export default {
// ...this.queryParams
// }, `role_${new Date().getTime()}.xlsx`)
},
productionTimeChange(val){
this.equipmentList.forEach(item=>{
item.productionTime=val
})
},
deviceTypeChange(val) {
const deviceTypeList =
this.$refs.deviceTypeCascader.getCheckedNodes()

View File

@ -21,10 +21,10 @@
</el-date-picker>
</el-form-item>
<el-form-item label="设备类型" prop="typeId">
<el-form-item label="设备状态" prop="typeId">
<el-select
v-model="queryParams.typeId"
placeholder="请选择设备类型"
placeholder="请选择设备状态"
clearable
filterable
style="width: 240px"
@ -109,7 +109,7 @@
<el-table-column
align="center"
label="到货时间"
prop="purchaseNumber"
prop="arrivalTime"
:show-overflow-tooltip="true"
/>
<el-table-column
@ -121,31 +121,31 @@
<el-table-column
label="采购物资"
align="center"
prop="purchaseTime"
prop="purchaseMaTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="arrivalTime"
prop="purchaseMaNumber"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元含税)"
align="center"
prop="purchasingTypeName"
prop="purchaseTaxPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元不含税)"
align="center"
prop="purchaserName"
prop="purchaseNoTaxPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="税率"
align="center"
prop="purchasingStatus"
prop="taxRate"
:show-overflow-tooltip="true"
>
</el-table-column>
@ -161,7 +161,7 @@
<el-table-column
label="操作人"
align="center"
prop="remark"
prop="createUserName"
:show-overflow-tooltip="true"
/>
@ -169,7 +169,7 @@
<el-table-column
label="操作时间"
align="center"
prop="remark"
prop="createTime"
:show-overflow-tooltip="true"
/>
@ -188,46 +188,22 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-if="scope.row.taskStatus == 24"
v-hasPermi="['newPurchase:tools:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="
scope.row.purchasingStatus != '已入库' &&
scope.row.purchasingStatus != '已审核' &&
scope.row.purchasingStatus != '已验收合格' &&
scope.row.purchasingStatus != '待审核' &&
scope.row.purchasingStatus != '验收不通过' &&
scope.row.purchasingStatus != '驳回'
"
@click="handleAccept(scope.row)"
v-hasPermi="['newPurchase:tools:accept']"
>验收</el-button
>
@click="handleNotice(scope.row)"
v-hasPermi="['newPurchase:tools:edit']"
>通知</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="
scope.row.purchasingId == 26 &&
scope.row.manageType == 0
"
@click="handleCode(scope.row)"
v-hasPermi="['newPurchase:tools:coding']"
>编码管理</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="
scope.row.purchasingId == 26 ||
scope.row.purchasingId == 28
"
@click="handlePrint(scope.row)"
>验收单</el-button
>
@ -236,7 +212,6 @@
size="mini"
type="text"
icon="el-icon-delete"
v-if="scope.row.purchasingId === 24"
@click="handleDelete(scope.row)"
v-hasPermi="['newPurchase:tools:del']"
>删除</el-button
@ -270,7 +245,7 @@
font-size: 16px;
"
>
到货验收单
机具设备到货验收单
</div>
<div
class="info"
@ -279,13 +254,13 @@
<div
class="item"
style="
width: 50%;
width: 100%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>工程名称</span>
<span>单据编号</span>
</div>
<div
class="item"
@ -296,8 +271,9 @@
font-size: 14px;
"
>
<span>验收单编号</span>{{ printData.code }}
<span>生产厂家供应商</span>
</div>
<div
class="item"
style="
@ -307,43 +283,7 @@
font-size: 14px;
"
>
<span>合同名称</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>合同编号</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>验收地点</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>供应商</span
><span v-if="printTableData.length > 0">{{
supplierStr
}}</span>
<span>到货日期</span>
</div>
</div>
<el-table
@ -361,9 +301,10 @@
label="序号"
align="center"
type="index"
row=2
/>
<el-table-column
label="机具名称"
label="物资名称"
align="center"
prop="machineTypeName"
/>
@ -373,37 +314,41 @@
prop="specificationType"
/>
<el-table-column
label="计量单位"
label="单位"
align="center"
prop="unitName"
/>
<el-table-column
label="采购数量"
<el-table-column label="配送信息" align="center">
<el-table-column
label="到货数量"
align="center"
prop="purchaseNum"
/>
<el-table-column
label="验收结论"
align="center"
prop="purchaseNum"
/>
<el-table-column label="质保质量" align="center">
<el-table-column
label="实收份数"
align="center"
prop="purchaseNum"
/>
<el-table-column
label="符合要求"
align="center"
prop="purchaseNum"
/>
</el-table-column>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="unitName"
/>
<!-- <el-table-column-->
<!-- label="已验收数量111"-->
<!-- align="center"-->
<!-- prop=""-->
<!-- />-->
<el-table-column
label="本次验收数量"
align="center"
prop="checkNum"
/>
<!-- <el-table-column-->
<!-- label="累积验收数量"-->
<!-- align="center"-->
<!-- prop=""-->
<!-- />-->
<el-table-column
label="验收日期"
align="center"
prop="updateTime"
/>
<!-- <el-table-column-->
<!-- label="合格证及技术资料"-->
<!-- align="center"-->
<!-- prop=""-->
@ -419,30 +364,21 @@
justify-content: space-between;
"
>
<div class="item" style="width: 50%">
<div class="item" style="width: 33%">
<div>
<span>接收单位验收意见</span>
</div>
<div>
<span>验收人</span>
</div>
<div>
<span>接收单位</span>
</div>
<div>
<span>验收负责人 </span>
<span>供应科</span>
</div>
</div>
<div class="item" style="width: 50%">
<div class="item" style="width: 33%">
<div>
<span>供应商</span>
<span>生产技术科</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>供应商</span>
</div>
<div>
<span>验收负责人 </span>
<span>库管班</span>
</div>
</div>
</div>
@ -454,6 +390,126 @@
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
<!-- 通知弹窗 -->
<el-dialog :title="title" :visible.sync="showPeople" width="800px" append-to-body @close="cancel">
<el-row :gutter="24">
<el-col :span="20">
<el-form :model="form" ref="form" size="small" :inline="true" >
<el-form-item label="通知内容:" prop="remark" label-width="120px">
<el-input
v-model="form.remark"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
placeholder="请输入通知内容"
style="width: 80%"
/>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-table v-loading="loadingTwo" :data="getListPeople" width="600px" height = "600px" >
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="人员名称" align="center" prop="userName" sortable/>
<el-table-column label="所属机构" align="center" prop="newdeptId" sortable/>
<el-table-column label="角色" align="center" prop="userRoleName" sortable/>
<el-table-column label="联系电话" align="center" prop="telphone" sortable/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDeletePeople(scope.row)"
v-hasPermi="['basic:device:del']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="addUserOpen"
>人员添加</el-button
>
<el-button type="primary" @click="configNotice"
>发起验收</el-button
>
</div>
</el-dialog>
<!-- 人员添加 -->
<el-dialog
:title="title"
:visible.sync="peopleOpen"
v-if="peopleOpen"
width="1000px"
append-to-body
>
<el-table
v-loading="loading"
:data="userList"
@selection-change="handleSelectionUser"
height="450"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="人员账号"
align="center"
key="userName"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="人员名称"
align="center"
key="nickName"
prop="nickName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="所属机构"
align="center"
key="deptName"
prop="deptName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="角色"
align="center"
key="roleName"
prop="roleName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="联系电话"
align="center"
key="phonenumber"
prop="phonenumber"
width="120"
/>
<!-- <el-table-column
label="操作"
align="center"
width="160"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.userId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="addUser(scope.row)"
>添加</el-button>
</template>
</el-table-column>-->
</el-table>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="addUser">添加</el-button>
</div>
</el-dialog>
</div>
</template>
@ -463,6 +519,10 @@ import {
getPurchaseCheckInfo,
getAcceptanceForm,
purchaseCheckInfoRemove,
getNoticePeople,
getUserAll,
addNoticeUser,
bmNoticeInfo,
} from '@/api/baseGround/newBuy'
// import {
// getRepairedList,
@ -481,6 +541,7 @@ export default {
return {
//
loading: true,
loadingTwo: true,
updateTime:"",
//
ids: [],
@ -490,13 +551,22 @@ export default {
multiple: true,
//
showSearch: true,
showPeople: false,
peopleOpen: false,
//
total: 0,
totalTwo: 0,
//
typesList: [],
modelList: [],
//
typeList: [],
getListPeople:[],
configUserList: [],
phoneNumbers:[],
//
chosenUserList: [],
userList: [],
//
title: '',
//
@ -510,6 +580,9 @@ export default {
typeId: '',
keyWord: '',
},
form: {
remark: '',
},
openPrint: false,
printData: {},
printTableData: [],
@ -522,15 +595,43 @@ export default {
// this.getTypeList()
},
methods: {
getTypeList() {
getTypeList({ level: '3' }).then((response) => {
this.typesList = response.data
})
getTypeList({ level: '4' }).then((response) => {
this.modelList = response.data
// -
handleSelectionUser(selection) {
// console.log(selection)
this.chosenUserList = selection
},
//
addUser() {
if (this.chosenUserList.length < 1) {
this.$message.error('请选择人员!')
return
}
// console.log(this.chosenUserList,"chosenUserList")
addNoticeUser(this.chosenUserList).then((response) => {
if (response.code == 200) {
// this.getNoticeUserList()
this.peopleOpen = false
}
})
},
/** 查询所有用户列表--可添加人员 */
getAllUserList() {
getUserAll().then((response) => {
this.userList = response.rows
})
},
// 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 = {
@ -563,34 +664,96 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
// this.$tab.closeOpenPage({
// path: '/store/newBuy/newDevicesArrival',
// })
this.$emit('addTools')
},
/** 查看按钮操作 */
handleView(row) {
// let query = { taskId: row.taskId, isView: true }
// this.$tab
// .closeOpenPage({
// path: '/store/newBuy/newDevicesAccept',
// query,
// })
// .then(() => {
// this.$tab.refreshPage()
// })
this.$emit('queryTools', row.taskId)
},
/** 修改按钮操作 */
handleUpdate(row) {
// let query = { taskId: row.taskId }
// this.$tab.closeOpenPage({
// path: '/store/newBuy/newDevicesArrival',
// query,
// })
this.$emit('editTools', 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.$set(
this.form,
'remark',
'各位同事您好,请于' +
this.getNowTime() +
'在宏源工业园,进行机具验收。'
)
this.showPeople = true;
const taskId = row.taskId;
getNoticePeople({taskId: taskId}).then((response) => {
this.getListPeople = response.rows;
this.showPeople = true
this.loadingTwo = false
this.title = '通知'
})
},
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.showPeople = false;
this.reset();
},
//
reset() {
this.form = {};
this.resetForm("form");
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.taskId)
@ -641,9 +804,9 @@ export default {
//
handlePrint(row) {
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
// this.getPrintTable(row.taskId)
this.openPrint = true
this.title = '新购工机具验收单'
this.title = '机具设备到货验收单'
},
//
print() {
@ -665,17 +828,32 @@ export default {
})
.catch(() => {})
},
handleDeletePeople(row){
const ids = row.id
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return deletePeople(ids)
})
.then(() => {
this.handleNotice(row)
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/purchaseCheckInfo/export',
'material//purchase_check_info/export',
{
...this.queryParams,
},
`新购工机具验收_${new Date().getTime()}.xlsx`,
)
},
},
watch: {
$route: {
handler(to) {

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,18 @@
:pageContent="pageContent"
@goBack="goBack"
/>
<component :is="isShowComponent"
<component
:is="isShowComponent"
:isEdit="isEdit"
:editTaskId="editTaskId"
:queryTaskId="queryTaskId"
:isView="isView"
:codingTaskId="codingTaskId"
@addTools="addTools"/>
@addTools="addTools"
@editTools="editTools"
@addToolsSuccess="addToolsSuccess"
@queryTools="queryTools"
/>
</div>
</template>
@ -20,11 +25,13 @@
import PageHeader from "@/components/pageHeader";
import Home from "./component/home.vue"; //
import AddTools from './component/addTools.vue' //
import QueryTools from './component/queryTools.vue' //
export default {
components: {
Home,
PageHeader,
AddTools,
QueryTools
},
data() {
return {
@ -51,6 +58,20 @@ export default {
addToolsSuccess() {
this.isShowComponent = 'Home'
},
/* 编辑工机具 */
editTools(id) {
this.isEdit = true
this.pageContent = '编辑机具'
this.editTaskId = id
this.isShowComponent = 'AddTools'
},
/* 查询工机具 */
queryTools(id) {
this.isView = true
this.pageContent = '详情信息'
this.queryTaskId = id
this.isShowComponent = 'QueryTools'
},
/* 返回按钮 */
goBack() {
this.isShowComponent = "Home";

View File

@ -0,0 +1,914 @@
<template>
<!-- 新增工机具 -->
<div>
<el-form
:model="maForm"
ref="maForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="类型规格" prop="keyWord">
<el-input
v-model="maForm.keyWord"
placeholder="请输入类型规格"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机具厂家" prop="typeId">
<el-select
v-model="maForm.typeId"
placeholder="请选择机具厂家"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="typeItem in typesList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="出厂日期" prop="arrivalTime">
<el-date-picker
v-model="maForm.arrivalTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择出厂日期"
></el-date-picker>
</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="danger"
plain
icon="el-icon-plus"
size="mini"
@click="handleBackAll"
>驳回</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="equipmentList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column
align="center"
label="物资名称"
prop="materialName"
show-overflow-tooltip
></el-table-column>
<el-table-column
align="center"
label="规格型号"
prop="materialModel"
show-overflow-tooltip
/>
<el-table-column
align="center"
label="到货数量"
prop="checkNum"
show-overflow-tooltip
/>
<el-table-column align="center" label="单位" prop="unitName" />
<el-table-column
align="center"
label="供应商"
prop="supplierName"
show-overflow-tooltip
/>
<el-table-column
align="center"
label="出厂日期"
prop="productDate"
show-overflow-tooltip
/>
<el-table-column label="相关配套资料" align="center" prop="checkUrlName">
<!-- <template slot-scope="scope">
<div @click="openGt(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ '报告管理' }}
</div>
</template> -->
</el-table-column>
<el-table-column
align="center"
label="状态"
prop="statusName"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
>查看</el-button
>
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleUpload(scope.row)"
v-if="scope.row.statusName != '待入库'"
>下载</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-close"
@click="handleBack(scope.row)"
v-if="scope.row.statusName != '待入库'"
>驳回</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="maForm.pageNum"
:limit.sync="maForm.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="getListQr"
width="800px"
height="600px"
@selection-change="handleSelectionChangeQr"
>
<!-- <el-table-column label="序号" align="center" prop="userName" sortable /> -->
<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-column
label="二维码编码"
align="center"
prop="qrCode"
>
<template slot-scope="scope">
<span
style="color: blue; cursor: pointer"
@click="labelUploadCode(scope.row)"
>
{{ scope.row.qrCode }}</span
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryBind.pageNum"
:limit.sync="queryBind.pageSize"
@pagination="getListQr"
/>
</el-dialog>
<!-- 绑定查看弹窗 -->
<el-dialog
:title="titleTwo"
:visible.sync="showTwo"
width="1100px"
append-to-body
@close="cancel"
>
<el-form
:model="queryBindTwo"
ref="queryFormBind"
:rules="queryBindTwoRules"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="前缀" label-width="50px" prop="codePrefix">
<el-input
v-model="queryBindTwo.codePrefix"
placeholder="请输入前缀"
clearable
maxlength="20"
/>
</el-form-item>
<el-form-item
label="后缀起始值"
label-width="100px"
prop="codeSuffixStart"
>
<el-input
v-model="queryBindTwo.codeSuffixStart"
clearable
placeholder="请输入后缀起始值"
maxlength="99999999"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleAdd"
>填充</el-button
>
<el-button type="primary" size="mini" @click="handleBindTwo"
>绑定</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loadingTwo"
:data="codeTableList"
width="1000px"
height="600px"
>
<el-table-column label="设备名称" align="center" prop="materialName" />
<el-table-column label="规格型号" align="center" prop="materialModel" />
<el-table-column label="设备编码" align="center" prop="maCode" />
<el-table-column label="出厂编号" align="center" prop="outFacCode">
<template v-slot:default="{ row }">
<el-input
v-model="row.outFacCode"
placeholder="请输入出厂编码"
maxlength="30"
></el-input>
</template>
</el-table-column>
<el-table-column label="出厂时间" align="center" prop="productDate">
<template v-slot:default="{ row }">
<el-date-picker
v-model="row.productDate"
type="date"
placeholder="请输入检验时间"
style="width: 160px"
></el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
icon="el-icon-remove"
@click="handleRemove(scope.$index)"
>
移除
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 标签下载对话框 -->
<el-dialog
:title="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>
<!-- <img src="" alt="">-->
</div>
<div class="maCode">设备编号{{ rowObj.maCode }}</div>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="downloadCode"
> </el-button
>
</div>
</el-dialog>
<div style="background-color: transparent" ref="qrCodeAll">
<div
id="qrCode"
v-for="(codeItem, codeIndex) in checkboxModel"
:key="codeIndex"
class="captureId"
v-show="codeId"
ref="QrcodePage"
style="
z-index: -1111111;
position: absolute;
top: 10px;
left: -99999;
width: 450px;
height: 475px;
background-size: cover;
"
></div>
<!-- <center style="text-align: center; font-size: 1.5625rem">
{{ codeVal }}
</center> -->
</div>
</div>
</template>
<script>
// import {
// } from '@/api/store/newBuy'
import {
getPurchaseCheckInfo,
equipmentTypeTree,
addPurchaseCheckInfo,
// getPurchaseCheckInfo,
updatePurchaseCheckInfo,
} from "@/api/baseGround/newBuy";
import { getListDetail, getListDetailById,bindAllData,exportNewBuy } from "@/api/baseGround/newBuyBind";
import { downloadFile } from '@/utils/download'
import QRCode from 'qrcodejs2'
import html2canvas from 'html2canvas'
import JSZip from 'jszip'
import FileSaver from 'file-saver'
// import { getUserByRoleList } from '@/api/system/user'
// import { equipmentTypeTree, supplierInfoList } from '@/api/store/tools'
// import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// import HoldingpoleDialog from '@/components/HoldingpoleDialog/index.vue'
// import {} from '@/api/store/newBuy
export default {
name: 'BindQrTools',
// dicts: ['sys_normal_disable'],
// components: { Treeselect, HoldingpoleDialog },
props: {
editTaskId: {
type: [String, Number],
default: () => {
return "";
},
},
},
data() {
return {
taskId: "",
// isEdit: false,
//
loading: false,
loadingTwo: false,
typesList:[],
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
num: 0,
//
equipmentTypeList: [],
//
equipmentList: [],
getListQr:[],
//
title: "",
titleBind: "",
titleTwo: "",
//
open: false,
showBind: false,
showTwo: false,
//
dateRange: [],
queryBind: {
pageNum: 1,
pageSize: 10,
},
queryBindTwo: {
codePrefix: undefined,
codeSuffixStart: undefined,
},
//
queryParams: {
equipmentId: undefined,
productionTime: "",
supplierId: "",
},
maForm: {
pageNum: 1,
pageSize: 10,
taskId:undefined,
},
//
form: {},
materialName: undefined,
materialModel: undefined,
codeTableList: [],
codeTableListTemp: [],
productDate: undefined,
taskIdTemp:undefined,
typeIdTemp:undefined,
rowObj:{},
labelmaCode: '',
uploadOpen: false,
qrUrl: this.globalUrl.qrUrl,
checkboxModel: [], //
qrcodeArr:[],
codeId: true,
queryBindTwoRules: {
codePrefix: [
{ required: true, message: "请输入前缀", trigger: "blur" },
],
codeSuffixStart: [
{
required: true,
message: "请输入后缀起始值",
trigger: "blur",
},
{
pattern: /^[1-9][0-9]*$/,
message: "请输入大于0且不能以0开头的正整数",
},
],
},
};
},
computed: {
pickerOptions() {
return {
disabledDate(time) {
const currentDate = new Date();
currentDate.setHours(0, 0, 0, 0);
return time.getTime() < currentDate.getTime();
},
};
},
},
watch: {
// 'maForm.purchaseTime'() {
// if (this.maForm.purchaseTime != '') {
// // this.maForm.arrivalTime = ''
// }
// },
},
mounted() {
this.taskId = this.editTaskId;
this.maForm.taskId = this.taskId;
this.getTaskInfo();
// this.getUserList()
// this.getList();
// this.supplierInfoList()
},
methods: {
handleSelectionChangeQr(selection){
this.checkboxModel = selection
// this.checkboxModel.forEach((item) => {
// item.exportUrl = this.qrUrl + item.qrCode
// })
this.single = selection.length != 1
this.multiple = !selection.length
},
async handleDownloadQr() {
this.codeId = true;
console.log('checkboxModel', this.checkboxModel)
if(this.checkboxModel.length>0){
const msg = this.$modal.loading('批量生成中,请稍候...')
let that = this
try {
let captureId = document.getElementsByClassName('captureId')
for (let i = 0; i < this.checkboxModel.length; i++) {
const element = this.checkboxModel[i]
captureId[i].innerHTML = ''
let shareContent = that.$refs['QrcodePage'][i],
width = shareContent.offsetWidth,
height = shareContent.offsetHeight
const maCodeText = document.createElement('div')
maCodeText.innerHTML = '编码:' + element
maCodeText.style =
'font-size=18px; width:100%;text-align:center;margin:10px;'
shareContent.appendChild(maCodeText)
console.log(element)
new QRCode(captureId[i], {
width: width,
height: height,
text: this.qrUrl + element.qrCode,
colorDark: '#000',
colorLight: '#fff',
})
let canvas = document.createElement('canvas'),
scale = 0.9
canvas.width = width * scale
canvas.height = height * scale
canvas.style.width =
(shareContent.clientWidth * scale) / 100 + 'px'
canvas.style.height =
(shareContent.clientHeight * scale) / 100 + 'px'
canvas.getContext('2d').scale(scale, scale)
let opts = {
scale: scale,
canvas: canvas,
logging: false,
width: width,
height: height,
useCORS: true,
}
await html2canvas(shareContent, opts)
.then(function (canvas) {
const qrContentImage = canvas.toDataURL(
'image/jpeg',
1.0,
)
if (i <= that.checkboxModel.length - 1) {
that.qrcodeArr.push({
url: qrContentImage,
name: element,
})
}
})
.catch(function (reason) {
console.log(reason)
this.$emit('clearCheck')
that.$modal.closeLoading()
})
}
await new Promise((resolve) => setTimeout(resolve, 2000))
that.packageImages()
setTimeout(msg, 1000)
that.$modal.closeLoading()
} catch (error) {
setTimeout(msg, 1000)
// that.getList()
this.$emit('clearCheck')
that.$modal.closeLoading()
}
}else{
this.$modal.msgError("请先选择导出设备");
}
},
//
packageImages() {
let that = this
const zip = new JSZip()
const cache = {}
let arr = that.qrcodeArr
arr.forEach((item, index) => {
let fileName = item.name
zip.file(fileName + '.png', item.url.substring(22), {
base64: true,
})
cache[fileName] = item.url
})
zip.generateAsync({ type: 'blob' }).then((content) => {
FileSaver.saveAs(content, '二维码.zip')
})
// that.getList()
this.$emit('clearCheck')
that.qrcodeArr = []
that.codeId = false;
},
//
labelUploadCode(row) {
// if (row.maCode == null) {
// this.$message.error('');
// return
// }
this.rowObj = row
this.uploadOpen = true
this.title = '二维码查看'
this.labelmaCode = row.qrCode
let str = this.qrUrl + row.qrCode
console.log('qrUrl',this.qrUrl)
console.log('str',str)
this.$nextTick(() => {
// this.selectionList.forEach((item, index) => {
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.labelmaCode
alink.click()
})
}
},
resetQuery(){
},
/** 新增按钮操作 */
handleBackAll() {},
//---
getTaskInfo() {
this.maForm.pageNum = 1;
this.getList();
},
//---
handleQuery() {
this.maForm.pageNum = 1;
this.getList();
},
getList(){
this.loading = true;
getListDetail(this.maForm).then((response) => {
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handleView(row) {
this.loadingTwo = true;
getListDetailById({ taskId: row.taskId, typeId: row.typeId }).then(
(response) => {
this.getListQr = response.data;
this.showBind = true;
this.titleBind = "查看";
this.loadingTwo = false;
}
);
},
//
handleBind(row) {
this.queryBindTwo = {};
this.resetForm("queryFormBind");
this.titleTwo = "绑定";
this.showTwo = true;
this.num = row.checkNum;
this.materialName = row.materialName;
this.materialModel = row.materialModel;
this.productDate = row.productDate;
this.taskIdTemp = row.taskId;
this.typeIdTemp = row.typeId;
},
//
handleAdd() {
this.$refs["queryFormBind"].validate((valid) => {
if (valid) {
this.codeTableList = [];
// :
for (let i = 0; i < this.num; i++) {
let suffix = parseInt(this.queryBindTwo.codeSuffixStart) + i;
suffix = suffix.toString().padStart(5, "0");
console.log("suffix", suffix);
suffix = isNaN(suffix) ? "" : suffix;
console.log("suffixTwo", suffix);
const maCode = `${this.queryBindTwo.codePrefix || ""}${suffix}`;
console.log("maCode", maCode);
//
const outFacCode = "";
const materialName = this.materialName;
const materialModel = this.materialModel;
const productDate = this.productDate;
this.codeTableList.push({
materialName,
materialModel,
maCode,
outFacCode,
productDate,
});
}
}
});
},
handleBindTwo(){
this.codeTableList.forEach(item=>{
this.codeTableListTemp.push({maCode:item.maCode,outFacCode:item.outFacCode,productDate:item.productDate})
})
bindAllData({taskId:this.taskIdTemp,typeId:this.typeIdTemp,dtoList:this.codeTableListTemp}).then(
(response) => {
this.$modal.msgSuccess("绑定成功");
this.getList();
this.showTwo = false
},
)
},
handleRemove(index){
this.codeTableList.splice(index,1)
},
cancel() {
this.codeTableList = [];
this.showTwo = false;
this.reset();
},
reset() {
this.resetForm("queryFormBind");
},
//
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
(this.menuExpand = false),
(this.menuNodeAll = false),
(this.deptExpand = true),
(this.deptNodeAll = false),
(this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
});
this.resetForm("form");
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.roleId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
// this.form = response.data;
// this.open = true;
},
/** 明细按钮操作 */
handleDetail(row) {
this.holdingpoleData = row;
this.showDialog = true;
},
/** 删除按钮操作 */
handleBack(row) {
// console.log(row.id)
this.$modal
.confirm("是否确认删除所选择的数据项?")
.then(() => {
this.deviceType.forEach((e, index) => {
if (e[3] === row.typeId) {
this.deviceType.splice(index, 1);
this.propsKey++;
}
});
this.equipmentList.forEach((item, index) => {
if (item.id == row.id) {
this.equipmentList.splice(index, 1);
}
});
})
.catch(() => {});
// const roleIds = row.roleId || this.ids;
// this.$modal.confirm('"' + roleIds + '"').then(function() {
// return delRole(roleIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出二维码按钮操作 */
handleUpload(row) {
exportNewBuy({purchaseId:row.purchaseId}).then(res => {
downloadFile({ fileName: `二维码_${new Date().getTime()}.zip`, fileData: res, fileType: 'application/zip;charset=utf-8' })
})
}
},
};
</script>
<style lang="scss">
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.maCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
.popper-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
display: block !important;
}
}
</style>

View File

@ -0,0 +1,665 @@
<template>
<!-- 新增工机具 -->
<div>
<el-form
:model="maForm"
ref="maForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="类型规格" prop="keyWord">
<el-input
v-model="maForm.keyWord"
placeholder="请输入类型规格"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机具厂家" prop="typeId">
<el-select
v-model="maForm.typeId"
placeholder="请选择机具厂家"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="typeItem in typesList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="出厂日期" prop="arrivalTime">
<el-date-picker
v-model="maForm.arrivalTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择出厂日期"
></el-date-picker>
</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="danger"
plain
icon="el-icon-plus"
size="mini"
@click="handleBackAll"
>驳回</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="equipmentList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column
align="center"
label="物资名称"
prop="materialName"
show-overflow-tooltip
></el-table-column>
<el-table-column
align="center"
label="规格型号"
prop="materialModel"
show-overflow-tooltip
/>
<el-table-column
align="center"
label="到货数量"
prop="checkNum"
show-overflow-tooltip
/>
<el-table-column align="center" label="单位" prop="unitName" />
<el-table-column
align="center"
label="供应商"
prop="supplierName"
show-overflow-tooltip
/>
<el-table-column
align="center"
label="出厂日期"
prop="productDate"
show-overflow-tooltip
/>
<el-table-column label="相关配套资料" align="center" prop="checkUrlName">
<!-- <template slot-scope="scope">
<div @click="openGt(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ '报告管理' }}
</div>
</template> -->
</el-table-column>
<el-table-column
align="center"
label="状态"
prop="statusName"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
v-if="scope.row.statusName == '待入库'"
>查看</el-button
>
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleBind(scope.row)"
v-if="scope.row.statusName != '待入库'"
>绑定</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-close"
@click="handleBack(scope.row)"
v-if="scope.row.statusName != '待入库'"
>驳回</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="maForm.pageNum"
:limit.sync="maForm.pageSize"
@pagination="getListPeople"
/>
<!-- 新购查看弹窗 -->
<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="getListPeople"
width="800px"
height="600px"
>
<!-- <el-table-column label="序号" align="center" prop="userName" sortable /> -->
<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="getListPeople"
/>
</el-dialog>
<!-- 绑定查看弹窗 -->
<el-dialog
:title="titleTwo"
:visible.sync="showTwo"
width="1100px"
append-to-body
@close="cancel"
>
<el-form
:model="queryBindTwo"
ref="queryFormBind"
:rules="queryBindTwoRules"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="前缀" label-width="50px" prop="codePrefix">
<el-input
v-model="queryBindTwo.codePrefix"
placeholder="请输入前缀"
clearable
maxlength="20"
/>
</el-form-item>
<el-form-item
label="后缀起始值"
label-width="100px"
prop="codeSuffixStart"
>
<el-input
v-model="queryBindTwo.codeSuffixStart"
clearable
placeholder="请输入后缀起始值"
maxlength="99999999"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleAdd"
>填充</el-button
>
<el-button type="primary" size="mini" @click="handleBindTwo"
>绑定</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loadingTwo"
:data="codeTableList"
width="1000px"
height="600px"
>
<el-table-column label="设备名称" align="center" prop="materialName" />
<el-table-column label="规格型号" align="center" prop="materialModel" />
<el-table-column label="设备编码" align="center" prop="maCode" />
<el-table-column label="出厂编号" align="center" prop="outFacCode">
<template v-slot:default="{ row }">
<el-input
v-model="row.outFacCode"
placeholder="请输入出厂编码"
maxlength="30"
></el-input>
</template>
</el-table-column>
<el-table-column label="出厂时间" align="center" prop="productDate">
<template v-slot:default="{ row }">
<el-date-picker
v-model="row.productDate"
type="date"
placeholder="请输入检验时间"
style="width: 160px"
></el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
icon="el-icon-remove"
@click="handleRemove(scope.$index)"
>
移除
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
// import {
// } from '@/api/store/newBuy'
import {
getPurchaseCheckInfo,
equipmentTypeTree,
addPurchaseCheckInfo,
// getPurchaseCheckInfo,
updatePurchaseCheckInfo,
} from "@/api/baseGround/newBuy";
import { getListDetail, getListDetailById,bindAllData } from "@/api/baseGround/newBuyBind";
// import { getUserByRoleList } from '@/api/system/user'
// import { equipmentTypeTree, supplierInfoList } from '@/api/store/tools'
// import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// import HoldingpoleDialog from '@/components/HoldingpoleDialog/index.vue'
// import {} from '@/api/store/newBuy'
export default {
name: "BindTools",
dicts: ["sys_normal_disable"],
// components: { Treeselect, HoldingpoleDialog },
props: {
editTaskId: {
type: [String, Number],
default: () => {
return "";
},
},
},
data() {
return {
taskId: "",
// isEdit: false,
//
loading: false,
loadingTwo: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
num: 0,
//
equipmentTypeList: [],
//
equipmentList: [],
//
title: "",
titleBind: "",
titleTwo: "",
//
open: false,
showBind: false,
showTwo: false,
//
dateRange: [],
queryBind: {
pageNum: 1,
pageSize: 10,
},
queryBindTwo: {
codePrefix: undefined,
codeSuffixStart: undefined,
},
//
queryParams: {
equipmentId: undefined,
productionTime: "",
supplierId: "",
},
maForm: {
pageNum: 1,
pageSize: 10,
taskId:undefined,
},
//
form: {},
materialName: undefined,
materialModel: undefined,
codeTableList: [],
codeTableListTemp: [],
productDate: undefined,
taskIdTemp:undefined,
typeIdTemp:undefined,
queryBindTwoRules: {
codePrefix: [
{ required: true, message: "请输入前缀", trigger: "blur" },
],
codeSuffixStart: [
{
required: true,
message: "请输入后缀起始值",
trigger: "blur",
},
{
pattern: /^[1-9][0-9]*$/,
message: "请输入大于0且不能以0开头的正整数",
},
],
},
};
},
computed: {
pickerOptions() {
return {
disabledDate(time) {
const currentDate = new Date();
currentDate.setHours(0, 0, 0, 0);
return time.getTime() < currentDate.getTime();
},
};
},
},
watch: {
// 'maForm.purchaseTime'() {
// if (this.maForm.purchaseTime != '') {
// // this.maForm.arrivalTime = ''
// }
// },
},
mounted() {
this.taskId = this.editTaskId;
this.maForm.taskId = this.taskId;
this.getTaskInfo();
// this.getUserList()
// this.getList();
// this.supplierInfoList()
},
methods: {
/** 新增按钮操作 */
handleBackAll() {},
//---
getTaskInfo() {
this.maForm.pageNum = 1;
this.getList();
},
//---
handleQuery() {
this.maForm.pageNum = 1;
this.getList();
},
getList(){
this.loading = true;
getListDetail(this.maForm).then((response) => {
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handleView(row) {
this.loadingTwo = true;
getListDetailById({ taskId: row.taskId, typeId: row.typeId }).then(
(response) => {
this.getListBind = response.rows;
this.showBind = true;
this.titleBind = "查看";
this.loadingTwo = false;
}
);
},
//
handleBind(row) {
this.queryBindTwo = {};
this.resetForm("queryFormBind");
this.titleTwo = "绑定";
this.showTwo = true;
this.num = row.checkNum;
this.materialName = row.materialName;
this.materialModel = row.materialModel;
this.productDate = row.productDate;
this.taskIdTemp = row.taskId;
this.typeIdTemp = row.typeId;
},
//
handleAdd() {
this.$refs["queryFormBind"].validate((valid) => {
if (valid) {
this.codeTableList = [];
// :
for (let i = 0; i < this.num; i++) {
let suffix = parseInt(this.queryBindTwo.codeSuffixStart) + i;
suffix = suffix.toString().padStart(5, "0");
console.log("suffix", suffix);
// console.log('🚀 ~ fillCodeForm ~ suffix:', suffix);
suffix = isNaN(suffix) ? "" : suffix;
console.log("suffixTwo", suffix);
const maCode = `${this.queryBindTwo.codePrefix || ""}${suffix}`;
console.log("maCode", maCode);
//
const outFacCode = "";
const materialName = this.materialName;
const materialModel = this.materialModel;
const productDate = this.productDate;
// const productDate = this.queryBindTwo.productDate
this.codeTableList.push({
materialName,
materialModel,
maCode,
outFacCode,
productDate,
});
}
}
});
},
handleBindTwo(){
this.codeTableList.forEach(item=>{
this.codeTableListTemp.push({maCode:item.maCode,outFacCode:item.outFacCode,productDate:item.productDate})
})
bindAllData({taskId:this.taskIdTemp,typeId:this.typeIdTemp,dtoList:this.codeTableListTemp}).then(
(response) => {
this.$modal.msgSuccess("绑定成功");
this.getList();
this.showTwo = false
},
)
},
handleRemove(index){
this.codeTableList.splice(index,1)
},
cancel() {
this.codeTableList = [];
this.showTwo = false;
this.reset();
},
reset() {
this.resetForm("queryFormBind");
},
//
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
(this.menuExpand = false),
(this.menuNodeAll = false),
(this.deptExpand = true),
(this.deptNodeAll = false),
(this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
});
this.resetForm("form");
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.roleId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
// this.form = response.data;
// this.open = true;
},
/** 明细按钮操作 */
handleDetail(row) {
this.holdingpoleData = row;
this.showDialog = true;
},
/** 删除按钮操作 */
handleBack(row) {
// console.log(row.id)
this.$modal
.confirm("是否确认删除所选择的数据项?")
.then(() => {
this.deviceType.forEach((e, index) => {
if (e[3] === row.typeId) {
this.deviceType.splice(index, 1);
this.propsKey++;
}
});
this.equipmentList.forEach((item, index) => {
if (item.id == row.id) {
this.equipmentList.splice(index, 1);
}
});
})
.catch(() => {});
// const roleIds = row.roleId || this.ids;
// this.$modal.confirm('"' + roleIds + '"').then(function() {
// return delRole(roleIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
},
};
</script>
<style lang="scss">
.popper-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
display: block !important;
}
}
</style>

View File

@ -0,0 +1,575 @@
<template>
<div>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="50px"
>
<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="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="设备状态" prop="status" label-width="100px">
<el-select
v-model="queryParams.status"
placeholder="请选择设备状态"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="typeItem in typesList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord" label-width="100px">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</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="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="bindList"
@selection-change="handleSelectionChange"
border
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
label="序号"
type="index"
/>
<el-table-column
align="center"
label="到货时间"
prop="arrivalTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购单号"
align="center"
prop="purchaseCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购物资"
align="center"
prop="purchaseMaterial"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
: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="statusName"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
>查看</el-button
>
<el-button
size="mini"
type="warning"
icon="el-icon-paperclip"
@click="handleBind(scope.row)"
v-hasPermi="['newPurchase:tools:edit']"
>编码绑定</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-close"
@click="handleNotice(scope.row)"
v-if="scope.row.statusName != '已驳回'"
>驳回</el-button
>
<el-button
size="mini"
type="success"
icon="success"
@click="handleBindQr(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="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/baseGround/newBuy'
import {
getListNewBuyBind,
getListDetail,
} from '@/api/baseGround/newBuyBind'
// import {
// getRepairedList,
// getRepairedDetailList,
// inputByType,
// getTypeList,
// } from '@/api/store/warehousing'
// import vueEasyPrint from 'vue-easy-print'
// import { getLeaseAuditListAll } from '@/api/claimAndRefund/receive'
export default {
name: 'Home',
dicts: ['sys_normal_disable'],
// components: { vueEasyPrint },
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: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
time: null, //
name: undefined,
typeId: '',
keyWord: '',
},
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,
}
getListNewBuyBind(this.addDateRange(params)).then(
(response) => {
this.bindList = 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()
},
// /** */
// 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
})
},
/** 编码绑定按钮操作 */
handleBind(row) {
this.$emit('bindTools', row.taskId)
},
/** 编码绑定按钮操作 */
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 = '通知'
})
},
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('删除成功')
})
.catch(() => {})
},
handleDeletePeople(row){
const ids = row.id
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return deletePeople(ids)
})
.then(() => {
this.handleNotice(row)
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/purchase_check_info/export',
{
...this.queryParams,
},
`新购工机具验收_${new Date().getTime()}.xlsx`,
)
},
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,79 @@
<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>
</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' //
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";
},
},
};
</script>

226
src/views/qrCode/qrCode.vue Normal file
View File

@ -0,0 +1,226 @@
<template>
<div style="width: 100%">
<div style="width: 100%; padding: 10px">
<div class="item-box">
<div>设备类型:</div>
<div style="margin-left: 10px; color: blue">{{
queryParams.deviceType
}}</div>
</div>
<div class="item-box">
<div>规格型号:</div>
<div style="margin-left: 10px">
{{ queryParams.specificationType }}</div
>
</div>
<div class="item-box">
<div>二维码编码:</div>
<div style="margin-left: 10px">{{ queryParams.qrCode }}</div>
</div>
<div class="item-box">
<div>设备编码:</div>
<div style="margin-left: 10px">{{ queryParams.maCode }}</div>
</div>
<div class="item-box">
<div>设备状态:</div>
<div style="margin-left: 10px">{{
queryParams.maStatusName
}}</div>
</div>
<!-- <div class="item-box">
<div >本次检修人员:</div>
<div style="margin-left: 10px;">{{queryParams.checkMan}}</div>
</div> -->
<div class="item-box">
<div>本次检修时间:</div>
<div style="margin-left: 10px; color: blue">{{
queryParams.thisCheckTime
}}</div>
</div>
<div class="item-box">
<div>下次检修时间:</div>
<div style="margin-left: 10px; color: blue">{{
queryParams.nextCheckTime
}}</div>
</div>
<div class="item-box">
<div>检验人员:</div>
<div style="margin-left: 10px">{{ queryParams.checkMan }}</div>
</div>
<div class="item-box">
<div>检验结论:</div>
<div style="margin-left: 10px; color: blue">{{
queryParams.inspectStatus || '合格'
}}</div>
</div>
<div class="item-box">
<div>联系电话:</div>
<div style="margin-left: 10px">{{ queryParams.phone }}</div>
</div>
<div class="item-box">
<div>生产厂家:</div>
<div style="margin-left: 10px">{{ queryParams.maVender }}</div>
</div>
<div class="item-box">
<div>出厂日期:</div>
<div style="margin-left: 10px">{{
queryParams.outFacTime
}}</div>
</div>
<div class="item-box">
<div>出入库次数:</div>
<div style="margin-left: 10px">{{ queryParams.inOutNum }}</div>
</div>
<div class="item-box">
<div>领料单位:</div>
<div style="margin-left: 10px"
>{{ queryParams.leaseUnit }}
</div>
</div>
<div class="item-box">
<div>领料工程:</div>
<div style="margin-left: 10px">{{ queryParams.leasePro }} </div>
</div>
<div class="item-box">
<div>领料时间:</div>
<div style="margin-left: 10px"
>{{ queryParams.leaseTime }}
</div>
</div>
<div class="item-box">
<div>退料单位:</div>
<div style="margin-left: 10px">{{ queryParams.backUnit }} </div>
</div>
<div class="item-box">
<div>退料工程:</div>
<div style="margin-left: 10px">{{ queryParams.backPro }} </div>
</div>
<div class="item-box">
<div>退料时间:</div>
<div style="margin-left: 10px">{{ queryParams.backTime }} </div>
</div>
</div>
<div class="bottom-box">
<div
style="
width: 100%;
text-align: center;
margin-bottom: 20px;
color: green;
margin-top: 10px;
"
>
</div>
<div style="width: 50%; display: flex; margin-bottom: 10px">
<div style="color: green"> </div>
<div style="border-bottom: 1px solid green">{{
queryParams.deviceType
}}</div>
</div>
<div style="width: 50%; display: flex; margin-bottom: 10px">
<div style="color: green">检验结论</div>
<div style="color: red; font-size: 18px; font-weight: 600">{{
queryParams.inspectStatus || '合格'
}}</div>
</div>
<div style="width: 100%; display: flex; margin-bottom: 10px">
<div style="color: green"> </div>
<div style="border-bottom: 1px solid green">{{
queryParams.specificationType
}}</div>
</div>
<div style="width: 100%; display: flex; margin-bottom: 10px">
<div style="color: green"> </div>
<div style="border-bottom: 1px solid green">{{
queryParams.maCode
}}</div>
</div>
<div style="width: 100%; display: flex; margin-bottom: 10px">
<div style="color: green">本次检验日期</div>
<div style="border-bottom: 1px solid green">{{
queryParams.thisCheckTime
}}</div>
</div>
<div style="width: 100%; display: flex; margin-bottom: 10px">
<div style="color: green">下次检验日期</div>
<div style="border-bottom: 1px solid green">{{
queryParams.nextCheckTime
}}</div>
</div>
<div style="position: absolute; top: 0%; left: 25%">
<canvas id="canvas" width="180" height="180"></canvas>
</div>
</div>
</div>
</template>
<script>
import chapter from '../../utils/chapter'
import { getMachineByQrCode } from '@/api/base/base'
export default {
data() {
return {
qrCode: '',
queryParams: {
deviceType: '', //
specificationType: '', //
qrCode: '', //
maCode: '', //
maStatusName: '', //
checkMan: '', //
thisCheckTime: '', //
nextCheckTime: '', //
// maStatusName:'',//
inspectMan: '', //
inspectStatus: '', //
phone: '', //
maVender: '', //
outFacTime: '', //
inOutNum: '', //
leaseUnit: '', //
leasePro: '', //
leaseTime: '', //
backUnit: '', // 退
backPro: '', // 退
backTime: '', // 退
},
}
},
created() {
this.qrCode = this.$route.query.qrCode
// console.log(this.qrCode)
this.getMachineByQrCode()
},
mounted() {
chapter('机具检验专用章', '重庆送变电工程有限公司')
},
methods: {
getMachineByQrCode() {
let param = {
qrCode: this.qrCode,
}
getMachineByQrCode(param).then((response) => {
console.log(response, '返回结果-----')
this.queryParams = response.data
})
},
},
}
</script>
<style lang="scss" scoped>
.item-box {
display: flex;
width: 100%;
border-bottom: 1px solid green;
margin-bottom: 10px;
}
.bottom-box {
display: flex;
width: 99%;
border: 4px solid rgb(2, 196, 2);
flex-wrap: wrap;
margin: auto;
position: relative;
}
</style>