新购绑定列表
This commit is contained in:
parent
4b65169ad2
commit
ddd0bc26f5
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* 新购到货管理页面 API
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
/** 新购到货查询 */
|
||||
export const queryPurchaseBindListApi = (data) => {
|
||||
return request.get('/task/purchase/bind/list', {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
/** 新购到货查询 */
|
||||
export const queryPurchaseBindDetailsApi = (data) => {
|
||||
return request.get('/task/purchase/bind/detailsList', {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -197,11 +197,6 @@ export default {
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/** 传递参数 */
|
||||
sendParams: {
|
||||
type: Object,
|
||||
default: () => null
|
||||
},
|
||||
/** 是否显示查询按钮 */
|
||||
showSearchBtn: {
|
||||
type: Boolean,
|
||||
|
|
@ -272,7 +267,6 @@ export default {
|
|||
},
|
||||
|
||||
created() {
|
||||
console.log(this.sendParams)
|
||||
this.columCheckList = this.columnsList.map(e => {
|
||||
this.$set(e, 'checked', true)
|
||||
return e
|
||||
|
|
@ -281,23 +275,15 @@ 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,
|
||||
message: `请填写${e.f_label}`,
|
||||
trigger: 'blur'
|
||||
}
|
||||
])
|
||||
}
|
||||
this.$set(this.formRules, e.f_rule, [
|
||||
{
|
||||
required: true,
|
||||
message: `请填写${e.f_label}`,
|
||||
trigger: 'blur'
|
||||
}
|
||||
])
|
||||
})
|
||||
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])
|
||||
} */
|
||||
}
|
||||
// Object.assign(this.queryParams, this.sendParams)
|
||||
this.getTableList()
|
||||
},
|
||||
updated() {
|
||||
|
|
@ -307,10 +293,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, '列表数据')
|
||||
|
|
@ -325,21 +311,6 @@ 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() {
|
||||
|
|
@ -365,6 +336,7 @@ export default {
|
|||
func,
|
||||
prop
|
||||
) {
|
||||
console.log(prop)
|
||||
this.queryParams[val] = e[e.length - 1]
|
||||
let setObj = {}
|
||||
// 合并
|
||||
|
|
@ -372,12 +344,13 @@ 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)
|
||||
|
|
@ -387,6 +360,7 @@ export default {
|
|||
}
|
||||
this.tableList.unshift(setObj)
|
||||
console.log(this.tableList)
|
||||
|
||||
},
|
||||
/** 动态设置操作列的列宽 */
|
||||
getOperatorWidth() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
export const commonMixin = {
|
||||
data() {
|
||||
return {
|
||||
// 修改时的数据源
|
||||
editParams: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 新建 */
|
||||
handleAddData() {
|
||||
this.editParams = null
|
||||
this.dialogConfig.outerTitle = this.addDialogTitle
|
||||
this.dialogConfig.outerVisible = true
|
||||
},
|
||||
/** 删除 */
|
||||
handleDeleteData(id, method) {
|
||||
this.$modal.confirm('是否确定删除').then(() => {
|
||||
console.log('确定删除--', id)
|
||||
method(id).then(res => {
|
||||
console.log(res)
|
||||
if(res.code === 200) {
|
||||
// this.$message.msgSuccess('操作成功!')
|
||||
this.$refs.tableRef.getTableList()
|
||||
}
|
||||
}).catch(err => {})
|
||||
})
|
||||
},
|
||||
/** 编辑 */
|
||||
handleEditData(data) {
|
||||
this.editParams = data
|
||||
this.dialogConfig.outerTitle = this.editDialogTitle
|
||||
this.dialogConfig.outerVisible = true
|
||||
},
|
||||
/** 导入数据 */
|
||||
handleImportData() {
|
||||
console.log('导入--')
|
||||
},
|
||||
/** 导出数据 */
|
||||
handleExportData(data, url, fileName, queryParams) {
|
||||
this.download(
|
||||
url,
|
||||
{
|
||||
...queryParams,
|
||||
dataCondition: data
|
||||
},
|
||||
`${fileName}_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
/** 关闭外侧弹框 */
|
||||
closeDialogOuter() {
|
||||
this.dialogConfig.outerVisible = false
|
||||
},
|
||||
/** 关闭内侧弹框 */
|
||||
closeDialogInner() {
|
||||
this.dialogConfig.innerVisible = false
|
||||
},
|
||||
|
||||
/** 关闭弹框 由表单组件通知父组件关闭弹框的自定义事件 */
|
||||
closeDialog(type) {
|
||||
this.dialogConfig.outerVisible = false
|
||||
if(type) {
|
||||
this.$refs.tableRef.getTableList()
|
||||
}
|
||||
},
|
||||
/** 手机号脱密处理 */
|
||||
phoneCrypto(phoneNumber) {
|
||||
let reg = /^(1[3-9][0-9])\d{4}(\d{4}$)/
|
||||
let isMobile = reg.test(phoneNumber)
|
||||
if (isMobile) {
|
||||
return phoneNumber.replace(reg, "$1****$2")
|
||||
}
|
||||
return phoneNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<!-- 新购绑定页面 -->
|
||||
<div class="app-container">
|
||||
<PageHeader
|
||||
v-if="isShowComponent !== 'Index'"
|
||||
:pageContent="pageContent"
|
||||
@goBack="goBack"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<TableModel
|
||||
:formLabel="formLabel"
|
||||
:columnsList="columnsList"
|
||||
:request-api="queryPurchaseBindDetailsApi"
|
||||
:tableQueryParams="sendParams"
|
||||
ref="tableRef"
|
||||
v-if="isShowComponent === 'Index'"
|
||||
>
|
||||
|
||||
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
|
||||
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="toggleBinding(data)"
|
||||
>绑定</el-button
|
||||
>
|
||||
</template>
|
||||
|
||||
</TableModel>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageHeader from '@/components/pageHeader'
|
||||
import { columnsList, dialogConfig, formLabel } from '../list-bind-config'
|
||||
import { commonMixin } from '../../mixins/common'
|
||||
|
||||
import {
|
||||
queryPurchaseBindDetailsApi
|
||||
} from '@/api/purchase/binding'
|
||||
|
||||
export default {
|
||||
name: 'arrivalBindingManage',
|
||||
mixins: [commonMixin], // 混入公共方法和数据
|
||||
components: { PageHeader },
|
||||
props:{
|
||||
sendParams: {
|
||||
type: Object,
|
||||
default: () => null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.sendParams,'this.sendParams')
|
||||
},
|
||||
methods: {
|
||||
queryPurchaseBindDetailsApi,
|
||||
goBack() {
|
||||
this.isShowComponent = 'Index'
|
||||
},
|
||||
toggleBinding(data) {
|
||||
this.sendData = data
|
||||
console.log(data)
|
||||
this.isShowComponent = 'list-binding'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLabel,
|
||||
columnsList,
|
||||
dialogConfig,
|
||||
isShowComponent: 'Index',
|
||||
pageContent: '新购绑定物资列表',
|
||||
sendData: undefined
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
@ -6,17 +6,16 @@ export const formLabel = [
|
|||
{ f_label: '状态', f_model: 'keyWord', 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_props: 'purchasePrice', t_label: '采购价格(含税)', },
|
||||
{ t_props: 'notaxPrice', t_label: '采购价格(不含税)' },
|
||||
{ t_props: 'createBy', t_label: '操作人' },
|
||||
{ t_props: 'createTime', t_label: '操作时间' },
|
||||
{ t_props: 'statusName', t_label: '状态' },
|
||||
{ t_props: 'remark', t_label: '备注' },
|
||||
|
||||
]
|
||||
export const dialogConfig = {
|
||||
|
|
|
|||
|
|
@ -1,86 +1,85 @@
|
|||
<template>
|
||||
<!-- 往来单位管理页面 -->
|
||||
<!-- 新购绑定页面 -->
|
||||
<div class="app-container">
|
||||
<PageHeader
|
||||
v-if="isShowComponent !== 'Index'"
|
||||
:pageContent="pageContent"
|
||||
@goBack="goBack"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<TableModel
|
||||
:formLabel="formLabel"
|
||||
:columnsList="columnsList"
|
||||
:request-api="queryStorageConfigListApi"
|
||||
:request-api="queryPurchaseBindListApi"
|
||||
ref="tableRef"
|
||||
v-if="isShowComponent === 'Index'"
|
||||
>
|
||||
<template slot="btn" slot-scope="{ queryParams }">
|
||||
<el-button @click="handleExportData(queryParams, 'base/customer/export', '往来单位清单')"
|
||||
<el-button @click="handleExportData(queryParams, 'base/customer/export', '新购绑定清单')"
|
||||
>导出</el-button
|
||||
>
|
||||
</template>
|
||||
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<!-- <el-button
|
||||
type="warning"
|
||||
size="mini"
|
||||
>解绑</el-button
|
||||
>-->
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="handleEditData(data)"
|
||||
>编辑</el-button
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="handleDeleteData(data.id, delStorageConfigListApi)"
|
||||
>删除</el-button
|
||||
@click="toggleBinding(data)"
|
||||
>绑定</el-button
|
||||
>
|
||||
</template>
|
||||
<!-- <template slot="isActive" slot-scope="{ data }">
|
||||
{{ data.isActive == '1' ? '启用' : '不启用' }}
|
||||
</template>
|
||||
<template slot="phone" slot-scope="{ data }">
|
||||
{{ phoneCrypto(data.phone) }}
|
||||
</template>-->
|
||||
|
||||
</TableModel>
|
||||
|
||||
<!-- 新增以及修改时的弹框 -->
|
||||
<DialogModel
|
||||
:dialogConfig="dialogConfig"
|
||||
@closeDialogOuter="closeDialogOuter"
|
||||
<list-binding
|
||||
v-if="isShowComponent === 'list-binding'"
|
||||
:sendParams='sendParams'
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<!-- 新增以及修改数据的表单组件 -->
|
||||
<FormBinding
|
||||
@closeDialog="closeDialog"
|
||||
:editParams="editParams"
|
||||
/>
|
||||
</template>
|
||||
</DialogModel>
|
||||
|
||||
</list-binding>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageHeader from '@/components/pageHeader'
|
||||
import { columnsList, dialogConfig, formLabel } from './config'
|
||||
import { commonMixin } from '../mixins/common'
|
||||
import FormBinding from './components/form-binding.vue'
|
||||
import ListBinding from './components/list-binding.vue'
|
||||
import {
|
||||
queryStorageConfigListApi,
|
||||
delStorageConfigListApi
|
||||
} from '@/api/material/storageConfig'
|
||||
queryPurchaseBindListApi
|
||||
} from '@/api/purchase/binding'
|
||||
|
||||
export default {
|
||||
name: 'arrivalBindingManage',
|
||||
mixins: [commonMixin], // 混入公共方法和数据
|
||||
components: { FormBinding },
|
||||
components: { ListBinding, PageHeader },
|
||||
methods: {
|
||||
queryStorageConfigListApi,
|
||||
delStorageConfigListApi
|
||||
queryPurchaseBindListApi,
|
||||
goBack() {
|
||||
this.isShowComponent = 'Index'
|
||||
},
|
||||
toggleBinding(data) {
|
||||
this.sendParams = {taskId:data.id}
|
||||
console.log(data)
|
||||
this.isShowComponent = 'list-binding'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLabel,
|
||||
columnsList,
|
||||
dialogConfig,
|
||||
addDialogTitle: '新建仓库', // 新建时弹框标题
|
||||
editDialogTitle: '修改仓库', // 修改时弹框标题
|
||||
isShowComponent: 'Index',
|
||||
pageContent: '新购绑定任务列表',
|
||||
sendParams: {}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
export const formLabel = [
|
||||
{ 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: 'purchaseNum', t_label: '计量单位' },
|
||||
{ t_props: 'purchasePrice', t_label: '供应商', },
|
||||
{ t_props: 'notaxPrice', t_label: '出厂日期' },
|
||||
{ t_props: 'createBy', t_label: '附件' },
|
||||
{ t_props: 'status', t_label: '状态' },
|
||||
|
||||
]
|
||||
export const dialogConfig = {
|
||||
outerWidth: '80%',
|
||||
outerTitle: '',
|
||||
outerVisible: false,
|
||||
}
|
||||
Loading…
Reference in New Issue