新购确认-验收相关模块修改

This commit is contained in:
FrancisHu 2024-08-22 10:53:06 +08:00
parent ddd0bc26f5
commit a5a18d2269
10 changed files with 358 additions and 207 deletions

View File

@ -0,0 +1,57 @@
/**
* 新购验收管理页面 API
*/
import request from '@/utils/request'
/** 新购验收查询 */
export const queryPurchaseReceiveListApi = (data) => {
return request.get('/task/purchase/acceptance/list', {
params: data
})
}
/** 查询状态下拉 */
export const queryStatusSelApi = (data) => {
return request.get('/base/tree/getStatus', {
params: data
})
}
/** 厂家查询 */
export const queryFactoryListApi = (data) => {
return request.get('/base/maHouse/all', {
params: data
})
}
/** 类型规格查询 */
export const queryTypeListApi = (data) => {
return request.get('/task/arrival/cascader', {
params: data
})
}
/** 根据value查询单位 */
export const queryMeterByVal = (data) => {
return request.get(`/task/arrival/cascaderById`, {
params: data
})
}
/** 提交到货确认 */
export const confirmArrivalApi = (data) => {
return request.put('/task/purchase/arrival/confirm', data)
}
/** 删除新增到货 */
export const delArrivalApi = (id) => {
return request.delete(`/task/arrival/delete/${id}`, {})
}
/** 新购到货新增 */
export const addArrivalApi = (data) => {
return request.post('/task/arrival/add', data)
}

View File

@ -40,7 +40,7 @@
/>
</el-select>
<el-cascader
v-if="item.f_type === 'selCas'"
v-if="item.f_type === 'selCasAdd'"
v-model="queryParams[item.f_model]"
:options="item.f_selList"
:props="item.optionProps"
@ -48,6 +48,14 @@
@change="handleCas($event, item.f_model, cascaderFunc, extraTableProp)"
style="width: 240px"
/>
<el-cascader
v-if="item.f_type === 'selCas'"
v-model="queryParams[item.f_model]"
:options="item.f_selList"
:props="item.optionProps"
:show-all-levels="false"
style="width: 240px"
/>
<el-date-picker
v-if="item.f_type === 'date'"
v-model="queryParams[item.f_model]"
@ -151,7 +159,7 @@
<el-table-column
align="center"
label="操作"
v-if="handleShow"
v-if="handleShow && showOperation"
:min-width="dynamicWidth"
>
<template slot-scope="{ row }">
@ -197,6 +205,11 @@ export default {
type: Boolean,
default: true,
},
/** 传递参数 */
sendParams: {
type: Object,
default: () => null
},
/** 是否显示查询按钮 */
showSearchBtn: {
type: Boolean,
@ -213,6 +226,10 @@ export default {
extraTableProp: {
type: Object,
default: () => null
},
showOperation: {
type: Boolean,
default: true
}
},
computed: {
@ -267,6 +284,7 @@ export default {
},
created() {
console.log(this.sendParams, 'table')
this.columCheckList = this.columnsList.map(e => {
this.$set(e, 'checked', true)
return e
@ -275,6 +293,7 @@ export default {
this.formLabel.map(e => {
this.$set(this.queryParams, e.f_model, '')
//
if(e.f_rule) {
this.$set(this.formRules, e.f_rule, [
{
required: true,
@ -282,8 +301,15 @@ export default {
trigger: 'blur'
}
])
}
})
// Object.assign(this.queryParams, this.sendParams)
if(this.sendParams !== null) {
Object.assign(this.queryParams, this.sendParams)
/* for(let key in this.sendParams) {
console.log(key, this.sendParams[key])
this.$set(this.queryParams, key, this.sendParams[key])
} */
}
this.getTableList()
},
updated() {
@ -293,10 +319,10 @@ export default {
methods: {
/** 获取列表数据 */
async getTableList() {
if(Object.keys(this.formRules).length !== 0) {
this.$refs.queryFormRef.validate(async valid => {
if (valid) {
this.loading = true
console.log(this.queryParams)
const res = await this.requestApi(this.queryParams)
this.loading = false
console.log(res, '列表数据')
@ -311,6 +337,21 @@ export default {
}
}
})
} else {
this.loading = true
const res = await this.requestApi(this.queryParams)
this.loading = false
console.log(res, '列表数据')
if (res.code === 200) {
if (res.data) {
this.tableList = res.data.rows
this.total = res.data.total
} else {
this.tableList = res.rows
this.total = res.total
}
}
}
},
/** 查询按钮 */
handleQuery() {
@ -336,7 +377,6 @@ export default {
func,
prop
) {
console.log(prop)
this.queryParams[val] = e[e.length - 1]
let setObj = {}
//
@ -344,13 +384,12 @@ export default {
Object.assign(setObj, prop)
}
// id
this.$set(setObj, 'id', this.idCount)
this.idCount++
/* this.$set(setObj, 'id', this.idCount)
this.idCount++ */
//
func({
id: e[e.length - 1]
}).then(res => {
console.log(res)
this.$set(setObj, 'name', res.data.parentName)
this.$set(setObj, 'unitName', res.data.unitName)
this.$set(setObj, 'typeName', res.data.name)
@ -360,7 +399,6 @@ export default {
}
this.tableList.unshift(setObj)
console.log(this.tableList)
},
/** 动态设置操作列的列宽 */
getOperatorWidth() {

View File

@ -143,7 +143,7 @@ export default {
{ f_label: '物资厂家', f_model: 'supplierId', f_type: 'sel', f_selList: this.sendRange },
{ f_label: '出厂日期', f_model: 'productDate', f_type: 'date' },
{ f_label: '税率', f_model: 'taxRate', f_type: 'num' },
{ f_label: '类型规格', f_model: 'typeId', f_type: 'selCas', f_rule: 'typeId', f_selList: this.sendCascader },
{ f_label: '类型规格', f_model: 'typeId', f_type: 'selCasAdd', f_rule: 'typeId', f_selList: this.sendCascader },
{ f_label: '备注', f_model: 'remark', f_type: 'ipt' },
],
columnsListAdd,

View File

@ -1,162 +0,0 @@
<template>
<!-- 往来单位 新增编辑 表单组件 -->
<div>
<el-form
label-width="100px"
size="medium"
ref="contactUnitsParamsRef"
:model="storageConfigParams"
:rules="storageConfigParamsRules"
>
<el-form-item label="仓库名称" prop="houseId">
<el-select v-model="storageConfigParams.houseId">
<el-option
v-for="item in storageConfigRange"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物资名称" prop="typeId">
<treeselect
v-model="storageConfigParams.typeId"
:options="typeRange"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择所属上级"
/>
</el-form-item>
<el-form-item>
<el-button type="success" @click="onSubmit">确定</el-button>
<el-button
@click="
() => {
this.$emit('closeDialog')
}
"
>取消</el-button
>
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
addStorageConfigListApi,
updateStorageConfigListApi
} from '@/api/material/storageConfig'
import {
queryStorageListApi
} from '@/api/material/storage'
import {
queryMaTypeTreeListApi
} from '@/api/material/type'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'FormStorage',
props: {
editParams: {
type: Object,
default: () => null,
},
},
components: { Treeselect },
created() {
this.getHouseRange()
this.getTypeRange()
},
mounted() {
if (this.editParams) {
Object.assign(this.storageConfigParams, this.editParams)
this.subSort = 2
} else {
this.subSort = 1
}
},
data() {
return {
subSort: '', // 1 / 2
storageConfigParams: {
houseId: undefined, //
typeId: undefined, //
},
//
storageConfigRange: [],
//
typeRange: [],
//
storageConfigParamsRules: {
houseId: [
{
required: true,
message: '请输入仓库名称',
trigger: 'blur',
},
],
typeId: [
{
required: true,
message: '请选择物资名称',
trigger: 'blur',
},
],
},
}
},
methods: {
/** 初始化获取仓库下拉 */
getHouseRange() {
queryStorageListApi().then(res => {
console.log(res)
this.storageConfigRange = res.rows.map(item => {
return {
value: item.id,
label: item.name,
}
})
}).catch(err => {})
},
/** 初始化获取类型下拉 */
getTypeRange() {
queryMaTypeTreeListApi().then(res => {
this.typeRange = res.data
}).catch(err => {})
},
/** 确认按钮 */
onSubmit() {
this.$refs.contactUnitsParamsRef.validate((valid) => {
if (valid) {
console.log('校验通过', this.storageConfigParams, this.subSort)
// 1. Api
if(this.subSort === 1) {
addStorageConfigListApi(this.storageConfigParams).then(res => {
console.log(res)
this.$modal.msgSuccess('新增成功')
}).catch(err => {})
} else if(this.subSort === 2) {
updateStorageConfigListApi(this.storageConfigParams).then(res => {
console.log(res)
this.$modal.msgSuccess('修改成功')
}).catch(err => {})
}
// 2.
this.$emit('closeDialog', true)
}
})
},
},
}
</script>
<style scoped>
::v-deep .el-select {
width: 100%;
}
::v-deep .el-form-item__label{
font-weight: normal;
}
</style>

View File

@ -0,0 +1,93 @@
<template>
<!-- 往来单位 新增编辑 表单组件 -->
<div>
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
ref="tableRef"
style="display: flex; flex-direction: column"
:send-params="transObj"
:request-api="queryPurchaseArrivalListInnerApi"
:show-operation="false"
:show-sel="false"
>
<template slot="btn" slot-scope="{ queryParams }">
<el-button type="success"
>确认</el-button>
<el-button type="danger"
>驳回</el-button>
</template>
</TableModel>
</div>
</template>
<script>
import { columnsList } from '../config-table-confirm'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {
queryPurchaseArrivalListInnerApi
} from '@/api/purchase/arrival'
export default {
name: 'TableConfirm',
props: {
editParams: {
type: Object,
default: () => null,
},
sendParams: {
type: Object,
default: () => null,
},
sendRange: {
type: Array,
default: () => null
},
sendCascader: {
type: Array,
default: () => null
}
},
components: { Treeselect },
created() {
console.log(this.sendParams)
this.transObj = { ['id']: this.sendParams['id'] }
},
mounted() {
if (this.editParams) {
Object.assign(this.storageConfigParams, this.editParams)
this.subSort = 2
} else {
this.subSort = 1
}
},
data() {
return {
formLabel: [
{ f_label: '类型规格', f_model: 'typeId', f_type: 'selCas', f_selList: this.sendCascader },
{ f_label: '机具厂家', f_model: 'supplierId', f_type: 'sel', f_selList: this.sendRange },
{ f_label: '出厂日期', f_model: 'productDate', f_type: 'date' },
],
columnsList,
subSort: '', // 1 / 2
storageConfigParams: {
houseId: undefined, //
typeId: undefined, //
},
transObj: {}
}
},
methods: {
queryPurchaseArrivalListInnerApi
},
}
</script>
<style scoped>
::v-deep .el-select {
width: 100%;
}
::v-deep .el-form-item__label{
font-weight: normal;
}
</style>

View File

@ -0,0 +1,24 @@
export const formLabel = [
{ f_label: '类型规格', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '机具厂家', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '出厂日期', f_model: 'keyWord', f_type: 'ipt' },
]
export const columnsList = [
{ t_props: 'arrivalTime', t_label: '物资名称', },
{ t_props: 'purchaseCode', t_label: '规格型号' },
{ t_props: 'purchaseMaterial', t_label: '单位', },
{ t_props: 'purchasePrice', t_label: '购置单价(含税)', t_slot: 'purchasePrice' },
{ t_props: 'notaxPrice', t_label: '购置单价(不含税)', t_slot: 'notaxPrice' },
{ t_props: 'createBy', t_label: '到货数量' },
{ t_props: 'createTime', t_label: '供应商' },
{ t_props: 'status', t_label: '出场日期', t_slot: 'status' },
{ t_props: 'remark', t_label: '相关配套资料' },
]
export const dialogConfig = {
outerWidth: '80%',
outerTitle: '',
outerVisible: false,
}

View File

@ -1,12 +1,18 @@
<template>
<!-- 往来单位管理页面 -->
<div class="app-container">
<PageHeader
v-if="isShowComponent !== 'Index'"
:pageContent="pageContent"
@goBack="goBack"
/>
<!-- 列表 -->
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
:request-api="queryPurchaseConfirmListApi"
ref="tableRef"
v-if="isShowComponent === 'Index'"
>
<template slot="btn" slot-scope="{ queryParams }">
<el-button type="primary" @click="handleAddData()"
@ -21,6 +27,7 @@
<el-button
type="primary"
size="mini"
@click="toggleDetail(data)"
>查看</el-button
>
<el-button
@ -71,36 +78,91 @@
</TableModel>
<!-- 新增以及修改时的弹框 -->
<DialogModel
<!-- <DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
>
<template slot="outerContent">
<!-- 新增以及修改数据的表单组件 -->
&lt;!&ndash; 新增以及修改数据的表单组件 &ndash;&gt;
<FormConfirm
@closeDialog="closeDialog"
:editParams="editParams"
/>
</template>
</DialogModel>
</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 } from './config'
import { commonMixin } from '../mixins/common'
import FormConfirm from './components/form-confirm.vue'
import TableConfirm from './components/table-confirm.vue'
import {
queryPurchaseConfirmListApi,
confirmArrivalApi
} from '@/api/purchase/confirm'
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], //
components: { FormConfirm },
components: { AddArrival, PageHeader, TableConfirm },
created() {
//
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: {
queryPurchaseConfirmListApi,
querySupplierListApi,
queryTypeListApi,
goBack() {
this.isShowComponent = 'Index'
},
//
confirmArrival(id) {
let idList = []
@ -110,10 +172,17 @@ export default {
this.$modal.msgSuccess('提交成功')
this.$refs.tableRef.getTableList()
}).catch(err => {})
},
toggleDetail(data) {
this.transParams = data
console.log(this.transParams, '11111')
this.isShowComponent = 'table-confirm'
}
},
data() {
return {
isShowComponent: 'Index',
pageContent: '新购确认列表',
formLabel,
columnsList,
dialogConfig,
@ -121,6 +190,9 @@ export default {
editDialogTitle: '修改仓库', //
storageDex: 1000,
priceDex: 100,
transParams: undefined,
factoryRange: [],
cascaderRange: []
}
},
}

View File

@ -3,20 +3,19 @@ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' },
{ f_label: '结束时间', f_model: 'endTime', f_type: 'date' },
{ f_label: '关键字', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '状态', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '状态', f_model: 'status', f_type: 'ipt' },
]
export const columnsList = [
{ t_props: 'name', t_label: '到货时间', },
{ t_props: 'address', t_label: '采购单号' },
{ t_props: 'companyMan', t_label: '采购物资' },
{ t_props: 'mainPerson', t_label: '采购数量' },
{ t_props: 'phone', t_label: '采购价格(含税)', },
{ t_props: 'scopeBusiness', t_label: '采购价格(不含税)' },
{ t_props: 'picUrl', t_label: '税率', },
{ t_props: 'notes', t_label: '操作人' },
{ t_props: 'notes', t_label: '操作时间' },
{ t_props: 'notes', t_label: '状态' },
{ t_props: 'notes', t_label: '备注' },
{ t_props: 'arrivalTime', t_label: '到货时间', },
{ t_props: 'purchaseCode', t_label: '采购单号' },
{ t_props: 'purchaseMaterial', t_label: '采购物资', },
{ t_props: 'purchaseNum', t_label: '采购数量', t_slot: 'purchaseNum' },
{ t_props: 'purchasePrice', t_label: '采购价格(含税)', t_slot: 'purchasePrice' },
{ t_props: 'notaxPrice', t_label: '采购价格(不含税)', t_slot: 'notaxPrice' },
{ t_props: 'createBy', t_label: '操作人' },
{ t_props: 'createTime', t_label: '操作时间' },
{ t_props: 'status', t_label: '状态', t_slot: 'status' },
{ t_props: 'remark', t_label: '备注' },
]
export const dialogConfig = {

View File

@ -5,7 +5,7 @@
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
:request-api="queryStorageConfigListApi"
:request-api="queryPurchaseReceiveListApi"
ref="tableRef"
>
<template slot="btn" slot-scope="{ queryParams }">
@ -42,6 +42,20 @@
<template slot="phone" slot-scope="{ data }">
{{ phoneCrypto(data.phone) }}
</template>-->
<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>
<!-- 新增以及修改时的弹框 -->
@ -61,29 +75,45 @@
</template>
<script>
import { columnsList, dialogConfig, formLabel } from './config'
import { columnsList, dialogConfig } from './config'
import { commonMixin } from '../mixins/common'
import FormReceive from './components/form-receive.vue'
import {
queryStorageConfigListApi,
delStorageConfigListApi
} from '@/api/material/storageConfig'
queryPurchaseReceiveListApi,
queryStatusSelApi
} from '@/api/purchase/receive'
export default {
name: 'arrivalReceiveManage',
mixins: [commonMixin], //
components: { FormReceive },
methods: {
queryStorageConfigListApi,
delStorageConfigListApi
queryPurchaseReceiveListApi,
queryStatusSelApi
},
beforeCreate() {
},
created() {
},
mounted() {
},
data() {
return {
formLabel,
formLabel: [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' },
{ f_label: '结束时间', f_model: 'endTime', f_type: 'date' },
{ f_label: '关键字', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '状态', f_model: 'status', f_type: 'sel', f_selList: this.statusRange },
],
columnsList,
dialogConfig,
addDialogTitle: '新建仓库', //
editDialogTitle: '修改仓库', //
storageDex: 1000,
priceDex: 100,
statusRange: undefined
}
},
}

View File

@ -36,8 +36,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.13:18080`, // 代理的后台ip 端口 解决请求跨域
target: `http://192.168.0.234:18080`, // 阮
// target: `http://192.168.2.21:18080`, // 马
// target: `http://192.168.0.234:18080`, // 阮
target: `http://192.168.2.21:18080`, // 马
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''