新购验收编码管理-1221-zzy

This commit is contained in:
zhouzy062 2023-12-21 20:24:30 +08:00
parent 5564d3d391
commit bb40579796
7 changed files with 628 additions and 319 deletions

View File

@ -1,5 +1,5 @@
import request from '@/utils/request'
// 查询列表
// 查询新购任务列表
export function listPurchaseCheckInfo(query) {
return request({
url: '/material/purchaseCheckInfo/list',
@ -7,7 +7,7 @@ export function listPurchaseCheckInfo(query) {
params: query
})
}
//新增任务
//新增新购任务
export function addPurchaseCheckInfo(data) {
return request({
url: '/material/purchaseCheckInfo',
@ -15,12 +15,20 @@ export function listPurchaseCheckInfo(query) {
data: data
})
}
//任务 详情
export function getPurchaseCheckInfo(taskId) {
//编辑新购任务
export function updatePurchaseCheckInfo(data) {
return request({
url: '/material/purchaseCheckInfo/' + taskId,
method: 'get'
url: '/material/purchaseCheckInfo',
method: 'put',
data: data
})
}
//任务 详情
export function getPurchaseCheckInfo(query) {
return request({
url: '/material/purchaseCheckInfo/getDetails',
method: 'get',
params: query
})
}
//消息通知
@ -83,9 +91,47 @@ export function delMacode(taskIds) {
}
//新购验收-编号管理-绑定弹窗详情列表
export function getMacodeList(query) {
return request({
url: '/material/purchaseMacode/list',
method: 'get',
params: query
})
}
//新购验收-编号管理-绑定弹窗详情列表
export function getMacodeDetailList(query) {
return request({
url: '/material/purchaseMacode/getInfo',
method: 'get',
params: query
})
}
//新购验收-编号管理-生成编码
export function makeEquipmentNumber(data) {
return request({
url: '/material/purchaseMacode/equipmentNumber',
method: 'post',
data: data
})
}
//新购验收-编号管理-保存
export function editPurchaseMacode(data) {
return request({
url: '/material/purchaseMacode',
method: 'post',
data: data
})
}
// 删除
export function delMacodeList(maCode) {
return request({
url: '/material/purchaseMacode/' + maCode,
method: 'delete'
})
}

View File

@ -1,9 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="名称" prop="dictName">
<el-form-item label="名称" prop="keyWord">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.keyWord"
placeholder="请输入名称"
clearable
style="width: 240px"
@ -20,32 +20,29 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
type="success"
plain
icon="el-icon-plus"
size="mini"
@click="handleNotice"
>通知</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="jumpList"
>采购验收管理</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="multiple"
@click="handleListCheck"
>批量验收</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
@ -54,9 +51,7 @@
size="mini"
@click="handleExport"
>导出</el-button>
</el-col> -->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
</el-col> -->
</el-row>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
@ -73,8 +68,11 @@
<el-table-column label="机具厂家" align="center" prop="supplier" :show-overflow-tooltip="true" />
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true" />
<el-table-column label="验收数量" align="center" prop="checkNum" :show-overflow-tooltip="true" />
<el-table-column label="是否已具备设备自编号" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="验收图片" align="center" prop="checkUrl" :show-overflow-tooltip="true" />
<el-table-column label="验收图片" align="center" prop="checkUrlName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span @click="openImg(scope.row.checkUrl)" style="color: #02A7F0;"> {{ scope.row.checkUrlName }} </span>
</template>
</el-table-column>
<el-table-column label="配套资料" align="center" prop="fileName" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status" width="180">
<template slot-scope="scope">
@ -96,23 +94,12 @@
type="text"
icon="el-icon-edit"
>编码管理</el-button> -->
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(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="open" width="600px" append-to-body>
@ -123,18 +110,27 @@
<el-form-item label="规格型号" prop="specificationType">
<el-input v-model="form.specificationType" placeholder="" disabled />
</el-form-item>
<el-form-item label="验收数量" prop="checkNum">
<el-input v-model="form.checkNum" placeholder="" disabled/>
<el-form-item label="采购数量" prop="purchaseNum">
<el-input v-model="form.purchaseNum" placeholder="" disabled/>
</el-form-item>
<el-form-item label="验收结论" prop="checkResult">
<el-radio v-model="form.checkResult" label="通过">通过</el-radio>
<el-radio v-model="form.checkResult" label="不通过">不通过</el-radio>
</el-form-item>
<el-form-item label="验收通过数量" prop="inputNum">
<el-input-number v-model="form.inputNum" style="width:100%;" controls-position="right" :min="0" />
<el-form-item label="验收通过数量" prop="checkNum">
<el-input-number v-model="form.checkNum" style="width:100%;" controls-position="right" :min="0" :max="form.purchaseNum" />
</el-form-item>
<el-form-item label="验收图片" prop="checkUrl">
<el-input v-model="form.checkUrl" placeholder="图片上传" />
<el-upload
:http-request="(obj) => imgUpLoad(obj,'fileUrl')"
action="#"
:file-list="fileList"
:show-file-list="false"
list-type="picture-card"
accept=".png,.jpg,.jpeg">
<img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
@ -143,6 +139,33 @@
</div>
</el-dialog>
<!-- 批量验收弹窗 -->
<el-dialog :title="title" :visible.sync="openAll" width="600px" append-to-body>
<el-form ref="aform" :model="aform" :rules="arules" label-width="120px">
<el-form-item label="验收结论" prop="checkResult">
<el-radio v-model="aform.checkResult" label="通过">通过</el-radio>
<el-radio v-model="aform.checkResult" label="不通过">不通过</el-radio>
</el-form-item>
<el-form-item label="验收图片" prop="checkUrl">
<el-upload
:http-request="(obj) => imgUpLoad(obj,'fileUrl')"
action="#"
:file-list="fileList"
:show-file-list="false"
list-type="picture-card"
accept=".png,.jpg,.jpeg">
<img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitListForm"> </el-button>
<el-button @click="openAll=false"> </el-button>
</div>
</el-dialog>
<!-- 通知弹窗 -->
<el-dialog :title="title" :visible.sync="noticeOpen" width="1000px" append-to-body>
<el-form ref="nform" :model="nform" :rules="nrules" label-width="100px">
@ -151,7 +174,7 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="noticeUserList" height="500">
<el-table v-loading="loading" :data="noticeUserList" height="400">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column label="序号" align="center" key="userId" prop="userId" />
<el-table-column label="人员名称" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" />
@ -213,6 +236,9 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
@ -220,6 +246,7 @@
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getPurchaseCheckInfo,bmNoticeInfo,updatePurchaseCheckDetails } from "@/api/store/newBuy";
import { getUserByRoleList } from "@/api/system/user";
import { imgUpLoad,fileUpLoad } from "@/api/system/upload";
export default {
name: "Dict",
@ -254,16 +281,26 @@ export default {
title: "",
//
open: false,
openAll: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
keyWord: undefined,
},
//---
imageUrl:'',
imageName:'',
fileList:[],
field101fileList:[],
//
uploadUrl:'http://192.168.0.14:21624/system',//线+system
// uploadUrl:'http://10.40.92.140:9201',//
dialogImageUrl: '',
dialogVisible: false,
//--------------
//
form: {},
//
@ -271,12 +308,23 @@ export default {
checkResult: [
{ required: true, message: "验收结论不能为空", trigger: "blur" }
],
inputNum: [
checkNum: [
{ required: true, message: "验收通过数量不能为空", trigger: "blur" }
],
checkUrl: [
{ required: true, message: "验收图片不能为空", trigger: "blur" }
],
},
//
aform: {},
//
arules: {
checkResult: [
{ required: true, message: "验收结论不能为空", trigger: "blur" }
],
checkUrl: [
{ required: true, message: "验收图片不能为空", trigger: "blur" }
],
},
peopleOpen:false,
noticeOpen:false,
@ -303,29 +351,17 @@ export default {
//-
getTaskInfo(){
this.loading = true;
getPurchaseCheckInfo(this.taskId).then(response => {
getPurchaseCheckInfo({taskId:this.taskId,keyWord:this.queryParams.keyWord}).then(response => {
this.taskInfo = response.data
this.equipmentList = response.data.checkDetailsList;
this.loading = false;
})
},
//
jumpList(){
const obj = { path: "/store/newBuy/newDevicesList" }
this.$tab.closeOpenPage(obj);
},
/** 查询字典类型列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
//
cancel() {
this.open = false;
@ -347,7 +383,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.getTaskInfo();
},
/** 重置按钮操作 */
resetQuery() {
@ -409,9 +445,9 @@ export default {
})
},
configNotice(){
console.log(this.nform.notice,'message')
console.log(this.taskInfo.taskId,'taskId')
console.log(this.noticeUserList,'bmNoticeInfoList')
// console.log(this.nform.notice,'message')
// console.log(this.taskInfo.taskId,'taskId')
// console.log(this.noticeUserList,'bmNoticeInfoList')
this.noticeUserList.forEach((item,index)=>{
item.noticeUser = item.userId;
item.phone = item.phonenumber;
@ -429,7 +465,7 @@ export default {
type: 'success'
})
this.noticeOpen = false
this.getTaskInfo()
}
})
@ -437,32 +473,45 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.ids = selection.map(item => item)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
/** 验收按钮操作 */
handleCheck(row) {
// this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
console.log(row)
let rowData = row
rowData.checkNum = rowData.purchaseNum;
rowData.checkResult = rowData.purchaseNum || "通过";
this.form = rowData;
this.open = true;
this.imageUrl = rowData.checkUrl
this.title = "验收";
// });
},
/** 批量验收按钮操作 */
handleListCheck() {
console.log(this.ids)
this.aform = {
checkResult:'通过',
checkUrl:'',
checkUrlName:'',
};
this.imageUrl = ''
this.openAll = true;
this.title = "批量验收";
},
/** 提交按钮 */
submitForm: function() {
console.log(this.form)
let equipments = [this.form]
console.log(equipments)
this.$refs["form"].validate(valid => {
if (valid) {
let param = [this.form]
updatePurchaseCheckDetails(param).then(response => {
updatePurchaseCheckDetails(equipments).then(response => {
if(response.code == 200){
this.$message({
message: '操作成功',
message: '验收成功',
type: 'success'
})
this.open = false;
@ -472,16 +521,65 @@ export default {
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除该数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
submitListForm: function() {
console.log(this.aform)
this.ids.forEach(item=>{
item.checkNum = item.purchaseNum
item.checkResult = this.aform.checkResult
item.checkUrl = this.aform.checkUrl
item.checkUrlName = this.aform.checkUrlName
})
console.log(this.ids)
let equipments = this.ids
console.log(equipments)
this.$refs["aform"].validate(valid => {
if (valid) {
updatePurchaseCheckDetails(equipments).then(response => {
if(response.code == 200){
this.$message({
message: '验收成功',
type: 'success'
})
this.openAll = false;
this.open = false;
this.getTaskInfo();
}
});
}
});
},
//
imgUpLoad(param,name,index) {
console.log(param,'image')
param.type = 'ma'
imgUpLoad(param).then(res => {
if(res.code == 200) {
if(this.open){
this.form.checkUrl = res.data.fileUrl;
this.form.checkUrlName = res.data.fileName;
}
if(this.openAll){
this.aform.checkUrl = res.data.fileUrl;
this.aform.checkUrlName = res.data.fileName;
}
this.imageUrl = res.data.fileUrl;
this.imageName = res.data.fileName;
}else{
// this.$msgError(res.msg)
this.$modal.msgError(res.msg);
}
}).catch((error) => {
// this.$msgError(error)
this.$modal.msgError(error);
})
},
//
openImg(url){
this.dialogImageUrl = this.uploadUrl + url;
this.dialogVisible = true;
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/type/export', {

View File

@ -2,39 +2,44 @@
<div class="app-container">
<el-row :gutter="24" class="mb8">
<!-- <el-col :span="4" style="text-align:center;"><h4>新购任务信息:</h4></el-col> -->
<el-col :span="16">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" >
<el-form-item label="机具类型" prop="equipmentId">
<treeselect v-model="queryParams.equipmentId" default-expand-all :options="equipmentTypeList" placeholder="请选择机具类型" @select="select" style="width: 250px;"/>
</el-form-item>
<el-form-item label="出厂日期">
<el-date-picker
v-model="queryParams.productionTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="机具厂家" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
placeholder="机具厂家"
clearable
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-col>
<el-col :span="5">
<el-form-item label="机具类型" prop="equipmentId">
<treeselect v-model="queryParams.equipmentId" default-expand-all :options="equipmentTypeList" placeholder="请选择机具类型" @select="select" style="width: 240px;"/>
</el-form-item>
</el-col>
<el-col :span="5">
<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-col>
<el-col :span="5">
<el-form-item label="机具厂家" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
placeholder="机具厂家"
clearable
style="width: 240px"
@change="changeSupplier"
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="9"></el-col>
</el-form>
</el-row>
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true">
<el-row>
@ -67,7 +72,6 @@
:key="item.userId"
:label="item.userName"
:value="item.userId"
v-if="item.status !='1'"
></el-option>
</el-select>
</el-form-item>
@ -89,7 +93,7 @@
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@click="handleSave"
>保存</el-button>
</el-col>
<el-col :span="3">
@ -131,7 +135,7 @@
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="55"/>
<el-table-column label="机具类型名称" prop="machineTypeName" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="机具类型" prop="machineTypeName" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="规格型号" prop="specificationType" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="单位" prop="unitName" width="100" />
<el-table-column label="购置单价(元)" prop="purchasePrice" align="center" width="150">
@ -139,7 +143,7 @@
<el-input v-model="scope.row.purchasePrice" type="number" maxlength="10"></el-input>
</template>
</el-table-column>
<el-table-column label="采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
<el-table-column label="*采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
<template slot-scope="scope">
<el-input v-model="scope.row.purchaseNum"></el-input>
</template>
@ -191,7 +195,7 @@
</template>
<script>
import { addPurchaseCheckInfo } from "@/api/store/newBuy";
import { addPurchaseCheckInfo,getPurchaseCheckInfo,updatePurchaseCheckInfo } from "@/api/store/newBuy";
import { getUserByRoleList } from "@/api/system/user";
import { equipmentTypeTree ,supplierInfoList} from "@/api/store/tools";
import Treeselect from "@riophae/vue-treeselect";
@ -206,6 +210,7 @@ export default {
data() {
return {
taskId:'',
isEdit:false,
//
loading: false,
//
@ -300,6 +305,14 @@ export default {
created() {
const taskId = this.$route.query && this.$route.query.taskId;
this.taskId = taskId;
if(this.taskId=='' || !this.taskId){
this.isEdit = false
}else if(this.taskId!=''){
this.isEdit = true;
this.getTaskInfo()
}
this.getUserList()
// this.getList();
this.equipmentType();
@ -344,6 +357,7 @@ export default {
})
});
},
//
select(row){
if(row.level==4){
for(let i = 0; i < this.equipmentList.length; i++) {
@ -352,12 +366,40 @@ export default {
break;
}
}
row.productionTime = this.queryParams.productionTime
row.supplierId = this.queryParams.supplierId
this.equipmentList.unshift(row)
}
},
//
changeSupplier(supplierId){
this.equipmentList.forEach(item=>{
this.$set(item, 'supplierId', supplierId);
})
},
//
changeTime(time){
console.log(time)
this.equipmentList.forEach(item=>{
this.$set(item, 'productionTime', time);
})
},
//---
getTaskInfo(){
// this.loading = true;
getPurchaseCheckInfo({taskId:this.taskId,keyWord:this.queryParams.keyWord}).then(response => {
// this.taskInfo = response.data
this.dataForm.purchaseTime = response.data.purchaseTime;
this.dataForm.arrivalTime = response.data.arrivalTime;
this.dataForm.purchaser = response.data.purchaser;
this.dataForm.remark = response.data.remark;
this.equipmentList = response.data.checkDetailsList;
// this.loading = false;
})
},
/** 查询右侧列表 */
getList() {
// this.loading = true;
@ -409,21 +451,56 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
handleSave() {
// this.$modal.confirm('').then(function() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
console.log(this.dataForm,'dataForm')
console.log(this.equipmentList,'equipmentList')
this.dataForm.checkDetailsList = this.equipmentList;
this.loading = true;
addPurchaseCheckInfo(this.dataForm).then(response => {
if(response.code == 200){
this.$modal.msgSuccess("新增成功");
this.$tab.closeOpenPage({ path: "/store/newBuy/newDevicesList" });
let isEmpty = true
this.equipmentList.forEach(item=>{
if(item.purchaseNum=='' || !item.purchaseNum){
isEmpty = false
}
this.loading = false;
})
console.log(this.taskId)
this.dataForm.taskId = this.taskId
this.dataForm.checkDetailsList = this.equipmentList;
console.log(this.dataForm)
if(isEmpty){
if(this.equipmentList.length>0){
if(this.isEdit){
console.log('编辑')
this.loading = true;
updatePurchaseCheckInfo(this.dataForm).then(response => {
if(response.code == 200){
this.$modal.msgSuccess("编辑成功");
this.$tab.closeOpenPage({ path: "/store/newBuy/newDevicesList" });
}
this.loading = false;
})
}else if(!this.isEdit){
console.log('新增')
this.loading = true;
addPurchaseCheckInfo(this.dataForm).then(response => {
if(response.code == 200){
this.$modal.msgSuccess("新增成功");
this.$tab.closeOpenPage({ path: "/store/newBuy/newDevicesList" });
}
this.loading = false;
})
}
}else{
this.$modal.msgError("请先选择并添加机具类型!!!");
}
}else{
this.$modal.msgError("请填写采购数量!!!");
}
}
})
@ -446,6 +523,13 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row.id)
this.equipmentList.forEach((item,index)=>{
if(item.id == row.id){
this.equipmentList.splice(index,1)
}
})
// const roleIds = row.roleId || this.ids;
// this.$modal.confirm('"' + roleIds + '"').then(function() {
// return delRole(roleIds);

View File

@ -1,9 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="名称" prop="dictName">
<el-form-item label="名称" prop="typeName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.typeName"
placeholder="请输入名称"
clearable
style="width: 240px"
@ -18,7 +18,7 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -27,7 +27,7 @@
@click="handleAdd"
v-hasPermi="['store:labelType:add']"
>新增</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="primary"
@ -36,57 +36,40 @@
@click="jumpList"
>采购验收管理</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['store:labelType:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['store:labelType:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['store:labelType:export']"
>导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="codeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具类型名称" align="center" prop="machineTypeName" :show-overflow-tooltip="true" />
<el-table-column label="机具类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="specificationType" :show-overflow-tooltip="true" />
<el-table-column label="设备编号" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="采购时间" align="center" prop="purchaseTime" :show-overflow-tooltip="true" />
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true" />
<el-table-column label="验收数量" align="center" prop="checkNum" :show-overflow-tooltip="true" />
<el-table-column label="绑定数量" align="center" prop="bindNum" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span v-if="scope.row.bindNum>0">{{ scope.row.bindNum }}</span>
<span v-else >0</span>
</template>
</el-table-column>
<el-table-column label="是否为固定资产" align="center" prop="fixCode" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="编码类型" align="center" prop="codeType" :show-overflow-tooltip="true" />
<el-table-column label="二维码" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status" width="180">
<template slot-scope="scope">
<span v-if="scope.row.fixCode == '0'"></span>
<span v-if="scope.row.fixCode == '1'"></span>
</template>
</el-table-column>
<!-- <el-table-column label="编码类型" align="center" prop="codeType" :show-overflow-tooltip="true" />
<el-table-column label="二维码" align="center" prop="dictName" :show-overflow-tooltip="true" /> -->
<el-table-column label="状态" align="center" prop="status" width="180">
<!-- <template slot-scope="scope">
<span v-if="scope.row.status==0">删除</span>
<span v-if="scope.row.status==1">正常</span>
</template>
</template> -->
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -94,88 +77,110 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>编辑</el-button>
<el-button
@click="handleCode(scope.row)"
>绑定编码</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button>
>删除</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="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="机具类型名称" prop="typeId">
<el-select
v-model="form.typeId"
placeholder="请选择机具类型"
clearable
style="width: 100%"
@change="selectType"
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-row :gutter="24" class="mb8">
<el-form ref="form" :model="form" :rules="rules" label-width="78px">
<el-input v-model="form.typeId" disabled v-show="false"/>
<el-col :span="7">
<el-form-item label="编码前缀" prop="exCode">
<el-input v-model="form.exCode" :readonly="true"/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="生成数量" prop="count">
<el-input-number controls-position="right" v-model="form.count" type="number" :min="1" placeholder="请输入编码生成数量" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="固定资产" prop="isFixed">
<el-select v-model="form.isFixed" placeholder="是否为固定资产" clearable allow-create="">
<el-option label="是" value="0"/>
<el-option label="否" value="1"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button
type="primary"
plain
size="mini"
@click="createCodeList"
>生成</el-button>
</el-col>
<el-col :span="2">
<el-button
type="primary"
plain
size="mini"
@click="fillingCodeList"
>填充</el-button>
</el-col>
</el-form>
</el-row>
<el-table v-loading="loading" :data="codeList" height="400">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="机具种类" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="specificationType" :show-overflow-tooltip="true" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="固定资产编码" align="center" prop="assetsCode" width="120" />
<el-table-column
label="操作"
align="center"
width="160"
class-name="small-padding fixed-width"
>
<el-option
v-for="typeItem in typeList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="规格型号" prop="modelId">
<el-select
v-model="form.modelId"
placeholder="请选择规格型号"
clearable
style="width: 100%"
@change="selectType"
>
<el-option
v-for="typeItem in modelList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
<!-- <el-input v-model="form.modelId" placeholder="请输入规格型号" /> -->
</el-form-item>
<el-form-item label="设备编号" prop="maCode">
<el-input v-model="form.maCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="固定资产" prop="isFixed">
<el-radio-group v-model="form.isFixed">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="固定资产编号" prop="fixCode" v-if="form.isFixed=='0'">
<el-input v-model="form.fixCode" placeholder="请输入固定资产编号" />
</el-form-item>
</el-form>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="delCode(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="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { listPurchaseMacodeInfo,addPurchaseMacode,updateMacode,delMacode,getMacodeInfo } from "@/api/store/newBuy";
import { getPurchaseCheckInfo, listPurchaseMacodeInfo,addPurchaseMacode,updateMacode,delMacode,getMacodeInfo, } from "@/api/store/newBuy";
import { getMacodeList,getMacodeDetailList,makeEquipmentNumber,editPurchaseMacode,delMacodeList } from "@/api/store/newBuy";
import { getTypeList } from "@/api/store/warehousing";
import { getListByMaType } from "@/api/store/tools";
@ -200,8 +205,8 @@ export default {
//
total: 0,
taskId:'',
//
codeList: [],
//
typeList: [],
//
title: "",
//
@ -210,31 +215,32 @@ export default {
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
// pageNum: 1,
// pageSize: 10,
typeName: undefined,
},
//
form: {},
form: {
exCode:'NXJJ',
count:1,
isFixed:'1',
typeId:''
},
codeList: [],//list
getCodeList: [],//list
newCodeList: [],//list
//
rules: {
typeId: [
{ required: true, message: "机具类型名称不能为空", trigger: "blur" }
],
modelId: [
{ required: true, message: "规格型号不能为空", trigger: "blur" }
],
maCode: [
{ required: true, message: "设备编号不能为空", trigger: "blur" }
],
isFixed: [
{ required: true, message: "请选择是否为固定资产", trigger: "blur" }
],
fixCode: [
{ required: true, message: "固定资产编号不能为空", trigger: "blur" }
]
// typeId: [
// { required: true, message: "", trigger: "blur" }
// ],
// modelId: [
// { required: true, message: "", trigger: "blur" }
// ],
// maCode: [
// { required: true, message: "", trigger: "blur" }
// ],
}
};
},
@ -243,9 +249,9 @@ export default {
this.taskId = taskId;
console.log(this.taskId)
this.getList();
this.getTypeList();
},
methods: {
//
getTypeList() {
getTypeList({level:'3'}).then(response => {
this.typeList = response.data;
@ -259,13 +265,12 @@ export default {
}
);
},
/** 查询字典类型列表 */
/** 查询列表 */
getList() {
this.loading = true;
this.queryParams.taskId = this.taskId
listPurchaseMacodeInfo(this.queryParams).then(response => {
this.codeList = response.rows;
this.total = response.total;
getMacodeList(this.queryParams).then(response => {
this.typeList = response.data;
this.loading = false;
}
);
@ -273,7 +278,6 @@ export default {
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
@ -309,36 +313,127 @@ export default {
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const maId = row.maId || this.ids
getMacodeInfo(maId).then(response => {
this.form = response.data;
/** 编码按钮操作 */ //getCodeList newCodeList
handleCode(row) {
console.log(row)
let param = {
taskId:this.taskId,
typeId:row.typeId,
}
this.newCodeList = [];
getMacodeDetailList(param).then(response => {
this.getCodeList = response.data;
this.codeList = this.getCodeList.concat(this.newCodeList)
this.open = true;
this.title = "修改";
this.title = "生成编码";
});
this.form = row
// this.form.count = row.checkNum;
this.form.count = row.checkNum;
this.form.typeId = row.typeId;
this.form.taskId = row.taskId;
this.form.isFixed = '1';
this.form.exCode = 'NXJJ'+this.form.typeCode+this.form.specsCode;
// this.open = true;
// this.title = "";
},
//codeList
createCodeList(){
// console.log(this.form.checkNum)
// console.log(this.codeList.length)
// console.log(this.newCodeList)
if(this.codeList.length>=this.form.checkNum){
this.$modal.msgError("生成编码数量不可超过采购验收数量!!!");
}else{
for(let i = 0; i < this.form.count; i++) {
let obj = {
typeName:this.form.typeName,
specificationType:this.form.specificationType,
typeId: this.form.typeId,
taskId: this.form.taskId,
assetsCode:'',
isFixed:this.form.isFixed,
}
this.newCodeList.push(obj)
}
console.log(this.newCodeList,'this.newCodeList')
this.codeList = this.getCodeList.concat(this.newCodeList)
}
},
//
fillingCodeList(){
// console.log(this.form.checkNum)
// console.log(this.getCodeList,'getCodeList')
// console.log(this.newCodeList,'newCodeList')
// console.log(this.codeList)
// let emptyNum = 0;
// for(let i = 0; i < this.codeList.length; i++) {
// if(!this.codeList.maCode || this.codeList.maCode==''){
// emptyNum = emptyNum+1;
// }
// };
// console.log(emptyNum,'emptyNum')
if(this.newCodeList.length>0){
let param = {
"typeId": this.form.typeId,
"count": this.newCodeList.length
}
makeEquipmentNumber(param).then(response => {
// this.newCodeList.forEach((item,index) => {
// this.$set(item,'maCode',response.data.equipmentNum);
// });
response.data.equipmentNum.forEach((item,index) => {
this.$set(this.newCodeList[index], 'maCode', item);
// this.newCodeList[index].maCode = item
});
console.log(this.newCodeList)
this.codeList = this.getCodeList.concat(this.newCodeList)
// response.equipmentNum
});
}else{
this.$modal.msgError("已全部绑定过设备编码");
}
},
/** 提交按钮 */
submitForm: function() {
this.form.taskId = this.taskId;
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.maId != undefined) {
updateMacode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPurchaseMacode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
console.log(this.newCodeList)
if(this.newCodeList.length==0){
this.$modal.msgError("无新增编码绑定");
}else{
editPurchaseMacode(this.newCodeList).then(response => {
this.$modal.msgSuccess("绑定成功");
this.open = false;
this.getList();
});
}
},
getdetailmaCodeList(data){
console.log(data)
let param = {
taskId:this.taskId,
typeId:data.typeId,
}
getMacodeDetailList(param).then(response => {
this.getCodeList = response.data;
this.codeList = this.getCodeList.concat(this.newCodeList)
});
},
delCode(row) {
const maCode = row.maCode ;
this.$modal.confirm('是否确认删除该数据项?').then(function() {
return delMacodeList(maCode);
}).then(() => {
this.getdetailmaCodeList(row);
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//
jumpList(){

View File

@ -25,7 +25,6 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['store:labelType:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
@ -45,7 +44,6 @@
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['store:labelType:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
@ -56,7 +54,6 @@
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['store:labelType:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
@ -66,7 +63,6 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['store:labelType:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -79,17 +75,10 @@
<el-table-column label="采购日期" align="center" prop="purchaseTime" :show-overflow-tooltip="true" />
<el-table-column label="到货日期" align="center" prop="arrivalTime" :show-overflow-tooltip="true" />
<el-table-column label="采购机具设备" align="center" prop="purchasingTypeName" :show-overflow-tooltip="true" width="250"/>
<el-table-column label="采购员" align="center" prop="purchaser" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="采购员" align="center" prop="purchaserName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="采购状态" align="center" prop="purchasingStatus" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<!-- <el-table-column label="状态" align="center" prop="createTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.status">-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button
@ -97,28 +86,25 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
v-if="scope.row.taskStatus==24"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleAccept(scope.row)"
v-hasPermi="['store:labelType:edit']"
>验收</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCode(scope.row)"
v-hasPermi="['store:labelType:edit']"
>编码管理</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button>
</template>
</el-table-column>
@ -150,9 +136,6 @@
<el-form-item label="备注" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入基层单位" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm"> </el-button>

View File

@ -261,6 +261,9 @@ export default {
businessLicense: undefined,
status: "0",
};
this.imageUrl = ''
this.fileList = []
this.field101fileList = []
this.resetForm("form");
},
/** 搜索按钮操作 */

View File

@ -58,8 +58,6 @@
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="info"
@ -117,8 +115,7 @@
<el-table-column label="文档资料" align="center" key="documentName" prop="documentName"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<a :href="'http://192.168.0.14:21624/system'+scope.row.documentUrl" style="color: #02A7F0;" :download="scope.row.documentName">{{ scope.row.documentName }}</a>
<!-- <a :href="'http://10.40.92.140:9201'+scope.row.documentUrl" style="color: #02A7F0;" :download="scope.row.documentName">{{ scope.row.documentName }}</a> -->
<a :href="uploadUrl+scope.row.documentUrl" style="color: #02A7F0;" :download="scope.row.documentName">{{ scope.row.documentName }}</a>
</template>
</el-table-column>
<el-table-column label="资产属性" align="center" key="propName" prop="propName"
@ -263,7 +260,7 @@
<el-form-item label="文档资料" prop="field101">
<el-upload ref="field101"
:file-list="field101fileList"
action="#" :limit='1'
action="#" :limit='1' accept=".docx,.pdf"
:http-request="(obj) => fileUpLoad(obj,'fileUrl')"
:on-exceed="exceedFile"
@ -280,11 +277,11 @@
:file-list="fileList"
:show-file-list="false"
list-type="picture-card"
accept=".png,.jpg,.jpeg"
:on-success="handleAvatarSuccess"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<img v-if="imageUrl" :src="'http://192.168.0.14:21624/system'+imageUrl" style="width: 140px;height: 140px;" class="avatar">
<!-- <img v-if="imageUrl" :src="'http://10.40.92.140:9201'+imageUrl" style="width: 140px;height: 140px;" class="avatar"> -->
<img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
@ -455,6 +452,9 @@ export default {
imageName:'',
fileList:[],
field101fileList:[],
//
uploadUrl:'http://192.168.0.14:21624/system',//线+system
// uploadUrl:'http://10.40.92.140:9201',//
defaultProps: {
children: "children",
label: "label"
@ -601,6 +601,7 @@ export default {
documentUrl:"",
documentName:""
};
this.imageUrl = ''
this.fileList = []
this.field101fileList = []
this.resetForm("form");
@ -745,8 +746,7 @@ export default {
},
//
openImg(url){
this.dialogImageUrl = "http://192.168.0.14:21624/system" + url;//线
// this.dialogImageUrl = "http://10.40.92.140:9201" + url;//
this.dialogImageUrl = this.uploadUrl + url;
this.dialogVisible = true;
},
//