ahdevicemgt-ui/src/views/purchase/confirm/index.vue

224 lines
6.8 KiB
Vue
Raw Normal View History

<template>
<!-- 往来单位管理页面 -->
<div class="app-container">
2024-08-22 10:53:06 +08:00
<PageHeader
v-if="isShowComponent !== 'Index'"
:pageContent="pageContent"
@goBack="goBack"
/>
<!-- 列表 -->
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
2024-08-21 19:56:17 +08:00
:request-api="queryPurchaseConfirmListApi"
ref="tableRef"
2024-08-22 10:53:06 +08:00
v-if="isShowComponent === 'Index'"
@transIdList="getIdList"
:selectable="(row) => {
return row.status === 48
}"
>
<template slot="btn" slot-scope="{ queryParams }">
<el-button type="success" @click="multiConfirm"
>批量到货确认</el-button
>
<el-button @click="handleExportData(queryParams, 'base/customer/export', '往来单位清单')"
>导出</el-button
>
</template>
<template slot="handle" slot-scope="{ data }">
2024-08-21 19:56:17 +08:00
<el-button
type="primary"
size="mini"
2024-08-22 10:53:06 +08:00
@click="toggleDetail(data)"
2024-08-21 19:56:17 +08:00
>查看</el-button
>
<el-button
type="success"
2024-08-21 19:56:17 +08:00
size="mini"
@click="confirmArrival(data.id)"
v-if="data.status === 48"
>到货确认</el-button
>
<!-- <el-button
type="warning"
size="mini"
>解绑</el-button
>-->
2024-08-21 19:56:17 +08:00
<!-- <el-button
type="primary"
size="mini"
@click="handleEditData(data)"
>编辑</el-button
>
<el-button
type="danger"
size="mini"
@click="handleDeleteData(data.id, delStorageConfigListApi)"
>删除</el-button
2024-08-21 19:56:17 +08:00
>-->
</template>
<!-- <template slot="isActive" slot-scope="{ data }">
{{ data.isActive == '1' ? '启用' : '不启用' }}
</template>
<template slot="phone" slot-scope="{ data }">
{{ phoneCrypto(data.phone) }}
</template>-->
2024-08-21 19:56:17 +08:00
<template slot="purchaseNum" slot-scope="{ data }">
{{ data.purchaseNum / storageDex }}
</template>
<template slot="purchasePrice" slot-scope="{ data }">
{{ data.purchasePrice / priceDex }}
</template>
<template slot="notaxPrice" slot-scope="{ data }">
{{ data.notaxPrice / priceDex }}
</template>
<template slot="status" slot-scope="{ data }">
<span style="color: #D9001B">
{{ data.statusName }}
</span>
</template>
</TableModel>
<!-- 新增以及修改时的弹框 -->
2024-08-22 10:53:06 +08:00
<!-- <DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
>
<template slot="outerContent">
2024-08-22 10:53:06 +08:00
&lt;!&ndash; 新增以及修改数据的表单组件 &ndash;&gt;
<FormConfirm
@closeDialog="closeDialog"
:editParams="editParams"
/>
</template>
2024-08-22 10:53:06 +08:00
</DialogModel>-->
<table-confirm
v-if="isShowComponent === 'table-confirm'"
:send-params="transParams"
:send-range="factoryRange"
:send-cascader="cascaderRange"
>
</table-confirm>
</div>
</template>
<script>
import { columnsList, dialogConfig, formLabel, queryStatusSelData } from './config'
import { commonMixin } from '../mixins/common'
2024-08-22 10:53:06 +08:00
import TableConfirm from './components/table-confirm.vue'
import {
2024-08-21 19:56:17 +08:00
queryPurchaseConfirmListApi,
confirmArrivalApi
} from '@/api/purchase/confirm'
2024-08-22 10:53:06 +08:00
import {
querySupplierListApi
} from '@/api/material/masupplier'
import {
queryTypeListApi
} from '@/api/purchase/arrival'
import PageHeader from '@/components/pageHeader/index.vue'
import AddArrival from '@/views/purchase/arrival/components/add-arrival.vue'
export default {
name: 'arrivalConfirmManage',
mixins: [commonMixin], // 混入公共方法和数据
2024-08-22 10:53:06 +08:00
components: { AddArrival, PageHeader, TableConfirm },
created() {
queryStatusSelData()
2024-08-22 10:53:06 +08:00
// 查询厂家
querySupplierListApi().then(res => {
this.factoryRange = res.rows.map(item => {
return {
label: item.name,
value: item.id
}
})
}).catch(err => {})
// 查询物资规格
queryTypeListApi().then(res => {
res.data.forEach(lv1 => {
if(!lv1.children) {
lv1.disabled = true
} else {
lv1.children.forEach(lv2 => {
if(!lv2.children) {
lv2.disabled = true
} else {
lv2.children.forEach(lv3 => {
if(!lv3.children) {
lv3.disabled = true
}
})
}
})
}
})
this.cascaderRange = res.data
}).catch(err => {})
},
methods: {
2024-08-21 19:56:17 +08:00
queryPurchaseConfirmListApi,
2024-08-22 10:53:06 +08:00
querySupplierListApi,
queryTypeListApi,
goBack() {
this.isShowComponent = 'Index'
},
getIdList(list) {
this.multiConfirmList = list
},
2024-08-21 19:56:17 +08:00
// 到货确认
confirmArrival(id) {
let idList = []
idList.push(id)
// 请求
2024-08-21 19:56:17 +08:00
confirmArrivalApi(idList).then(res => {
this.$modal.msgSuccess('提交成功')
this.$refs.tableRef.getTableList()
}).catch(err => {})
2024-08-22 10:53:06 +08:00
},
// 批量确认
multiConfirm() {
if(this.multiConfirmList.length === 0) {
this.$modal.msgError('请选择需要批量确认的物资')
} else {
let idList = []
this.multiConfirmList.forEach(item => {
idList.push(item.id)
})
// 请求
confirmArrivalApi(idList).then(res => {
this.$modal.msgSuccess('提交成功')
this.$refs.tableRef.getTableList()
}).catch(err => {})
}
},
2024-08-22 10:53:06 +08:00
toggleDetail(data) {
this.transParams = data
this.isShowComponent = 'table-confirm'
2024-08-21 19:56:17 +08:00
}
},
data() {
return {
2024-08-22 10:53:06 +08:00
isShowComponent: 'Index',
pageContent: '新购确认列表',
formLabel,
columnsList,
dialogConfig,
addDialogTitle: '新建仓库', // 新建时弹框标题
editDialogTitle: '修改仓库', // 修改时弹框标题
2024-08-21 19:56:17 +08:00
storageDex: 1000,
priceDex: 100,
2024-08-22 10:53:06 +08:00
transParams: undefined,
factoryRange: [],
cascaderRange: [],
multiConfirmList: []
}
},
}
</script>