新购新增3

This commit is contained in:
zzyuan 2024-11-06 18:27:24 +08:00
parent fe4daa62ac
commit b971631106
5 changed files with 215 additions and 337 deletions

View File

@ -74,7 +74,7 @@
<el-table-column label="规格型号" align="center" prop="typeName" />
<el-table-column label="单位" align="center" prop="unitName"/>
<el-table-column label="采购数量" align="center" prop="purchaseNum" />
<el-table-column label="购置单价(元含税)" align="center" prop="purchasePrice" />
<el-table-column label="购置单价(元含税)" align="center" prop="purchaseTaxPrice" />
<el-table-column label="购置单价(元不含税)" align="center" prop="purchasePrice" />
<el-table-column label="供应商" align="center" prop="supplierName" />
@ -191,7 +191,13 @@
//
open: false,
rowData:{},
fileDataList: [],
fileDataList: [
{dictLabel:"合格证",dictCode:"0",fileName:"",fileUrl:""},
{dictLabel:"型式试验报告",dictCode:"1",fileName:"",fileUrl:""},
{dictLabel:"出厂检测报告",dictCode:"2",fileName:"",fileUrl:""},
{dictLabel:"第三方监测报告",dictCode:"3",fileName:"",fileUrl:""},
{dictLabel:"其他报告",dictCode:"99",fileName:"",fileUrl:""},
],
//
queryParams: {
// pageNum: 1,
@ -289,27 +295,28 @@
//
openFileDialog(row){
this.rowData=row;
this.getFileData()
// this.getFileData()
this.open=true
},
getFileData(){
let param = {
typeId:this.rowData.typeId,
taskId:this.rowData.taskId
}
this.dialogLoading=true
getPurchaseFileList(param).then((response) => {
this.fileDataList=response.data
this.dialogLoading = false;
}).catch(() => {this.dialogLoading = false;})
},
// getFileData(){
// let param = {
// typeId:this.rowData.typeId,
// taskId:this.rowData.taskId
// }
// this.dialogLoading=true
// getPurchaseFileList(param).then((response) => {
// this.fileDataList=response.data
// this.dialogLoading = false;
// }).catch(() => {this.dialogLoading = false;})
// },
beforeFileUpload(row){
this.rowData.dictCode=row.dictCode;
this.rowData.dictLabel=row.dictLabel;
},
//
handleFileSuccess(response, file, fileList) {
if(response.code==200){
if(response.code==200){
let param = {
"id": this.Id,
"taskId": this.taskId,

View File

@ -71,7 +71,7 @@
<el-table-column label="采购物资" align="center" prop="purchaseMaTypeName" />
<el-table-column label="采购数量" align="center" prop="purchaseMaNumber" />
<el-table-column label="采购价格(元含税)" align="center" prop="purchaseTaxPrice" width="80"/>
<el-table-column label="采购价格(元不含税)" align="center" prop="purchaseNoTaxPrice" width="98"/>
<el-table-column label="采购价格(元不含税)" align="center" prop="purchasePrice" width="98"/>
<el-table-column label="税率" align="center" prop="taxRate" />
<el-table-column label="操作人" align="center" prop="createUserName" />
<el-table-column label="操作时间" align="center" prop="createTime" />

View File

@ -214,9 +214,7 @@
prop="checkUrlName"
>
<template slot-scope="scope">
<div @click="openGt(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ '报告管理' }}
</div>
<div style="color: rgb(2, 167, 240);cursor: pointer;" @click="openFileDialog(scope.row)">报告管理</div>
</template>
</el-table-column>
@ -234,66 +232,59 @@
</el-table-column>
</el-table>
<holdingpole-dialog
:dialog-class="'my-custom-dialog'"
:initial-visible="showDialog"
: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-dialog title="报告管理" :visible.sync="open" width="900px" append-to-body>
<el-table :data="fileDataList" width="100%" height="350px">
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="报告类型" align="center" prop="dictLabel" :show-overflow-tooltip="true"/>
<el-table-column label="文件名称" align="center" prop="fileName" :show-overflow-tooltip="true"/>
<el-table-column label="类型名称" align="center" :show-overflow-tooltip="true">
<template>
<div>{{this.rowData.maTypeName}}</div>
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" :show-overflow-tooltip="true">
<template>
<div>{{this.rowData.typeName}}</div>
</template>
</el-table-column>
<!-- <el-table-column label="报告日期" align="center" prop="orgName" :show-overflow-tooltip="true"/>
<el-table-column label="截止有效期" align="center" prop="orgName" :show-overflow-tooltip="true"/> -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: space-between;">
<el-upload ref="upload" :limit="1" :headers="upload.headers"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess" :auto-upload="true"
>
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
上传
</el-button>
</el-upload>
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.fileUrl">
查看
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
<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> -->
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
</div>
</template>
<script>
// import {
// } from '@/api/store/newBuy'
<script>
import {
getPurchaseCheckInfo,
equipmentTypeTree,
@ -301,13 +292,12 @@ import {
updatePurchaseCheckInfo,
} from '@/api/purchase/goodsArrived';
import { getListFacturer } from '@/api/ma/supplier';
// import { getUserByRoleList } from '@/api/system/user'
import { getToken } from '@/utils/auth'
import { uploadPurchaseFile } from "@/api/purchase/goodsAccept";
// 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'
// import HoldingpoleDialog from '@/components/HoldingpoleDialog/index.vue'
export default {
name: 'AddTools',
@ -354,59 +344,30 @@ export default {
supplierList: [],
//
equipmentTypeList: [],
//
userList: [],
//
equipmentList: [],
//
title: '',
//
open: false,
showGt:false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
showDialog: false,
holdingpoleData: {},
//
dateRange: [],
queryGt: {
pageNum: 1,
pageSize: 10,
id:undefined,
taskId:undefined,
typesList:[],
},
//
dataScopeOptions: [
{
value: '1',
label: '全部数据权限',
},
{
value: '2',
label: '自定数据权限',
},
{
value: '3',
label: '本部门数据权限',
},
{
value: '4',
label: '本部门及以下数据权限',
},
{
value: '5',
label: '仅本人数据权限',
},
rowData:{},
fileDataList: [
{dictLabel:"合格证",dictCode:"0",fileName:"",fileUrl:""},
{dictLabel:"型式试验报告",dictCode:"1",fileName:"",fileUrl:""},
{dictLabel:"出厂检测报告",dictCode:"2",fileName:"",fileUrl:""},
{dictLabel:"第三方监测报告",dictCode:"3",fileName:"",fileUrl:""},
{dictLabel:"其他报告",dictCode:"99",fileName:"",fileUrl:""},
],
//
menuOptions: [],
//
deptOptions: [],
//
dialogImageUrl: '',
dialogVisible: false,
//
upload: {
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
},
//
queryParams: {
equipmentId: undefined,
@ -485,50 +446,27 @@ export default {
this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo()
}
// this.getUserList()
// this.getList();
}
},
methods: {
//
taxRateChange(val){
this.maForm.taxRate = val.replace(/[^\d.]/g,'')
this.equipmentList.forEach(item=>{
item.purchaseTaxPrice = item.purchasePrice*(1 + val/100)
})
},
//
purchaseTaxPriceChange(row,val){
// this.equipmentList[val].purchasePrice = (row.purchaseTaxPrice/(1 + this.maForm.taxRate/100)).toFixed(2)
row.purchasePrice = (row.purchaseTaxPrice/(1 + this.maForm.taxRate/100)).toFixed(2)
},
//
purchasePriceChange(row,val){
// this.equipmentList[val].purchaseTaxPrice = (row.purchasePrice*(1 + this.maForm.taxRate/100)).toFixed(2)
row.purchaseTaxPrice = (row.purchasePrice*(1 + this.maForm.taxRate/100)).toFixed(2)
},
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) => {
this.userList = response.data
})
},
/** 物资厂家 */
supplierInfoList() {
let param = {
@ -540,6 +478,12 @@ export default {
this.supplierList = response.rows
})
},
//
changeSupplier(supplierId) {
this.equipmentList.forEach((item) => {
this.$set(item, 'supplierId', supplierId)
})
},
/** 机具类型 */
equipmentType() {
equipmentTypeTree().then((response) => {
@ -577,7 +521,6 @@ export default {
this.deviceType = selectList
})
},
//
select(row) {
console.log(row)
@ -604,20 +547,58 @@ export default {
this.equipmentList.unshift(row)
}
},
//
changeSupplier(supplierId) {
this.equipmentList.forEach((item) => {
this.$set(item, 'supplierId', supplierId)
})
//
deviceTypeChange(val) {
const deviceTypeList =
this.$refs.deviceTypeCascader.getCheckedNodes()
let tempList = []
if (val.length > 0) {
const items = val.map((e) => {
return e[3]
})
for (let i of items) {
for (let z of deviceTypeList) {
if (z.data.typeId === i) {
const obj = JSON.parse(JSON.stringify(z.data))
obj.supplierId = ''
obj.createTime = null
obj.productionTime = ''
obj.purchaseTaxPrice = 0
obj.purchaseTaxPrice = 0
obj.purchaseNum = 1
tempList.push(obj)
break
}
}
}
const newDataListNew = [...this.equipmentList, ...tempList]
const map = new Map()
for (let item of newDataListNew) {
if (!map.has(item.typeId)) {
map.set(item.typeId, item)
}
}
const newArray = [...map.values()]
let newArray_array = []
items.forEach((e) => {
newArray.forEach((j) => {
if (e == j.typeId) {
newArray_array.push(j)
}
})
})
this.equipmentList = newArray_array
} else {
this.equipmentList = []
}
},
//
changeTime(time) {
console.log(time)
this.equipmentList.forEach((item) => {
this.$set(item, 'productionTime', time)
productionTimeChange(val){
this.equipmentList.forEach(item=>{
item.productionTime=val
})
},
//---
getTaskInfo() {
// this.loading = true;
@ -635,94 +616,12 @@ export default {
// 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) {
//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
}
}
}
},
/** 查询右侧列表 */
getList() {
// this.loading = true;
// listRole().then(response => {
// this.equipmentList = response.rows;
// this.total = response.total;
// this.loading = false;
// }
// );
},
//
cancel() {
this.open = false
this.reset()
},
//
cancelDataScope() {
this.openDataScope = false
this.reset()
},
//
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
},
/** 新增按钮操作 */
handleSave() {
console.log(this.equipmentList)
@ -785,106 +684,78 @@ export default {
} else {
this.$modal.msgError('请先添加机具类型')
}
},
//
openFileDialog(row){
this.rowData=row;
// this.getFileData()
this.open=true
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
// this.form = response.data;
// this.open = true;
// getFileData(){
// let param = {
// typeId:this.rowData.typeId,
// taskId:this.rowData.taskId
// }
// this.dialogLoading=true
// getPurchaseFileList(param).then((response) => {
// this.fileDataList=response.data
// this.dialogLoading = false;
// }).catch(() => {this.dialogLoading = false;})
// },
beforeFileUpload(row){
this.rowData.dictCode=row.dictCode;
this.rowData.dictLabel=row.dictLabel;
},
/** 明细按钮操作 */
handleDetail(row) {
this.holdingpoleData = row
this.showDialog = true
},
onDialogClose() {
console.log('弹窗已关闭')
this.showDialog = false
//
},
/** 删除按钮操作 */
handleDelete(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(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/role/export', {
// ...this.queryParams
// }, `role_${new Date().getTime()}.xlsx`)
},
productionTimeChange(val){
this.equipmentList.forEach(item=>{
item.productionTime=val
//
handleFileSuccess(response, file, fileList) {
if(response.code==200){
let param = {
"id": this.Id,
"taskId": this.taskId,
"fileName": response.data.name,
"fileUrl": response.data.url,
"typeId": this.rowData.typeId,
"dictCode": this.rowData.dictCode,
"dictLabel": this.rowData.dictLabel,
"modelId": this.rowData.typeId,
"createBy": ""
}
console.log(param)
uploadPurchaseFile(param).then((response) => {
this.$modal.msgSuccess('上传成功')
this.getFileData()
}).catch(() => {
this.$modal.msgError('上传失败')
})
}
},
deviceTypeChange(val) {
const deviceTypeList =
this.$refs.deviceTypeCascader.getCheckedNodes()
let tempList = []
if (val.length > 0) {
const items = val.map((e) => {
return e[3]
})
for (let i of items) {
for (let z of deviceTypeList) {
if (z.data.typeId === i) {
const obj = JSON.parse(JSON.stringify(z.data))
obj.supplierId = ''
obj.createTime = null
obj.productionTime = ''
obj.purchaseTaxPrice = 0
obj.purchaseTaxPrice = 0
obj.purchaseNum = 1
tempList.push(obj)
break
}
//
picturePreview(file) {
this.dialogImageUrl = file.fileUrl;
const parts = file.fileName.split('.');
const extension = parts.pop();
if(extension === 'doc'||extension === 'docx'||extension === 'pdf'){
const windowName = file.fileName;
window.open(file.fileUrl,windowName)
}else{
this.dialogVisible = true
}
},
//
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
}
}
const newDataListNew = [...this.equipmentList, ...tempList]
const map = new Map()
for (let item of newDataListNew) {
if (!map.has(item.typeId)) {
map.set(item.typeId, item)
}
}
const newArray = [...map.values()]
let newArray_array = []
items.forEach((e) => {
newArray.forEach((j) => {
if (e == j.typeId) {
newArray_array.push(j)
}
})
})
this.equipmentList = newArray_array
} else {
this.equipmentList = []
}
},
},

View File

@ -74,7 +74,7 @@
<el-table-column label="规格型号" align="center" prop="typeName" />
<el-table-column label="单位" align="center" prop="unitName"/>
<el-table-column label="采购数量" align="center" prop="purchaseNum" />
<el-table-column label="购置单价(元含税)" align="center" prop="purchasePrice" />
<el-table-column label="购置单价(元含税)" align="center" prop="purchaseTaxPrice" />
<el-table-column label="购置单价(元不含税)" align="center" prop="purchasePrice" />
<el-table-column label="供应商" align="center" prop="supplierName" />
<el-table-column label="出厂日期" align="center" prop="productionTime" />

View File

@ -79,7 +79,7 @@
<el-table-column label="采购物资" align="center" prop="purchaseMaTypeName" />
<el-table-column label="采购数量" align="center" prop="purchaseMaNumber" />
<el-table-column label="采购价格(元含税)" align="center" prop="purchaseTaxPrice" width="80"/>
<el-table-column label="采购价格(元不含税)" align="center" prop="purchaseNoTaxPrice" width="98"/>
<el-table-column label="采购价格(元不含税)" align="center" prop="purchasePrice" width="98"/>
<el-table-column label="税率" align="center" prop="taxRate" />
<el-table-column label="创建人" align="center" prop="createUserName" />
<el-table-column label="创建时间" align="center" prop="createTime" />