diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue
index 2a306efd..36b2be00 100644
--- a/src/views/material/lease/apply/component/addToolsApply.vue
+++ b/src/views/material/lease/apply/component/addToolsApply.vue
@@ -407,7 +407,7 @@ export default {
},
],
phone: [
- { required: true, message: "联系电话不能为空", trigger: "blur" },
+ { required: false, message: "联系电话不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
diff --git a/src/views/material/lease/apply/component/homeApply.vue b/src/views/material/lease/apply/component/homeApply.vue
index 17d8a36b..c34c05ab 100644
--- a/src/views/material/lease/apply/component/homeApply.vue
+++ b/src/views/material/lease/apply/component/homeApply.vue
@@ -223,7 +223,7 @@
发料单位:
- {{ leaseApplyData.sendUnit }}
+ {{ "机具物流分公司" }}
时间:
@@ -237,10 +237,10 @@
-
+
-
+
@@ -263,9 +263,6 @@
领料:
-
- 制单:
-
库管:
@@ -275,6 +272,9 @@
+
+ 制单:
+
diff --git a/src/views/material/lease/outBound/index.vue b/src/views/material/lease/outBound/index.vue
index ae0531a8..471cec5e 100644
--- a/src/views/material/lease/outBound/index.vue
+++ b/src/views/material/lease/outBound/index.vue
@@ -891,7 +891,7 @@ export default {
this.printTableData = res.data.leaseOutVoList
setTimeout(() => {
- this.chapter('机具检验专用章', '安徽送边电工程有限公司机具(物流)分公司')
+ this.chapter('机具检验章', '安徽送变电工程有限公司机具(物流)分公司')
}, 200)
this.openPrint = true
this.title = '出库检验单'
diff --git a/src/views/material/part/partAccept/index.vue b/src/views/material/part/partAccept/index.vue
index 28ae9563..2f2ffc35 100644
--- a/src/views/material/part/partAccept/index.vue
+++ b/src/views/material/part/partAccept/index.vue
@@ -123,7 +123,7 @@
class="title"
style="text-align: center; font-weight: 600; font-size: 16px"
>
- 机具配件到货入库单
+ 新购入库单
- 单据编号:{{printData.code}}
-
-
+ 单据编号:{{printData.code}}
+
-
-
+
@@ -402,7 +391,7 @@ import { getToken } from '@/utils/auth'
handlePrint(row) {
// this.query.taskId = row.taskId
this.openPrint = true;
- this.title = "机具配件到货入库单";
+ this.title = "新购入库单";
let params = {
id: row.id,
taskId: row.taskId,
diff --git a/src/views/material/part/partAcceptTwo/index.vue b/src/views/material/part/partAcceptTwo/index.vue
index 5ad824ac..084ceca0 100644
--- a/src/views/material/part/partAcceptTwo/index.vue
+++ b/src/views/material/part/partAcceptTwo/index.vue
@@ -122,7 +122,7 @@
class="title"
style="text-align: center; font-weight: 600; font-size: 16px"
>
- 机具配件到货验收单
+ 到货验收单
- 单据编号:{{printData.code}}
-
-
+ 单据编号:{{printData.code}}
+
- 机具配件到货验收单
+ 到货验收单
- 单据编号:{{printData.code}}
-
-
+ 单据编号:{{printData.code}}
+
- 单位部门:
+ 领料:
{{ leaseApplyData.deptName }}
diff --git a/src/views/material/purchase/goodsAccept/index.vue b/src/views/material/purchase/goodsAccept/index.vue
index 76507b4a..5f32d953 100644
--- a/src/views/material/purchase/goodsAccept/index.vue
+++ b/src/views/material/purchase/goodsAccept/index.vue
@@ -133,22 +133,22 @@
- 机具设备到货验收单
+ 到货验收单
-
- 单据编号:{{printData.code}}
-
+ style="width: 40%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
生产厂家(供应商):{{printData.supplier}}
+ style="width: 30%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
到货日期:{{printData.arrivalDate}}
+
+ 单据编号:{{printData.code}}
+
@@ -160,7 +160,7 @@
-
+
@@ -344,7 +344,7 @@
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
- this.title = '新购工机具验收单'
+ this.title = '到货验收单'
},
//获取验收单数据
getPrintTable(taskId) {
diff --git a/src/views/material/purchase/goodsArrived/component/addTools.vue b/src/views/material/purchase/goodsArrived/component/addTools.vue
index 205c7350..8d6034b2 100644
--- a/src/views/material/purchase/goodsArrived/component/addTools.vue
+++ b/src/views/material/purchase/goodsArrived/component/addTools.vue
@@ -35,7 +35,7 @@
/>
-
+
+
+
+
+ 选择某天
+ 选择月份
+
+
+
+
+
+
+
@@ -270,14 +302,14 @@
报告管理
报告管理
@@ -317,7 +349,6 @@
-
{{this.rowData.maTypeName}}
@@ -332,23 +363,18 @@
-->
-
-
+
上传
-
+
查看
@@ -360,9 +386,27 @@
-
+
+
+
+
+
+
+
+
+
+
+ 查看
+
+
+ 删除
+
+
+
+
+
@@ -436,15 +480,17 @@ export default {
open: false,
rowData:{},
fileDataList: [
- { dictLabel: '合格证', fileType: '0', name: '', url: '' },
- { dictLabel: '型式试验报告', fileType: '1', name: '', url: '' },
- { dictLabel: '出厂检测报告', fileType: '2', name: '', url: '' },
- { dictLabel: '第三方监测报告', fileType: '3', name: '', url: '' },
- { dictLabel: '其他', fileType: '4', name: '', url: '' }
+ {dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]},
],
+ fileListInfo: [],
//图片查看弹窗
dialogImageUrl: '',
dialogVisible: false,
+ dialogVisibleFile: false,
//上传
upload: {
// 设置上传的请求头部
@@ -457,12 +503,14 @@ export default {
equipmentId: undefined,
productionTime: ''
},
+ dateType: 'day', // 默认选择天
maForm: {
taxRate:13,
arrivalTime: '',
purchaser: '',
remark: '',
- purchaseNumber: ''
+ purchaseNumber: '',
+ productionTime: '',
},
// 表单参数
form: {},
@@ -533,15 +581,32 @@ export default {
//限制出厂日期不能大于到货日期
pickerOptionsForProduction() {
return {
- disabledDate: (time) => {
- if (this.maForm.arrivalTime) {
- const standardFormat = this.maForm.arrivalTime.replace(/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/, '$1-$2-$3T$4:$5:$6')
- const arrivalDate = new Date(standardFormat)
- arrivalDate.setHours(23, 59, 59, 999)
- return time.getTime() >= arrivalDate.getTime()
- }
- return false
+ disabledDate: (time) => {
+ if (this.maForm.arrivalTime) {
+ const standardFormat = this.maForm.arrivalTime.replace(/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/, '$1-$2-$3T$4:$5:$6')
+ const arrivalDate = new Date(standardFormat)
+ arrivalDate.setHours(23, 59, 59, 999)
+ return time.getTime() >= arrivalDate.getTime()
}
+ return false
+ }
+ }
+ },
+
+ pickerOptionsForProductionMonth() {
+ return {
+ disabledDate: (time) => {
+ if (this.maForm.arrivalTime) {
+ const standardFormat = this.maForm.arrivalTime.replace(/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/, '$1-$2-$3T$4:$5:$6')
+ const arrivalDate = new Date(standardFormat)
+ arrivalDate.setHours(23, 59, 59, 999)
+ // 禁用整月,如果该月的任何一天大于到货日期
+ const monthStart = new Date(time.getFullYear(), time.getMonth(), 1)
+ const monthEnd = new Date(time.getFullYear(), time.getMonth() + 1, 0)
+ return monthStart.getTime() >= arrivalDate.getTime()
+ }
+ return false
+ }
}
}
},
@@ -559,6 +624,28 @@ export default {
this.equipmentType()
},
methods: {
+ handleDateTypeChange(val) {
+ console.log("xxxxx",val)
+ if (val === 'day') {
+ // 切换到选择某天时,清空月份选择
+ this.maForm.productionTime = '';
+ // 将表格中的月份数据转换为该月第一天
+ this.equipmentList.forEach(item => {
+ if (item.status === 1 || item.status === 12 && item.productionTime) {
+ item.productionTime = `${item.productionTime}-01`;
+ }
+ });
+ } else {
+ // 切换到选择月份时,清空日期选择
+ this.maForm.productionTime = '';
+ // 将表格中的日期数据转换为月份
+ this.equipmentList.forEach(item => {
+ if (item.status === 1 || item.status === 12 && item.productionTime) {
+ item.productionTime = item.productionTime.slice(0, 7);
+ }
+ });
+ }
+ },
// 格式化日期的函数
formatDate(date) {
const year = date.getFullYear();
@@ -715,7 +802,7 @@ export default {
purchaseNum : 1,
fixCode: '0',
status:1,
- isExitFile:'0',
+ isExitFile:'1',
bmFileInfos:[]
})
@@ -820,13 +907,22 @@ export default {
});
},
//选择出厂日期
- productionTimeChange(val){
- this.equipmentList.forEach(item=>{
- if(item.status==1||item.status==12){
- item.productionTime=val
- }
+ productionTimeChange(val) {
+ this.equipmentList.forEach(item => {
+ if(item.status == 1 || item.status == 12) {
+ item.productionTime = val
+ }
})
},
+ //选择出厂日期
+ productionMonthChange(val) {
+ console.log("yyyyyyy",val)
+ this.equipmentList.forEach(item => {
+ if (item.status === 1 || item.status === 12) {
+ item.productionTime = val;
+ }
+ });
+ },
//获取任务详情--- 编辑回显数据
async getTaskInfo() {
// this.loading = true;
@@ -839,9 +935,21 @@ export default {
this.maForm.supplierId = response.data.purchaseCheckInfo.supplierId
this.maForm.remark = response.data.purchaseCheckInfo.remark
this.maForm.taxRate = response.data.purchaseCheckInfo.taxRate
- // this.maForm.purchaseNumber = response.data.purchaseNumber
- // this.maForm.productionTime = response.data.purchaseCheckInfo.productionTime
- this.equipmentList = response.data.purchaseCheckDetailsList
+ // 判断 productionTime 格式
+ const productionTime = response.data.purchaseCheckInfo.productionTime;
+ if (productionTime && productionTime.length === 10) { // 假设 10 位长度为 yyyy-MM-dd
+ this.dateType = 'day';
+ this.maForm.productionTime = productionTime;
+
+ } else if (productionTime && productionTime.length === 7) { // 假设 7 位长度为 yyyy-MM
+ this.dateType = 'month';
+ this.maForm.productionTime = productionTime;
+ } else {
+ // 默认选择某天
+ this.dateType = 'day';
+ this.maForm.productionTime = '';
+ }
+ this.equipmentList = response.data.purchaseCheckDetailsList
this.equipmentList.forEach(item=>{
item.rentPriceDisabled=true
})
@@ -913,16 +1021,15 @@ export default {
}
},
//文件管理
- openFileDialog(row){
- this.rowData = row
- this.fileDataList = [
- { dictLabel: '合格证', fileType: '0', name: '', url: '' },
- { dictLabel: '型式试验报告', fileType: '1', name: '', url: '' },
- { dictLabel: '出厂检测报告', fileType: '2', name: '', url: '' },
- { dictLabel: '第三方监测报告', fileType: '3', name: '', url: '' },
- { dictLabel: '其他', fileType: '4', name: '', url: '' }
- ]
- if (this.taskId == '') {
+ async openFileDialog(row) {
+ console.log('1111111',row)
+ this.rowData = row;
+ if (this.taskId == "") {
+ this.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]}]
// console.log(this.rowData)
// console.log(this.rowData.bmFileInfos)
if(this.rowData.bmFileInfos.length>0){
@@ -930,26 +1037,93 @@ export default {
let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
+ this.fileDataList[index].fileList.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ this.fileDataList[index].fileListTemp.push({
+ "name": item.name,
+ "url": item.url,
+ })
})
}
- }else{
- this.getFileData()
+ } else {
+ this.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
+ {dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]}]
+ if (this.rowData.bmFileInfos == null) {
+
+ await this.getFileData()
+
+ if (this.rowData.bmFileInfos.length > 0) {
+ this.rowData.bmFileInfos.forEach(item=>{
+ let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
+ this.fileDataList[index].name = item.name
+ this.fileDataList[index].url = item.url
+ this.fileDataList[index].fileList.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ this.fileDataList[index].fileListTemp.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ })
+ }
+ } else {
+ if(this.rowData.bmFileInfos.length>0){
+ this.rowData.bmFileInfos.forEach(item=>{
+ let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
+ this.fileDataList[index].name = item.name
+ this.fileDataList[index].url = item.url
+ this.fileDataList[index].fileList.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ this.fileDataList[index].fileListTemp.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ })
+ }
+ }
}
this.open=true
},
- getFileData(){
+ async getFileData(){
let param = {
modelId:this.rowData.typeId,
taskType:0,
taskId:this.rowData.taskId
}
- getPurchaseFileList(param)
+ this.rowData.bmFileInfos = []
+ await getPurchaseFileList(param)
.then(response => {
if(response.rows.length>0){
response.rows.forEach(item=>{
- let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
- this.fileDataList[index].name = item.name
- this.fileDataList[index].url = item.url
+ let index = this.fileDataList.findIndex(v => v.fileType == item.fileType)
+ item.fileDetailList.forEach(item2=>{
+ // this.fileDataList[index].fileList.push({
+ // name:item2.name,
+ // url:item2.url
+ // })
+ // this.fileDataList[index].fileListTemp.push({
+ // name:item2.name,
+ // url:item2.url
+ // })
+ const obj = {
+ "taskId": this.taskId,
+ "taskType": "0",
+ "name": item2.name,
+ "url": item2.url,
+ "modelId": this.rowData.partId,
+ "fileType": item2.fileType,
+ }
+ this.rowData.bmFileInfos.push(obj)
+ console.log('77777777',this.rowData)
+ })
})
}
})
@@ -958,22 +1132,37 @@ export default {
beforeFileUpload(row){
this.rowData.fileType = row.fileType
},
+
+ beforeUpload(row, file) {
+ row.fileList.push(file);
+ console.log('6666666',row.fileList)
+ if (row.fileList.length > 3) {
+ this.$message.warning('最多只能上传三张图片');
+ // 删除最后一个文件
+ row.fileList.pop();
+ return false; // 阻止上传
+ }
+ return true; // 允许上传
+ },
// 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- if(response.code==200){
- if (this.taskId == '') {
- //新增逻辑
+ handleFileSuccess(row,response, file, fileList) {
+ if (response.code == 200) {
+ if (this.taskId == "") {//新增逻辑
+ row.fileListTemp.push({
+ "name": response.data.name,
+ "url": response.data.url,
+ })
// console.log(response)
// console.log(this.rowData)
// console.log(this.rowData.bmFileInfos)
let obj = {
- taskId: this.taskId,
- taskType: '0',
- name: response.data.name,
- url: response.data.url,
- modelId: this.rowData.typeId,
- fileType: this.rowData.fileType
- // "dictLabel": this.rowData.dictLabel,
+ "taskId": this.taskId,
+ "taskType": "0",
+ "name": response.data.name,
+ "url": response.data.url,
+ "modelId": this.rowData.partId,
+ "fileType": this.rowData.fileType,
+ // "dictLabel": this.rowData.dictLabel,
}
//根据文件上传返回更新文件管理弹窗内容
let index = this.fileDataList.findIndex(v=>v.fileType==this.rowData.fileType)
@@ -990,27 +1179,61 @@ export default {
}else{
this.rowData.bmFileInfos.push(obj)
}
- } else {
- //编辑逻辑
- let param = {
- taskId: this.taskId,
- taskType: '0',
- name: response.data.name,
- url: response.data.url,
- modelId: this.rowData.typeId,
- fileType: this.rowData.fileType
- // "dictLabel": this.rowData.dictLabel,
+
+ } else {//编辑逻辑
+ row.fileListTemp.push({
+ "name": response.data.name,
+ "url": response.data.url,
+ })
+ let obj = {
+ "taskId": this.taskId,
+ "taskType": "0",
+ "name": response.data.name,
+ "url": response.data.url,
+ "modelId": this.rowData.partId,
+ "fileType": this.rowData.fileType,
+ // "dictLabel": this.rowData.dictLabel,
+ }
+ //根据文件上传返回更新文件管理弹窗内容
+ let index = this.fileDataList.findIndex(v=>v.fileType==this.rowData.fileType)
+ this.fileDataList[index].name = response.data.name
+ this.fileDataList[index].url = response.data.url
+ //判断当前上传的文件是否已上传过-再往机具类型数据中插入
+ if(this.rowData.bmFileInfos.length>0){
+ let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
+ if(index2>-1){//相同类型文件重复上传-替换
+ this.rowData.bmFileInfos.splice(index2,0,obj)
+ }else{//不存在相同类型文件-添加
+ this.rowData.bmFileInfos.push(obj)
+ }
+ }else{
+ this.rowData.bmFileInfos.push(obj)
}
- uploadPurchaseFile(param)
- .then(response => {
+ uploadPurchaseFile(param).then((response) => {
this.$modal.msgSuccess('上传成功')
- this.getFileData()
+
}).catch(() => {
this.$modal.msgError('上传失败')
})
}
}
},
+
+ picturePreviewFile(row) {
+ row.fileList = []
+ row.fileListTemp.forEach(item=>{
+ row.fileList.push({
+ "name": item.name,
+ "url": item.url,
+ })
+ })
+ this.fileId = row.fileType
+ this.fileListInfo = row.fileListTemp
+
+ this.dialogVisibleFile = true
+ },
+
+
//图片查看
picturePreview(file) {
this.dialogImageUrl = file.url.replaceAll("#","%23")
@@ -1024,6 +1247,25 @@ export default {
}
},
+ //删除图片
+ pictureDelete(row, id) {
+ let index = id
+ this.fileListInfo = this.fileListInfo.filter(item => item.url !== row.url);
+ this.fileDataList[this.fileId].fileList = this.fileDataList[this.fileId].fileList.filter(item => item.url !== row.url);
+ this.fileDataList[this.fileId].fileListTemp = this.fileDataList[this.fileId].fileListTemp.filter(item => item.url !== row.url);
+ let bmFiles = []
+ this.rowData.bmFileInfos.forEach((item)=>{
+ if (item.fileType != this.fileId) {
+ bmFiles.push(item)
+ }else{
+ if (item.url!= row.url) {
+ bmFiles.push(item)
+ }
+ }
+ })
+ this.rowData.bmFileInfos = bmFiles;
+ },
+
/** 删除按钮操作 */
handleDelete(row) {
// console.log(row.id)
@@ -1140,6 +1382,9 @@ export default {
}