配件新增bug修复
This commit is contained in:
parent
d6a7de4a9e
commit
0ad9db8776
|
|
@ -139,4 +139,21 @@ export function getSltRecordInfo(data) {
|
|||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 减免记录查询-列表
|
||||
export function getReliefRecordList(query) {
|
||||
return request({
|
||||
url: '/material/derateRecordQuery/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 减免记录-删除
|
||||
export function deleteRedif(id) {
|
||||
return request({
|
||||
url: '/material/derateRecordQuery/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<div class="costTwo">{{finishCostName}}</div>
|
||||
</div>
|
||||
<div class="costRight">
|
||||
{{ finishCost }}
|
||||
{{ costAll.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelAllTopFour">
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="tabelAll">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ loseCost }}
|
||||
|
|
@ -209,17 +209,17 @@
|
|||
<el-table-column label="减免费用明细" align="center">
|
||||
<el-table-column label="序号" align="center" type="index" width="60"/>
|
||||
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="租赁单价" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免数量" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免开始日期" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免结束日期" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免天数" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免原因" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-if="scope.row.costs">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
<el-table-column label="规格型号" align="center" prop="modeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免数量" align="center" prop="reduceNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免开始日期" align="center" prop="startTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免结束日期" align="center" prop="endTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免天数" align="center" prop="days" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免原因" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="减免费用(元)" align="center" prop="leaseMoney" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-if="scope.row.leaseMoney">
|
||||
{{ scope.row.leaseMoney.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -286,6 +286,67 @@ export default {
|
|||
// this.getProjectList();
|
||||
},
|
||||
methods: {
|
||||
// 将数字转换为中文大写金额
|
||||
numberToChinese(num) {
|
||||
const cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
||||
const cnIntRadice = ['', '拾', '佰', '仟'];
|
||||
const cnIntUnits = ['', '万', '亿', '兆'];
|
||||
const cnDecUnits = ['角', '分', '毫', '厘'];
|
||||
const cnInteger = '整';
|
||||
const cnIntLast = '元';
|
||||
let integerNum;
|
||||
let decimalNum;
|
||||
let chineseStr = '';
|
||||
let parts;
|
||||
if (num === 0) {
|
||||
return cnNums[0] + cnIntLast + cnInteger;
|
||||
}
|
||||
num = parseFloat(num).toFixed(4);
|
||||
parts = num.split('.');
|
||||
integerNum = parts[0];
|
||||
decimalNum = parts[1];
|
||||
if (parseInt(integerNum, 10) > 0) {
|
||||
let zeroCount = 0;
|
||||
const IntLen = integerNum.length;
|
||||
for (let i = 0; i < IntLen; i++) {
|
||||
const n = integerNum.substr(i, 1);
|
||||
const p = IntLen - i - 1;
|
||||
const q = p / 4;
|
||||
const m = p % 4;
|
||||
if (n === '0') {
|
||||
zeroCount++;
|
||||
} else {
|
||||
if (zeroCount > 0) {
|
||||
chineseStr += cnNums[0];
|
||||
}
|
||||
zeroCount = 0;
|
||||
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
|
||||
}
|
||||
if (m === 0 && zeroCount < 4) {
|
||||
chineseStr += cnIntUnits[q];
|
||||
}
|
||||
}
|
||||
chineseStr += cnIntLast;
|
||||
}
|
||||
if (decimalNum !== '') {
|
||||
const decLen = decimalNum.length;
|
||||
for (let i = 0; i < decLen; i++) {
|
||||
const n = decimalNum.substr(i, 1);
|
||||
if (n !== '0') {
|
||||
chineseStr += cnNums[Number(n)] + cnDecUnits[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (chineseStr === '') {
|
||||
chineseStr += cnNums[0] + cnIntLast + cnInteger;
|
||||
} else if (decimalNum === '00' || decimalNum === '0000') {
|
||||
chineseStr += cnInteger;
|
||||
}
|
||||
return chineseStr;
|
||||
},
|
||||
|
||||
|
||||
|
||||
//获取单位类型 ,getUnitList, getProjectList
|
||||
getUnitList() {
|
||||
getUnitList().then((response) => {
|
||||
|
|
@ -315,18 +376,25 @@ export default {
|
|||
|
||||
this.loseList = response.data.loseList //丢失费用列表
|
||||
this.loseCost = this.countCost(this.loseList)
|
||||
|
||||
this.reducList = response.data.reductionList //减免费用列表
|
||||
console.log('111111111111111111',this.reducList)
|
||||
this.reducList.forEach((item) => {
|
||||
this.reducCost = Number(this.reducCost) + Number(item.leaseMoney)
|
||||
})
|
||||
console.log('2222222222222222',this.reducCost)
|
||||
this.applyList = response.data.relations
|
||||
this.applyList.forEach((item) => {
|
||||
item.leaseCost = Number(item.leaseCost)
|
||||
item.repairCost = Number(item.repairCost)
|
||||
item.scrapCost = Number(item.scrapCost)
|
||||
item.loseCost = Number(item.loseCost)
|
||||
item.reductionCost = Number(item.reductionCost)
|
||||
item.cost =
|
||||
Number(item.leaseCost) +
|
||||
Number(item.repairCost) +
|
||||
Number(item.scrapCost) +
|
||||
Number(item.loseCost) +
|
||||
Number(item.reductionCost)
|
||||
Number(item.addCost) -
|
||||
Number(item.subCost)
|
||||
})
|
||||
|
|
@ -335,8 +403,10 @@ export default {
|
|||
Number(this.leaseCost) +
|
||||
Number(this.repairCost) +
|
||||
Number(this.scrapCost) +
|
||||
Number(this.loseCost)
|
||||
Number(this.loseCost) +
|
||||
Number(this.reducCost)
|
||||
this.costAll = costSum
|
||||
this.finishCostName = this.numberToChinese(this.costAll.toFixed(2));
|
||||
this.subCostFlag = costSum
|
||||
})
|
||||
},
|
||||
|
|
@ -389,6 +459,7 @@ export default {
|
|||
Number(row.repairCost) +
|
||||
Number(row.scrapCost) +
|
||||
Number(row.loseCost) +
|
||||
Number(row.reduceLeaseMoney) +
|
||||
Number(row.addCost || 0) -
|
||||
Number(row.subCost || 0)
|
||||
},
|
||||
|
|
@ -454,6 +525,14 @@ export default {
|
|||
`减免费用明细_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
handleExport5() {
|
||||
const params = this.rowData
|
||||
this.download(
|
||||
'material/slt_agreement_info/exportReduction',
|
||||
{...params,},
|
||||
`减免费用明细_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
|
||||
handleExportAll() {
|
||||
const params = this.rowData
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
>
|
||||
<el-option label="待审核" value="0"></el-option>
|
||||
<el-option label="审核中" value="1"></el-option>
|
||||
<el-option label="已审核" value="1"></el-option>
|
||||
<el-option label="已审核" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
@ -57,48 +57,57 @@
|
|||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="pushReviewList"
|
||||
:data="formList"
|
||||
ref="multipleTable"
|
||||
row-key="id"
|
||||
border
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template scope="scope">
|
||||
<span style="background-color: #f8f8f9;text-align: center;" v-if="scope.$index==pushReviewList.length-1">小计:</span>
|
||||
<span v-else>{{ scope.$index+1 }} </span>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(queryParams.pageNum - 1) * 10 + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center" prop="maName" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" align="center" prop="maModel" show-overflow-tooltip />
|
||||
<el-table-column label="租赁单位" align="center" prop="maUnit" show-overflow-tooltip />
|
||||
<el-table-column label="租赁工程" align="center" prop="leasePrice" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope" v-if="scope.row.num">
|
||||
{{ scope.row.leasePrice.toFixed(2) }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁费用(元)" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<el-table-column label="申请时间" align="center" prop="createTime" show-overflow-tooltip width="200px"/>
|
||||
<el-table-column label="申请人" align="center" prop="createBy" show-overflow-tooltip />
|
||||
<el-table-column label="租赁单位" align="center" prop="unitName" show-overflow-tooltip />
|
||||
<el-table-column label="租赁工程" align="center" prop="projectName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="租赁费用(元)" align="center" prop="leasePrice" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
{{ scope.row.leasePrice.toFixed(2) }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="本次减免费用(元)" align="center" prop="startTime" :show-overflow-tooltip="true" width="150px"/>
|
||||
<el-table-column label="累计减免费用(元) " align="center" prop="endTime" :show-overflow-tooltip="true" width="150px"/>
|
||||
<el-table-column label="状态" align="center" prop="leaseMoney" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="备注" align="center" prop="leaseMoney" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="本次减免费用(元)" align="center" prop="leaseMoney" :show-overflow-tooltip="true" width="150px">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ scope.row.leaseMoney.toFixed(2) }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="累计减免费用(元) " align="center" prop="leaseMoneyAll" :show-overflow-tooltip="true" width="150px">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ scope.row.leaseMoneyAll.toFixed(2) }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == '0'">待审核</span>
|
||||
<span v-if="scope.row.status == '1'">审核中</span>
|
||||
<span v-if="scope.row.status == '2'">已审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-search" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus == '0'"
|
||||
v-if="scope.row.status != '2'"
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row, 2)"
|
||||
@click="handleEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus == '0'"
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
|
|
@ -110,6 +119,13 @@
|
|||
</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="showApply" width="1400px" append-to-body @close="closeDiag">
|
||||
|
|
@ -296,12 +312,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProjectList,
|
||||
getUnitList,
|
||||
getAgreementInfoById,
|
||||
} from '@/api/back/index.js'
|
||||
|
||||
import {getReliefList,addRelief } from "@/api/cost/cost";
|
||||
import {getReliefRecordList,deleteRedif } from "@/api/business/index";
|
||||
import {downloadFile, downloadFileData} from '@/utils/download'
|
||||
import {getToken} from '@/utils/auth'
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
|
|
@ -322,16 +335,15 @@ export default {
|
|||
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表格数据
|
||||
formList: [],
|
||||
// 费用推送审核表格数据
|
||||
pushReviewList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 单位数据
|
||||
unitList: [],
|
||||
// 工程数据
|
||||
proList: [],
|
||||
|
||||
|
||||
//合计
|
||||
moneyAll: 0,
|
||||
|
|
@ -343,6 +355,8 @@ export default {
|
|||
status: null,
|
||||
keyWork: '',
|
||||
time:null,
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
|
|
@ -421,151 +435,29 @@ export default {
|
|||
return '';
|
||||
},
|
||||
|
||||
//多选框选中数据
|
||||
handleSelectionChange(val) {
|
||||
this.ids = val.map(item => item.id);
|
||||
},
|
||||
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
// 获取 单位 列表数据
|
||||
async GetUnitData() {
|
||||
const params = {
|
||||
// projectId: this.queryParams.projectId /* */,
|
||||
}
|
||||
const res = await getUnitList(params)
|
||||
this.unitList = res.data;
|
||||
|
||||
this.getAgreementInfo()
|
||||
},
|
||||
unitChange(val) {
|
||||
setTimeout(() => {
|
||||
this.queryParams.projectId = null
|
||||
this.queryParams.agreementId = null
|
||||
this.queryParams.agreementCode = null
|
||||
this.GetProData()
|
||||
}, 500)
|
||||
},
|
||||
// 获取 工程名称 列表数据
|
||||
async GetProData() {
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
}
|
||||
const res = await getProjectList(params)
|
||||
this.proList = res.data;
|
||||
|
||||
this.getAgreementInfo()
|
||||
},
|
||||
proChange(val) {
|
||||
setTimeout(() => {
|
||||
this.GetUnitData()
|
||||
}, 500)
|
||||
},
|
||||
|
||||
// 获取 协议id
|
||||
async getAgreementInfo() {
|
||||
if (this.queryParams.unitId && this.queryParams.projectId) {
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
projectId: this.queryParams.projectId,
|
||||
}
|
||||
const res = await getAgreementInfoById(params)
|
||||
console.log(res)
|
||||
if (!(res.data && res.data.agreementId)) {
|
||||
this.$message.error('当前单位和工程无协议!')
|
||||
this.queryParams.unitId = null
|
||||
this.queryParams.projectId = null
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
} else {
|
||||
this.queryParams.agreementId = res.data.agreementId
|
||||
this.queryParams.agreementCode = res.data.agreementCode
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
this.loading = true;
|
||||
// this.pushReviewList = [
|
||||
// {
|
||||
// id:1,
|
||||
// deviceName: '小吊绳',
|
||||
// typeName: '200m',
|
||||
// unit: '根',
|
||||
// leasePrice: 3.00,
|
||||
// num: 10,
|
||||
// startTime: '2025-01-07',
|
||||
// backNum: '1',
|
||||
// endTime: null,
|
||||
// leaseDays: 17,
|
||||
// costs: 510.00,
|
||||
// },
|
||||
// {
|
||||
// id:2,
|
||||
// deviceName: '牵引绳卡线器',
|
||||
// typeName: 'φ11~15',
|
||||
// unit: '把',
|
||||
// leasePrice: 0.9,
|
||||
// num: 26,
|
||||
// startTime: '2025-01-06',
|
||||
// backNum: '1',
|
||||
// endTime: '2025-01-23',
|
||||
// leaseDays: 18,
|
||||
// costs: 421.20,
|
||||
// },
|
||||
// {
|
||||
// id:3,
|
||||
// deviceName: '挡土地锚',
|
||||
// typeName: 'DTDM-1',
|
||||
// unit: '只',
|
||||
// leasePrice: 0.04,
|
||||
// num: 76,
|
||||
// startTime: '2025-01-07',
|
||||
// backNum: '1',
|
||||
// endTime: '2025-01-23',
|
||||
// leaseDays: 17,
|
||||
// costs: 51.68,
|
||||
// },
|
||||
// ];
|
||||
// this.leaseAll = this.pushReviewList.reduce((total, item) => {
|
||||
// return total + Number(item.costs);
|
||||
// }, 0);
|
||||
// let obj = {
|
||||
// id:null,
|
||||
// costs: this.leaseAll,
|
||||
// }
|
||||
// this.pushReviewList.push(obj)
|
||||
|
||||
const params = {
|
||||
deviceName: this.queryParams.deviceName,
|
||||
typeName: this.queryParams.typeName,
|
||||
agreementId: this.queryParams.agreementId,
|
||||
keyWord: this.queryParams.keyWord,
|
||||
status: this.queryParams.status,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
}
|
||||
|
||||
getReliefList(params).then((response) => {
|
||||
this.pushReviewList = response.data;
|
||||
console.log('22222222',this.pushReviewList)
|
||||
this.leaseAll = this.pushReviewList.reduce((total, item) => {
|
||||
return total + Number(item.leaseMoney);
|
||||
}, 0);
|
||||
let obj = {
|
||||
id:null,
|
||||
leaseMoney: this.leaseAll,
|
||||
}
|
||||
this.pushReviewList.push(obj)
|
||||
getReliefRecordList(params).then((response) => {
|
||||
this.total = response.total;
|
||||
this.formList = response.rows;
|
||||
// console.log('22222222',this.pushReviewList)
|
||||
// this.leaseAll = this.pushReviewList.reduce((total, item) => {
|
||||
// return total + Number(item.leaseMoney);
|
||||
// }, 0);
|
||||
// let obj = {
|
||||
// id:null,
|
||||
// leaseMoney: this.leaseAll,
|
||||
// }
|
||||
// this.pushReviewList.push(obj)
|
||||
});
|
||||
|
||||
this.loading = false;
|
||||
|
|
@ -589,14 +481,19 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm("是否确认删除所选择的数据项?")
|
||||
.then(function () {
|
||||
return deleteRedif(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
|
||||
/** 减免申请按钮 */
|
||||
handleApply() {
|
||||
if (this.ids.length == 0) {
|
||||
|
|
@ -634,6 +531,37 @@ export default {
|
|||
this.title = "减免申请";
|
||||
},
|
||||
|
||||
//查看
|
||||
handleView(row) {
|
||||
this.showApply = true;
|
||||
this.title = "查看";
|
||||
this.uploadKey = Date.now();
|
||||
this.delBusinessFileIdList=[];
|
||||
this.applyList=[];
|
||||
this.applyListTemp=[];
|
||||
this.applyList = JSON.parse(JSON.stringify(row));
|
||||
this.applyList.forEach((item) => {
|
||||
this.$set(item,'reduceNum', item.num);
|
||||
this.$set(item,'reduceDays', 0);
|
||||
this.$set(item,'reduceLeaseMoney', 0);
|
||||
});
|
||||
},
|
||||
|
||||
//编辑
|
||||
handleEdit(row) {
|
||||
this.showApply = true;
|
||||
this.title = "编辑";
|
||||
this.uploadKey = Date.now();
|
||||
this.delBusinessFileIdList=[];
|
||||
this.applyList=[];
|
||||
this.applyListTemp=[];
|
||||
this.applyList = JSON.parse(JSON.stringify(row));
|
||||
this.applyList.forEach((item) => {
|
||||
this.$set(item,'reduceNum', item.num);
|
||||
this.$set(item,'reduceDays', 0);
|
||||
this.$set(item,'reduceLeaseMoney', 0);
|
||||
});
|
||||
},
|
||||
// 合并单元格 rowIndex=行数 columnIndex=列数
|
||||
// 这里是合并table的除表头外的第一行的第二列 + 除表头外的第二行的第二列
|
||||
// 注意列数和行数从 0 开始
|
||||
|
|
|
|||
|
|
@ -187,11 +187,11 @@
|
|||
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
|
||||
<!-- <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purchase_task_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
|
||||
<!-- <el-table-column
|
||||
align="center"
|
||||
|
|
@ -203,7 +203,7 @@
|
|||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.status==0"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: red"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,643 @@
|
|||
<template>
|
||||
<div class="app-container" id="acceptDetail">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="类型规格:" prop="partId">
|
||||
<el-select
|
||||
v-model="queryParams.partId"
|
||||
placeholder="请选择类型规格"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in materialModelList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="机具厂家:" prop="supplierId">
|
||||
<el-select v-model="queryParams.supplierId" placeholder="请选择机具厂家" clearable>
|
||||
<el-option
|
||||
v-for="dict in supplierList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="出厂日期:" prop="productionTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.productionTime"
|
||||
placeholder="请选择出厂日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
>
|
||||
</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="primary"
|
||||
size="mini"
|
||||
icon="el-icon-back"
|
||||
@click="jumpList"
|
||||
>配件验收</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
@click="batchPass"
|
||||
icon="el-icon-check"
|
||||
v-show="!isView"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
>合格</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="batchReject"
|
||||
icon="el-icon-close"
|
||||
v-show="!isView"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
>不合格</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
ref="multipleTable"
|
||||
row-key="partId"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center" :selectable="selectable"
|
||||
:reserve-selection="true"
|
||||
/>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="配件类型"
|
||||
align="center"
|
||||
prop="maName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="配件名称"
|
||||
align="center"
|
||||
prop="maTypeName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="partName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="到货数量"
|
||||
align="center"
|
||||
prop="purchaseNum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center"
|
||||
prop="unitName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<!-- <el-table-column
|
||||
label="供应商"
|
||||
align="center"
|
||||
prop="supplier"
|
||||
:show-overflow-tooltip="true"
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="出厂日期"
|
||||
align="center"
|
||||
prop="productionTime"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="相关配套资料"
|
||||
align="center"
|
||||
prop=""
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #02A7F0;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==1">报告管理</div>
|
||||
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.purchase_task_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="操作" align="center" width="180" v-if="!isView">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="success" @click="pass(scope.row)" v-if="scope.row.status==0">
|
||||
入库
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="reject(scope.row)" v-if="scope.row.status==0">
|
||||
驳回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 验收弹窗 -->
|
||||
<el-dialog title="验收" :visible.sync="confirmShow" width="600px" height="300px">
|
||||
<div style="width: 100%; height: 80%; display: flex;margin-bottom: 10px;">
|
||||
<div style="width:15%;">验收结论:</div>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3" style="width:80%;"
|
||||
placeholder="请输入结论"
|
||||
v-model="checkResult"
|
||||
maxlength="100">
|
||||
</el-input>
|
||||
</div>
|
||||
<div style="width: 100%;height: 20%;display: flex;justify-content: flex-end;align-items: center;">
|
||||
<el-button type="primary" @click="confirmCheck">确认</el-button>
|
||||
<el-button size="mini" @click="confirmShow = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<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" :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.partName}}</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: center;">
|
||||
<!-- <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="picturePreviewFile(scope.row)" v-if="scope.row.fileListTemp!=0">
|
||||
查看
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 图片查看弹窗 -->
|
||||
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
|
||||
<img width="100%" height="500px" :src="dialogImageUrl" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 文件查看列表 -->
|
||||
<el-dialog title="文件列表" :visible.sync="dialogVisibleFile" width="500px" height="500px" >
|
||||
<el-table :data="fileListInfo" width="100%" height="350px">
|
||||
<el-table-column label="序号" type="index" width="55" align="center"/>
|
||||
<el-table-column label="文件名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url" >
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getManufacturerSelect } from "@/api/ma/supplier";
|
||||
import {
|
||||
acceptInnerVerifyer,
|
||||
getPurchaseFileList,
|
||||
uploadPurchaseFile,
|
||||
} from "@/api/purchase/goodsAccept";
|
||||
import { getPartType,partTypeWarehouse,partTypeReject,innerVerify } from '@/api/part/partAccept';
|
||||
import { getPartTypeCheckInfo,getPartTypeFileList } from '@/api/part/partArrived';
|
||||
import { downloadFile } from "@/utils/download";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "AcceptDetail",
|
||||
dicts: ["purchase_task_status"],
|
||||
data() {
|
||||
return {
|
||||
Id: "",
|
||||
taskId: "",
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
dialogLoading: false,
|
||||
isView: false,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showHouse: false,
|
||||
materialModelList: [], //规格型号下拉
|
||||
supplierList: [], //厂家下拉
|
||||
ids: [],
|
||||
infos: [],
|
||||
checkList: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
//表格数据
|
||||
tableList: [],
|
||||
fixCodeList: ["否", "是"],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
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: "" },
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
partId: undefined,
|
||||
supplierId: undefined,
|
||||
productionTime: undefined,
|
||||
},
|
||||
//确认弹窗
|
||||
confirmShow: false,
|
||||
taskStatus: "", //3合格、1不合格
|
||||
checkResult: "",
|
||||
verifyPass: true, //true合格、false不合格
|
||||
//图片查看弹窗
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
//上传
|
||||
upload: {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/file/upload",
|
||||
},
|
||||
fileListInfo:[],
|
||||
dialogVisibleFile: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const taskId = this.$route.query && this.$route.query.taskId;
|
||||
const Id = this.$route.query && this.$route.query.Id;
|
||||
const isView = this.$route.query && this.$route.query.isView;
|
||||
this.taskId = taskId;
|
||||
this.Id = Id;
|
||||
if (isView == "true") {
|
||||
this.isView = true;
|
||||
} else {
|
||||
this.isView = false;
|
||||
}
|
||||
this.getPartType();
|
||||
console.log(this.isView);
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
console.log(row)
|
||||
if (row.status == 2||row.status == 13 ||row.status == 14) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 返回列表页
|
||||
jumpList() {
|
||||
const obj = { path: "/part/partAcceptTwo" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
},
|
||||
getPartType() {
|
||||
getPartType({ level: 3 }).then((response) => {
|
||||
let matModelRes = response.data;
|
||||
this.materialModelList = matModelRes.map((item) => {
|
||||
return {
|
||||
label: item.partName,
|
||||
value: item.partId,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
getSupplierList() {
|
||||
getManufacturerSelect().then((response) => {
|
||||
let arrRes = response.rows;
|
||||
this.supplierList = arrRes.map((item) => {
|
||||
return {
|
||||
label: item.supplier,
|
||||
value: item.supplierId,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.id = this.Id;
|
||||
this.queryParams.taskId = this.taskId;
|
||||
getPartTypeCheckInfo(this.queryParams).then((response) => {
|
||||
this.tableList = response.data.partTypeCheckDetailsList;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.keyWord = null;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection;
|
||||
this.infos = [];
|
||||
selection.forEach((item) => {
|
||||
this.infos.push({id:item.id,partId:item.partId,purchaseNum:item.purchaseNum,taskId:item.taskId});
|
||||
});
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
//入库
|
||||
pass(row) {
|
||||
// if(this.infos==0){
|
||||
// this.$modal.msgError("请选择配件");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
|
||||
this.$modal.confirm('是否确认入库该配件?')
|
||||
.then(function() {
|
||||
return partTypeWarehouse(infos)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('入库成功')
|
||||
this.getList()
|
||||
}).catch(() => {});
|
||||
},
|
||||
//驳回
|
||||
reject(row) {
|
||||
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
|
||||
this.$modal.confirm('是否确认驳回该配件?')
|
||||
.then(function() {
|
||||
return partTypeReject(infos)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('驳回成功')
|
||||
this.getList()
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
//批量入库
|
||||
batchPass() {
|
||||
if(this.infos==0){
|
||||
this.$modal.msgError("请选择配件");
|
||||
return;
|
||||
}
|
||||
this.taskStatus = "3";
|
||||
this.checkResult = "合格";
|
||||
this.verifyPass = true;
|
||||
this.checkList = [];
|
||||
this.checkList = this.ids.map((item) => {
|
||||
let obj = {
|
||||
taskId: item.taskId,
|
||||
partId: item.partId,
|
||||
checkResult: this.checkResult,
|
||||
};
|
||||
return obj;
|
||||
});
|
||||
this.confirmShow = true;
|
||||
},
|
||||
|
||||
//批量驳回
|
||||
batchReject() {
|
||||
if(this.infos==0){
|
||||
this.$modal.msgError("请选择配件");
|
||||
return;
|
||||
}
|
||||
this.taskStatus = "1";
|
||||
this.checkResult = "不合格";
|
||||
this.verifyPass = false;
|
||||
this.checkList = [];
|
||||
this.checkList = this.ids.map((item) => {
|
||||
let obj = {
|
||||
taskId: item.taskId,
|
||||
partId: item.partId,
|
||||
checkResult: this.checkResult,
|
||||
};
|
||||
return obj;
|
||||
});
|
||||
this.confirmShow = true;
|
||||
},
|
||||
|
||||
//验收确认请求
|
||||
confirmCheck() {
|
||||
this.checkList.forEach((item) => {
|
||||
item.checkResult = this.checkResult;
|
||||
});
|
||||
let param = {
|
||||
purchaseCheckDetailsList:this.checkList,
|
||||
verifyPass:this.verifyPass
|
||||
}
|
||||
console.log(param);
|
||||
innerVerify(param).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("验收成功");
|
||||
this.confirmShow = false;
|
||||
this.getList();
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
});
|
||||
},
|
||||
//文件管理
|
||||
openFileDialog(row){
|
||||
this.rowData=row;
|
||||
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:[]}]
|
||||
this.getFileData()
|
||||
this.open=true
|
||||
},
|
||||
getFileData(){
|
||||
let param = {
|
||||
modelId:this.rowData.partId,
|
||||
taskType:13,
|
||||
taskId:this.rowData.taskId
|
||||
}
|
||||
getPartTypeFileList(param).then((response) => {
|
||||
if(response.data.length>0){
|
||||
response.data.forEach(item=>{
|
||||
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
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
//上传
|
||||
beforeFileUpload(row) {
|
||||
this.rowData.fileType = row.fileType;
|
||||
// this.rowData.dictLabel=row.dictLabel;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code == 200) {
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskType: "0",
|
||||
name: response.data.name,
|
||||
url: response.data.url,
|
||||
modelId: this.rowData.typeId,
|
||||
fileType: this.rowData.fileType,
|
||||
};
|
||||
console.log(param);
|
||||
uploadPurchaseFile(param)
|
||||
.then((response) => {
|
||||
this.$modal.msgSuccess("上传成功");
|
||||
this.getFileData();
|
||||
})
|
||||
.catch(() => {
|
||||
this.$modal.msgError("上传失败");
|
||||
});
|
||||
}
|
||||
},
|
||||
picturePreviewFile(row) {
|
||||
this.fileListInfo = row.fileListTemp
|
||||
|
||||
this.dialogVisibleFile = true
|
||||
},
|
||||
//图片查看
|
||||
picturePreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
const parts = file.name.split(".");
|
||||
const extension = parts.pop();
|
||||
if (extension === 'doc' || extension === 'DOC' || extension === 'docx' || extension === 'DOCX' || extension === 'pdf' || extension === 'PDF') {
|
||||
const windowName = file.name;
|
||||
window.open(file.url, windowName);
|
||||
} else {
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"/material/part_arrived/exportDetails",
|
||||
{ taskId: this.taskId },
|
||||
`新购到货详情_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uploadImg {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.deviceCode {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,475 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
maxlength="20"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="taskStatus">
|
||||
<el-select
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
placeholder="状态筛选"
|
||||
v-model="queryParams.taskStatus"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
v-for="dict in taskStatusList"
|
||||
/>
|
||||
</el-select>
|
||||
</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>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="taskId" @selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="selectable"/>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到货时间" align="center" prop="arrivalTime" width="200" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购单号" align="center" prop="code" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购配件" align="center" prop="purchaseMaTypeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购数量" align="center" prop="purchaseMaNumber" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="物资厂家" align="center" prop="supplier" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="状态" align="center" prop="taskStatusName" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleView(scope.row)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary" v-if="scope.row.taskStatusName == '未完成'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>
|
||||
验收
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handlePrint(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="openPrint"
|
||||
width="1090px"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 500px; overflow-y: scroll">
|
||||
<!-- <vue-easy-print tableShow ref="remarksPrintRef" class="print"> -->
|
||||
<div id="checkId">
|
||||
<div
|
||||
class="title"
|
||||
style="text-align: center; font-weight: 600; font-size: 16px"
|
||||
>
|
||||
机具配件到货验收单
|
||||
</div>
|
||||
<div
|
||||
class="info"
|
||||
style="margin-top: 10px; display: flex; flex-wrap: wrap"
|
||||
>
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>单据编号:{{printData.code}}</span>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>生产厂家(供应商):{{printData.supplier}}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>到货日期:{{printData.arrivalTime}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="printTableData"
|
||||
class="table"
|
||||
style="margin-top: 20px; width: 1000px; "
|
||||
border
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="序号" align="center" type="index" row="2" width="60px"/>
|
||||
<el-table-column
|
||||
label="配件类型"
|
||||
align="center"
|
||||
prop="maName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="配件名称"
|
||||
align="center"
|
||||
prop="maTypeName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="partName"
|
||||
/>
|
||||
<el-table-column label="单位" align="center" prop="unitName" />
|
||||
<!-- <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="checkResult"
|
||||
/>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="fillIn" style="margin-top: 20px;display: flex;justify-content: space-between;" >
|
||||
<div class="item" style="width: 33%;display: flex;align-items: center;">
|
||||
<div style="width: 25%;">供应科:</div>
|
||||
<div style="width: 75%;display: flex;align-items: center;flex-wrap: wrap;" v-if="printDataSign.gySignUrl">
|
||||
<div v-for="(sign, index) in printDataSign.gySignUrl" :key="index" style="width: 35%;margin-left: 5px;">
|
||||
<img :src="sign.signUrl" :class="sign.signType=='0' ? 'image-type':'sign-type'" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%;display: flex;align-items: center;">
|
||||
<div style="width: 30%;">生产技术科:</div>
|
||||
<div style="width: 70%;display: flex;align-items: center;flex-wrap: wrap;" v-if="printDataSign.scSignUrl">
|
||||
<div v-for="(sign, index) in printDataSign.scSignUrl" :key="index" style="width: 35%;margin-left: 5px;">
|
||||
<img :src="sign.signUrl" :class="sign.signType=='0' ? 'image-type':'sign-type'" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="width: 33%;display: flex;align-items: center;">
|
||||
<div style="width: 25%;">库管班:</div>
|
||||
<div style="width: 75%;display: flex;align-items: center;flex-wrap: wrap;" v-if="printDataSign.kgSignUrl">
|
||||
<div v-for="(sign, index) in printDataSign.kgSignUrl" :key="index" style="width: 35%;margin-left: 5px;">
|
||||
<img :src="sign.signUrl" :class="sign.signType=='0' ? 'image-type':'sign-type'" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<span>库管班:{{printData.warehouseTeam}}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </vue-easy-print> -->
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="print">打 印</el-button>
|
||||
<el-button @click="openPrint = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getListNewBuy,getInBoundForm } from '@/api/part/partArrived';
|
||||
import { passAll, rejectAll } from '@/api/part/partAccept';
|
||||
import vueEasyPrint from "vue-easy-print";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: "PartAcceptList",
|
||||
dicts: ['part_task_status'],
|
||||
components: { vueEasyPrint },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showHouse: false,
|
||||
dateRange:[],
|
||||
taskStatusList:[{id:'0',name:'未完成'},{id:'1',name:'已完成'}],
|
||||
ids: [],
|
||||
infos: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
//表格数据
|
||||
tableList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord:undefined,
|
||||
taskStatus:undefined,
|
||||
},
|
||||
openPrint: false,
|
||||
printData: {},
|
||||
printDataSign: {},
|
||||
printTableData: [],
|
||||
productionTechDeptOptions: [
|
||||
{ value: '0', label: '张三' },
|
||||
{ value: '1', label: '李四' },
|
||||
{ value: '2', label: '王五' },
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
console.log(row)
|
||||
if (row.taskStatusName == '未完成') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.taskStage = 2;
|
||||
if(this.dateRange.length>0){
|
||||
this.queryParams.startTime=this.dateRange[0]
|
||||
this.queryParams.endTime=this.dateRange[1]
|
||||
}else{
|
||||
this.queryParams.startTime=undefined
|
||||
this.queryParams.endTime=undefined
|
||||
}
|
||||
getListNewBuy(this.queryParams).then(response => {
|
||||
this.tableList = response.data.rows;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.dateRange=[]
|
||||
this.queryParams.keyWord=null;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.taskId)
|
||||
this.infos = [];
|
||||
selection.forEach((item) => {
|
||||
this.infos.push({taskId:item.taskId});
|
||||
});
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleUpdate(row){
|
||||
console.log(row)
|
||||
let query = { Id:row.id,taskId: row.taskId,isView:"false" }
|
||||
this.$tab.closeOpenPage({
|
||||
path: '/part/partAcceptDetailTwo',
|
||||
query,
|
||||
})
|
||||
},
|
||||
//查看
|
||||
handleView(row){
|
||||
console.log(row)
|
||||
let query = { Id:row.id,taskId: row.taskId,isView:"true" }
|
||||
this.$tab.closeOpenPage({
|
||||
path: '/part/partAcceptDetailTwo',
|
||||
query,
|
||||
})
|
||||
},
|
||||
//批量入库
|
||||
passAll(){
|
||||
passAll(this.infos).then((response) => {
|
||||
if(response.code==200){
|
||||
this.$modal.msgSuccess('入库成功')
|
||||
}else{
|
||||
this.$modal.msgSuccess('入库失败')
|
||||
}
|
||||
this.getList()
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}).catch(() => {
|
||||
this.$modal.msgError('入库失败')
|
||||
})
|
||||
},
|
||||
//批量驳回
|
||||
rejectAll(){
|
||||
rejectAll(this.infos).then((response) => {
|
||||
if(response.code==200){
|
||||
this.$modal.msgSuccess('驳回成功')
|
||||
}else{
|
||||
this.$modal.msgSuccess('驳回失败')
|
||||
}
|
||||
this.getList()
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}).catch(() => {
|
||||
this.$modal.msgError('驳回失败')
|
||||
})
|
||||
},
|
||||
//查看入库单
|
||||
handlePrint(row) {
|
||||
// this.query.taskId = row.taskId
|
||||
this.openPrint = true;
|
||||
this.title = "机具配件到货验收单";
|
||||
let params = {
|
||||
id: row.id,
|
||||
taskId: row.taskId,
|
||||
};
|
||||
this.getPrintTable(params)
|
||||
},
|
||||
//获取入库单数据
|
||||
getPrintTable(params) {
|
||||
getInBoundForm({ id: params.id,taskId:params.taskId }).then((response) => {
|
||||
this.printDataSign = response.data;
|
||||
this.printData = response.data.partTypeCheckInfo;
|
||||
this.printTableData = response.data.partTypeCheckDetailsList;
|
||||
|
||||
});
|
||||
},
|
||||
//打印
|
||||
print() {
|
||||
// this.$refs.remarksPrintRef.print()
|
||||
printJS({
|
||||
printable: 'checkId',
|
||||
type: 'html',
|
||||
targetStyles: ['*'],
|
||||
maxWidth:'1400'
|
||||
// 其他配置选项
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.download(
|
||||
"/material/part_arrived/export",
|
||||
{ ...this.queryParams},
|
||||
`配件新购到货_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.image-type {
|
||||
/* 旋转图片 */
|
||||
transform: rotate(-90deg);
|
||||
/* 确保旋转后的图片不会超出容器 */
|
||||
max-width: 100%;
|
||||
/* 保持图片的宽高比 */
|
||||
width: 40px;
|
||||
height: 80px;
|
||||
}
|
||||
.sign-type{
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
}
|
||||
.uploadImg {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.deviceCode {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue