Initial commit: 景耀JY1.0项目

This commit is contained in:
Developer
2026-05-21 09:46:02 +08:00
parent 4969870de8
commit fd70670235
90 changed files with 10278 additions and 1508 deletions

View File

@@ -47,6 +47,20 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="productDetail"
size="small"
clearable
style="width:180px;margin-left: 10px"
placeholder="产品详情"
@keyup.enter.native="pageCurrent=1;searchLeftTable()"/>
<el-input
v-model="orderRemarks"
size="small"
clearable
style="width:180px;margin-left: 10px"
placeholder="订单备注"
@keyup.enter.native="pageCurrent=1;searchLeftTable()"/>
<el-button type="success" size="mini" style="margin-left: 100px" @click="exportExcel()">导出</el-button>
</div>
<el-row style="display: flex">
@@ -125,6 +139,11 @@
{{ scope.row.审核时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="审核人" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ getApproverName(scope.row.审批人) }}
</template>
</el-table-column>
<el-table-column width="120px" label="操作" align="center" show-overflow-tooltip fixed="right">
<template slot-scope="scope">
<el-button
@@ -367,14 +386,14 @@
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 20%">交货地址</td>
<td colspan="13" style="width: 80%">联系人{{ consignee }}&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;交货地点浙江省台州市路桥区蓬街镇环镇西路99<br>联系电话{{
<td colspan="13" style="width: 80%">联系人{{ consignee }}&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;交货地点浙江省台州市路桥区金清镇卷桥同心路96-9<br>联系电话{{
receiverTelephoneNumber
}}
</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 20%">供方确认</td>
<td colspan="13" style="width: 80%">交货日期{{ people }}&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;托运方式供方陆运<br>此采购订单要求供方于接单后两个工作日内确认回复需方即生效
<td colspan="13" style="width: 80%">交货日期 {{ nullArr }}&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;托运方式供方陆运<br>此采购订单要求供方于接单后两个工作日内确认回复需方即生效
</td>
</tr>
<tr style="height: 40px">
@@ -385,13 +404,13 @@
<tr style="height: 40px">
<td colspan="2" rowspan="2" style="text-align: center;width: 14%"/>
<td colspan="1" rowspan="1" style="text-align: center;width: 8%">供方</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 14%">{{ people }}</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 14%"> {{ nullArr }}</td>
<td colspan="1" rowspan="1" style="text-align: center;width: 8%">日期</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 13%">{{ people }}</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 13%"> {{ nullArr }}</td>
<td colspan="1" rowspan="1" style="text-align: center;width: 8%">需方</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 14%">{{ people }}</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 14%"> {{ nullArr }}</td>
<td colspan="1" rowspan="1" style="text-align: center;width: 8%">日期</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 13%">{{ people }}</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 13%"> {{ nullArr }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" rowspan="1" style="text-align: center;width: 17%">签字/盖章</td>
@@ -413,7 +432,7 @@
type="danger"
size="mini"
style="float: right;margin-bottom: 5px;margin-right: 10px"
@click="deleteFileData1(url.id)">删除
@click="deleteFileData1(url)">删除
</el-button>
<el-image :key="url.url" :src="url.url" :preview-src-list="urls1" lazy style="width: 500px; height: 500px"/>
</div>
@@ -512,11 +531,13 @@
<script>
import { mapGetters } from 'vuex'
import $ from 'jquery'
import request, { MESDownloadFile, url } from '@/utils/request'
import request, { MESDownloadFile, MESUploadFileNew, MESDownloadFileNew, MESDeleteFileNew, MESUploadFileNew_BasePath, url } from '@/utils/request'
import axios from 'axios'
export default {
data() {
return {
nullArr: '',
dialogVisible: false,
hadFile: [],
dialogVisiblePictureCard: false,
@@ -532,13 +553,15 @@ export default {
orderDate: '',
deliveryDate: '',
returns: [],
people: '',
people: [],
purchaseStates: [],
purchaseState: '',
suppliers: [],
supplierName: '',
contractValue: '',
contract: [],
productDetail: '', // 顶部筛选-产品详情
orderRemarks: '', // 顶部筛选-订单备注
dialogFormVisible: false, // 查看图片
dialogFormVisible2: false, // 增加图片
dialogFormVisible3: false, // 查看图片
@@ -584,6 +607,7 @@ export default {
},
created() {
this.fetchData()
this.getPeople()
},
methods: {
// 查看零件图
@@ -668,35 +692,68 @@ export default {
}
})
},
deleteFileData1(id) {
// console.log(id, '图片iad')
deleteFileData1(item) {
const id = item.id
const filePath = item.filePath || ''
// 构造删除SQL
var param = []
param[0] = ['id', id]
var Data = this.CreateData('12', '采购合同查询_图片_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
// 如果有文件路径,同步删除文件
if (filePath) {
axios.get(MESDeleteFileNew, {
params: { filePath: filePath }
}).then(res => {
console.log('文件删除:', res.data)
}).catch(err => {
console.error('文件删除异常:', err)
})
}
this.$message.success('图片删除成功')
this.urls = []
this.urls1 = []
var param1 = []
param1[0] = ['采购合同流水号', this.purchaseContractSerialNumber]
var Data1 = this.CreateData('11', '采购合同查询_图片_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push({
url: 'data:image/png;base64,' + response.data[i].文件内容,
id: response.data[i].id
})
this.urls1.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
this.refreshPictureList()
} else {
this.$message.error('删除失败')
}
})
},
// 刷新图片列表
refreshPictureList() {
this.urls = []
this.urls1 = []
var param1 = []
param1[0] = ['采购合同流水号', this.purchaseContractSerialNumber]
var Data1 = this.CreateData('11', '采购合同查询_图片_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
const item = response.data[i]
if (item.文件路径) {
// 从文件系统读取
axios.get(MESDownloadFileNew, {
params: { filePath: item.文件路径 }
}).then(res => {
if (res.data && res.data[0] && res.data[0].文件内容) {
this.urls.push({
url: 'data:image/png;base64,' + res.data[0].文件内容,
id: item.id,
filePath: item.文件路径
})
this.urls1.push('data:image/png;base64,' + res.data[0].文件内容)
}
})
} else if (item.文件内容 !== null) {
this.urls.push({
url: 'data:image/png;base64,' + item.文件内容,
id: item.id,
filePath: ''
})
this.urls1.push('data:image/png;base64,' + item.文件内容)
}
}
})
},
handlePicture(row) {
this.dialogFormVisible = true
this.purchaseContractSerialNumber = row.采购合同流水号
@@ -707,12 +764,31 @@ export default {
var Data = this.CreateData('11', '采购合同查询_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push({
url: 'data:image/png;base64,' + response.data[i].文件内容,
id: response.data[i].id
const item = response.data[i]
// 优先使用文件路径(新方式)
if (item.文件路径) {
axios.get(MESDownloadFileNew, {
params: { filePath: item.文件路径 }
}).then(res => {
if (res.data && res.data[0] && res.data[0].文件内容) {
this.urls.push({
url: 'data:image/png;base64,' + res.data[0].文件内容,
id: item.id,
filePath: item.文件路径
})
this.urls1.push('data:image/png;base64,' + res.data[0].文件内容)
}
}).catch(err => {
console.error('图片加载失败:', err)
})
this.urls1.push('data:image/png;base64,' + response.data[i].文件内容)
} else if (item.文件内容 !== null) {
// 兼容旧数据
this.urls.push({
url: 'data:image/png;base64,' + item.文件内容,
id: item.id,
filePath: ''
})
this.urls1.push('data:image/png;base64,' + item.文件内容)
}
}
})
@@ -751,6 +827,11 @@ export default {
param[5] = ['采购状态', this.purchaseState]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
// 新增筛选参数
param[8] = ['产品详情_check', this.productDetail ? 1 : 0]
param[9] = ['产品详情', this.productDetail]
param[10] = ['订单备注_check', this.orderRemarks ? 1 : 0]
param[11] = ['订单备注', this.orderRemarks]
var Data = this.CreateData('2001', '报表_采购管理_采购合同_全部_查询数据', param)
this.exportExcel_NPOI(Data)
} else {
@@ -767,13 +848,50 @@ export default {
}
return isJPG
},
uploadSuccess(res) { // 上传成功回调
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
uploadSuccess(res, file) { // 上传成功回调
// 生成文件保存路径
const now = new Date()
const timestamp = now.getFullYear().toString() +
(now.getMonth() + 1).toString().padStart(2, '0') +
now.getDate().toString().padStart(2, '0') +
now.getHours().toString().padStart(2, '0') +
now.getMinutes().toString().padStart(2, '0') +
now.getSeconds().toString().padStart(2, '0') +
now.getMilliseconds().toString().padStart(3, '0')
const suffix = file.name.split('.').pop() || 'jpg'
const savePath = MESUploadFileNew_BasePath + '\\OrderInquiry\\' + timestamp + '-' + this.purchaseContractID + '.' + suffix
// 构造SQL语句
const sqlStatement = `update 采购管理_采购合同查询_图片 set 文件内容 = NULL, 文件路径 = N'${savePath}' where id = (select top 1 id from 采购管理_采购合同查询_图片 where 采购合同流水号 = ${this.purchaseContractID} and 文件路径 is null order by 操作时间 desc)`
// 调用新接口保存文件
const formData = new FormData()
formData.append('file', file.raw)
formData.append('savePath', savePath)
formData.append('sqlStatement', sqlStatement)
axios.post(MESUploadFileNew, formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
console.log('文件保存成功:', savePath)
} else {
console.error('文件保存失败:', response.data)
}
}).catch(err => {
console.error('文件保存异常:', err)
})
// this.dialogFormVisible2 = false
// this.$refs.upload.clearFiles()
},
updatePicture(row) {
this.dialogFormVisible2 = true
this.purchaseContractID = row.采购合同流水号
// this.$nextTick(() => {
// if (this.$refs.upload) {
// this.$refs.upload.clearFiles()
// }
},
submitPicture() {
var param = []
@@ -785,6 +903,7 @@ export default {
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
},
exportTable(row) {
this.supplier = row.供应商
@@ -881,6 +1000,11 @@ export default {
param[5] = ['采购状态', this.purchaseState]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
// 新增筛选参数
param[8] = ['产品详情_check', this.productDetail ? 1 : 0]
param[9] = ['产品详情', this.productDetail]
param[10] = ['订单备注_check', this.orderRemarks ? 1 : 0]
param[11] = ['订单备注', this.orderRemarks]
var Data = this.CreateData('11', '采购管理_采购合同_全部_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.ProductionPick = response.data.rows
@@ -917,6 +1041,18 @@ export default {
}
})
},
getPeople() {
var param = []
var Data = this.CreateData('11', '人员信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []
@@ -1100,6 +1236,22 @@ export default {
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchLeftTable()
},
getApproverName(approverId) {
// 调试打印people数组和approverId
// console.log('people数组:', this.people)
// console.log('approverId:', approverId, '类型:', typeof approverId)
// 尝试类型转换后比较
for (let i = 0; i < this.people.length; i++) {
// console.log('people[i].value:', this.people[i].value, '类型:', typeof this.people[i].value)
if (String(this.people[i].value) === String(approverId)) {
// console.log('找到匹配:', this.people[i].label)
return this.people[i].label
}
}
// console.log('未找到匹配,返回原始值:', approverId)
return approverId
}
}
}