新购各模块相关问题自测修改

This commit is contained in:
FrancisHu 2024-08-28 17:54:27 +08:00
parent fae739066f
commit e71d449f50
17 changed files with 187 additions and 91 deletions

View File

@ -45,6 +45,7 @@
:options="item.f_selList" :options="item.f_selList"
:props="item.optionProps" :props="item.optionProps"
:show-all-levels="false" :show-all-levels="false"
clearable
@change="handleCasAdd($event, item.f_model, cascaderFunc, extraTableProp)" @change="handleCasAdd($event, item.f_model, cascaderFunc, extraTableProp)"
style="width: 240px" style="width: 240px"
/> />
@ -64,6 +65,16 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" type="date"
/> />
<el-date-picker
v-if="item.f_type === 'dateRange'"
v-model="queryParams[item.f_model]"
style="width: 240px"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<el-input-number <el-input-number
v-if="item.f_type === 'num'" v-if="item.f_type === 'num'"
v-model="queryParams[item.f_model]" v-model="queryParams[item.f_model]"
@ -331,6 +342,12 @@ export default {
methods: { methods: {
/** 获取列表数据 */ /** 获取列表数据 */
async getTableList() { async getTableList() {
if(this.queryParams.time && this.queryParams.time.length !== 0) {
this.queryParams.startTime = this.queryParams.time[0]
this.queryParams.endTime = this.queryParams.time[1]
delete this.queryParams.time
}
console.log(this.queryParams)
if(Object.keys(this.formRules).length !== 0) { if(Object.keys(this.formRules).length !== 0) {
this.$refs.queryFormRef.validate(async valid => { this.$refs.queryFormRef.validate(async valid => {
if (valid) { if (valid) {
@ -393,28 +410,30 @@ export default {
func, func,
prop prop
) { ) {
this.queryParams[val] = e[e.length - 1] if(e.length !== 0) {
let setObj = {} this.queryParams[val] = e[e.length - 1]
// let setObj = {}
if(prop) { //
Object.assign(setObj, prop) if(prop) {
Object.assign(setObj, prop)
}
// id
this.$set(setObj, 'id', this.idCount)
this.idCount++
//
func({
id: e[e.length - 1]
}).then(res => {
this.$set(setObj, 'name', res.data.parentName)
this.$set(setObj, 'unitName', res.data.unitName)
this.$set(setObj, 'typeName', res.data.name)
}).catch(err => {})
for(let key in this.queryParams) {
this.$set(setObj, key, this.queryParams[key])
}
this.tableList.unshift(setObj)
console.log(this.tableList)
} }
// id
/* this.$set(setObj, 'id', this.idCount)
this.idCount++ */
//
func({
id: e[e.length - 1]
}).then(res => {
this.$set(setObj, 'name', res.data.parentName)
this.$set(setObj, 'unitName', res.data.unitName)
this.$set(setObj, 'typeName', res.data.name)
}).catch(err => {})
for(let key in this.queryParams) {
this.$set(setObj, key, this.queryParams[key])
}
this.tableList.unshift(setObj)
console.log(this.tableList)
}, },
/** 动态设置操作列的列宽 */ /** 动态设置操作列的列宽 */
getOperatorWidth() { getOperatorWidth() {

View File

@ -182,7 +182,7 @@ export function download(url, params, filename, config) {
transformRequest: [(params) => { transformRequest: [(params) => {
return tansParams(params) return tansParams(params)
}], }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded', encryptResponse: false}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', encryptResponse: false },
responseType: 'blob', responseType: 'blob',
...config ...config
}).then(async(data) => { }).then(async(data) => {

View File

@ -1,6 +1,6 @@
export const formLabel = [ export const formLabel = [
{ f_label: '工程名称', f_model: 'name', f_type: 'ipt' }, { f_label: '工程名称', f_model: 'keyWord', f_type: 'ipt' },
] ]
export const columnsList = [ export const columnsList = [
{ t_props: 'name', t_label: '工程项目名称', }, { t_props: 'name', t_label: '工程项目名称', },

View File

@ -13,8 +13,14 @@
<el-button type="primary" @click="handleAddData()" <el-button type="primary" @click="handleAddData()"
>新建</el-button >新建</el-button
> >
<el-button @click="handleExportData(exportList, 'base/project/export', '工程清单', queryParams)" <el-button
>导出</el-button @click="handleExportData(
exportList,
'base/project/export',
'工程清单',
queryParams
)"
>导出</el-button
> >
</template> </template>
<template slot="handle" slot-scope="{ data }"> <template slot="handle" slot-scope="{ data }">

View File

@ -13,7 +13,7 @@
@transIdList="getIdList" @transIdList="getIdList"
> >
<template slot="btn" slot-scope="{ queryParams }"> <template slot="btn" slot-scope="{ queryParams }">
<el-button type="primary" @click="save" <el-button type="primary" @click="save(queryParams)"
>保存</el-button> >保存</el-button>
<!-- <el-button @click="handleExportData(queryParams, 'base/agreement/export', '物资清单')" <!-- <el-button @click="handleExportData(queryParams, 'base/agreement/export', '物资清单')"
>导出</el-button>--> >导出</el-button>-->
@ -115,6 +115,9 @@ import {
queryPurchaseArrivalListApi, queryPurchaseArrivalListApi,
addArrivalApi addArrivalApi
} from '@/api/purchase/arrival' } from '@/api/purchase/arrival'
import {
queryPurchaseArrivalListInnerApi
} from '@/api/purchase/arrival'
import ReportManage from '../components/report-manage.vue' import ReportManage from '../components/report-manage.vue'
export default { export default {
name: 'AddArrival', name: 'AddArrival',
@ -128,10 +131,30 @@ export default {
sendCascader: { sendCascader: {
type: Array, type: Array,
default: () => null default: () => null
},
sendParams: {
type: Object,
default: () => null
} }
}, },
created() { created() {
// console.log(this.sendRange) console.log(this.sendParams)
if(this.sendParams) {
queryPurchaseArrivalListInnerApi({
taskId: this.sendParams.id
}).then(res => {
console.log(res)
res.rows.forEach(item => {
//
item.notaxPrice = item.notaxPrice / 100
item.purchasePrice = item.purchasePrice / 100
item.purchaseNum = item.purchaseNum / 1000
item.name = item.materialName
item.typeName = item.materialModel
this.$refs.tableRef.tableList.push(item)
})
})
}
}, },
mounted() { mounted() {
@ -155,9 +178,7 @@ export default {
extraProp: { extraProp: {
purchasePrice: '', purchasePrice: '',
notaxPrice: '' notaxPrice: ''
}, }
storageDex: 1000,
priceDex: 100
} }
}, },
methods: { methods: {
@ -166,35 +187,37 @@ export default {
getIdList(idList) { getIdList(idList) {
this.exportList = idList this.exportList = idList
}, },
// /** 删除机具 */
delMa(data) { delMa(data) {
this.$modal this.$modal
.confirm('是否确认删除所选择的数据项?') .confirm('是否确认删除所选择的数据项?')
.then(() => { .then(() => {
this.$refs.tableRef.tableList.forEach((item, index) => { this.$refs.tableRef.tableList.forEach((item, index) => {
if(item.type === data.type) { if(item.id === data.id) {
this.$refs.tableRef.tableList.splice(index, 1) this.$refs.tableRef.tableList.splice(index, 1)
} }
}) })
}) })
.catch(() => {}) .catch(() => {})
}, },
save() { /** 保存机具 */
save(params) {
console.log(params, '表单参数')
if(this.exportList.length === 0) { if(this.exportList.length === 0) {
this.$modal.msgError('请选择需要保存的机具') this.$modal.msgError('请选择需要保存的机具')
} else { } else {
this.exportList.forEach(item => { this.exportList.forEach(item => {
item.purchaseNum = item.purchaseNum * this.storageDex item.purchaseNum = item.purchaseNum * 1000
item.purchasePrice = item.purchasePrice * this.priceDex item.purchasePrice = item.purchasePrice * 100
item.notaxPrice = item.notaxPrice * this.priceDex item.notaxPrice = item.notaxPrice * 100
}) })
let subObj = { let subObj = {
arrivalTime: this.exportList[0].arrivalTime, arrivalTime: params.arrivalTime,
// supplierId: this.exportList[0].supplierId, // supplierId: this.exportList[0].supplierId,
productDate: this.exportList[0].productDate, productDate: params.productDate,
// taxRate: this.exportList[0].taxRate, // taxRate: this.exportList[0].taxRate,
// typeId: this.exportList[0].typeId, // typeId: this.exportList[0].typeId,
remark: this.exportList[0].remark, remark: params.remark,
bpmPurchaseDetailsList: this.exportList bpmPurchaseDetailsList: this.exportList
} }
// //
@ -202,9 +225,9 @@ export default {
console.log(res) console.log(res)
this.$modal.msgSuccess('保存成功') this.$modal.msgSuccess('保存成功')
this.$refs.tableRef.tableList.forEach(item => { this.$refs.tableRef.tableList.forEach(item => {
item.purchaseNum = item.purchaseNum / this.storageDex item.purchaseNum = item.purchaseNum / 1000
item.purchasePrice = item.purchasePrice / this.priceDex item.purchasePrice = item.purchasePrice / 100
item.notaxPrice = item.notaxPrice / this.priceDex item.notaxPrice = item.notaxPrice / 100
}) })
// this.$refs.tableRef.getTableList() // this.$refs.tableRef.getTableList()
}).catch(err => {}) }).catch(err => {})

View File

@ -12,7 +12,11 @@
> >
</TableModel> </TableModel>
<div style="margin-top: 50px; display: flex; justify-content: right"> <div style="margin-top: 50px; display: flex; justify-content: right">
<el-button type="primary" size="mini">添加</el-button> <el-button
type="primary"
size="mini"
@click="addNoticePerson"
>添加</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -42,7 +46,8 @@ export default {
{ t_props: 'deptName', t_label: '所属机构' }, { t_props: 'deptName', t_label: '所属机构' },
{ t_props: 'userRole', t_label: '角色', }, { t_props: 'userRole', t_label: '角色', },
{ t_props: 'phone', t_label: '联系电话', t_width: '150px' }, { t_props: 'phone', t_label: '联系电话', t_width: '150px' },
] ],
userList: []
} }
}, },
computed: { computed: {
@ -51,7 +56,15 @@ export default {
methods: { methods: {
queryAllPersonList, queryAllPersonList,
getIdList(idList) { getIdList(idList) {
console.log(idList) this.userList = idList
},
addNoticePerson() {
let sendUserList = []
this.userList.forEach(item => {
sendUserList.push(item.userId)
})
//
} }
}, },
} }

View File

@ -82,7 +82,7 @@ export default {
components: { TableNoticeAdd }, components: { TableNoticeAdd },
created() { created() {
console.log(this.editParams) console.log(this.editParams)
this.transObj = { ['taskId']: this.editParams['id'] } this.transObj = { taskId: this.editParams.id }
this.noticeIpt = `各位同事您好请于2023-11-22在2号库进行机具验收。验收内容如下机具类型${this.editParams.purchaseMaterial} this.noticeIpt = `各位同事您好请于2023-11-22在2号库进行机具验收。验收内容如下机具类型${this.editParams.purchaseMaterial}
` `
}, },

View File

@ -8,7 +8,7 @@ export const formLabelAdd = [
{ f_label: '出厂日期', f_model: 'productDate', f_type: 'date' }, { f_label: '出厂日期', f_model: 'productDate', f_type: 'date' },
{ f_label: '税率', f_model: 'taxRate', f_type: 'num' }, { f_label: '税率', f_model: 'taxRate', f_type: 'num' },
{ f_label: '类型规格', f_model: 'keyWord', f_type: 'ipt' }, { f_label: '类型规格', f_model: 'keyWord', f_type: 'ipt' },
{ f_label: '备注', f_model: 'keyWord', f_type: 'ipt' }, { f_label: '备注', f_model: 'remark', f_type: 'ipt' },
] ]
export const columnsListAdd = [ export const columnsListAdd = [
{ t_props: 'name', t_label: '物资名称', }, { t_props: 'name', t_label: '物资名称', },

View File

@ -4,7 +4,8 @@ import {
export const queryStatusSelData = () => { export const queryStatusSelData = () => {
queryStatusSelApi().then(res => { queryStatusSelApi().then(res => {
formLabel[3].f_selList = res.data.data.map(item => { console.log(res.data.data)
formLabel[2].f_selList = res.data.data.map(item => {
return { return {
label: item.dictLabel, label: item.dictLabel,
value: item.dictCode value: item.dictCode
@ -14,8 +15,7 @@ export const queryStatusSelData = () => {
} }
export const formLabel = [ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '日期范围', f_model: 'time', f_type: 'dateRange' },
{ 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: 'sel', f_selList: [] }, { f_label: '状态', f_model: 'status', f_type: 'sel', f_selList: [] },
] ]

View File

@ -15,7 +15,7 @@
v-if="isShowComponent === 'Index'" v-if="isShowComponent === 'Index'"
> >
<template slot="btn" slot-scope="{ queryParams }"> <template slot="btn" slot-scope="{ queryParams }">
<el-button type="primary" @click="isShowComponent = 'add-arrival'" <el-button type="primary" @click="addArrival"
>设备到货新增</el-button >设备到货新增</el-button
> >
<el-button @click="handleExportData(queryParams, 'base/masupplier/export', '物资厂家清单')" <el-button @click="handleExportData(queryParams, 'base/masupplier/export', '物资厂家清单')"
@ -41,7 +41,8 @@
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="handleEditData(data)" @click="handleEdit(data)"
v-if="data.status === 47"
>编辑</el-button >编辑</el-button
> >
<el-button <el-button
@ -104,6 +105,7 @@
v-if="isShowComponent === 'add-arrival'" v-if="isShowComponent === 'add-arrival'"
:send-range="factoryRange" :send-range="factoryRange"
:send-cascader="cascaderRange" :send-cascader="cascaderRange"
:send-params="editParams"
> >
</add-arrival> </add-arrival>
@ -197,16 +199,26 @@ export default {
}, },
// //
handleSubmit(id) { handleSubmit(id) {
let idList = [] this.$modal.confirm('是否确定提交').then(() => {
idList.push(id) let idList = []
submitArrivalApi(idList).then(res => { idList.push(id)
console.log(res) submitArrivalApi(idList).then(res => {
this.$modal.msgSuccess('提交成功') console.log(res)
this.$refs.tableRef.getTableList() this.$modal.msgSuccess('提交成功')
}).catch(err => {}) this.$refs.tableRef.getTableList()
}).catch(err => {})
})
}, },
goBack() { goBack() {
this.isShowComponent = 'Index' this.isShowComponent = 'Index'
},
addArrival() {
this.editParams = undefined
this.isShowComponent = 'add-arrival'
},
handleEdit(data) {
this.editParams = data
this.isShowComponent = 'add-arrival'
} }
}, },
data() { data() {
@ -224,6 +236,7 @@ export default {
storageDex: 1000, storageDex: 1000,
priceDex: 100, priceDex: 100,
detailParams: undefined, detailParams: undefined,
editParams: undefined,
// //
} }

View File

@ -1,9 +1,22 @@
import {
queryStatusSelApi
} from '@/api/purchase/receive'
export const queryStatusSelData = () => {
queryStatusSelApi().then(res => {
formLabel[2].f_selList = res.data.data.map(item => {
return {
label: item.dictLabel,
value: item.dictCode
}
})
})
}
export const formLabel = [ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '日期范围', f_model: 'time', f_type: 'dateRange' },
{ 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: 'sel', f_selList: [] },
] ]
export const columnsList = [ export const columnsList = [
{ t_props: 'arrivalTime', t_label: '到货时间', }, { t_props: 'arrivalTime', t_label: '到货时间', },
@ -14,7 +27,7 @@ export const columnsList = [
{ t_props: 'notaxPrice', t_label: '采购价格(不含税)', t_slot: 'notaxPrice' }, { t_props: 'notaxPrice', t_label: '采购价格(不含税)', t_slot: 'notaxPrice' },
{ t_props: 'createBy', t_label: '操作人' }, { t_props: 'createBy', t_label: '操作人' },
{ t_props: 'createTime', t_label: '操作时间' }, { t_props: 'createTime', t_label: '操作时间' },
{ t_props: 'statusName', t_label: '状态' }, { t_props: 'statusName', t_label: '状态', t_slot: 'statusName' },
{ t_props: 'remark', t_label: '备注' }, { t_props: 'remark', t_label: '备注' },
] ]

View File

@ -54,9 +54,16 @@
</template> </template>
<template slot="purchasePrice" slot-scope="{ data }"> <template slot="purchasePrice" slot-scope="{ data }">
{{ data.purchasePrice / 100 }} {{ data.purchasePrice / 100 }}
</template><template slot="notaxPrice" slot-scope="{ data }"> </template>
<template slot="notaxPrice" slot-scope="{ data }">
{{ data.notaxPrice / 100 }} {{ data.notaxPrice / 100 }}
</template> </template>
<template slot="statusName" slot-scope="{ data }">
<span style="color: #D9001B">
{{ data.statusName }}
</span>
</template>
</TableModel> </TableModel>
@ -71,7 +78,7 @@
<script> <script>
import PageHeader from '@/components/pageHeader' import PageHeader from '@/components/pageHeader'
import { columnsList, dialogConfig, formLabel } from './config' import { columnsList, dialogConfig, formLabel, queryStatusSelData } from './config'
import { commonMixin } from '../mixins/common' import { commonMixin } from '../mixins/common'
import ListBinding from './components/list-binding.vue' import ListBinding from './components/list-binding.vue'
import { import {
@ -83,6 +90,9 @@ export default {
name: 'arrivalBindingManage', name: 'arrivalBindingManage',
mixins: [commonMixin], // mixins: [commonMixin], //
components: { ListBinding, PageHeader }, components: { ListBinding, PageHeader },
created() {
queryStatusSelData()
},
methods: { methods: {
queryPurchaseBindListApi, queryPurchaseBindListApi,
goBack() { goBack() {

View File

@ -4,7 +4,7 @@ import {
export const queryStatusSelData = () => { export const queryStatusSelData = () => {
queryStatusSelApi().then(res => { queryStatusSelApi().then(res => {
formLabel[3].f_selList = res.data.data.map(item => { formLabel[2].f_selList = res.data.data.map(item => {
return { return {
label: item.dictLabel, label: item.dictLabel,
value: item.dictCode value: item.dictCode
@ -14,8 +14,7 @@ export const queryStatusSelData = () => {
} }
export const formLabel = [ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '日期范围', f_model: 'time', f_type: 'dateRange' },
{ 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: 'sel', f_selList: [] }, { f_label: '状态', f_model: 'status', f_type: 'sel', f_selList: [] },
] ]

View File

@ -173,28 +173,32 @@ export default {
}, },
// //
confirmArrival(id) { confirmArrival(id) {
let idList = [] this.$modal.confirm('是否确认到货').then(() => {
idList.push(id) let idList = []
// idList.push(id)
confirmArrivalApi(idList).then(res => { //
this.$modal.msgSuccess('提交成功') confirmArrivalApi(idList).then(res => {
this.$refs.tableRef.getTableList() this.$modal.msgSuccess('提交成功')
}).catch(err => {}) this.$refs.tableRef.getTableList()
}).catch(err => {})
})
}, },
// //
multiConfirm() { multiConfirm() {
if(this.multiConfirmList.length === 0) { if(this.multiConfirmList.length === 0) {
this.$modal.msgError('请选择需要批量确认的物资') this.$modal.msgError('请选择需要批量确认的物资')
} else { } else {
let idList = [] this.$modal.confirm('是否批量确认到货').then(() => {
this.multiConfirmList.forEach(item => { let idList = []
idList.push(item.id) this.multiConfirmList.forEach(item => {
idList.push(item.id)
})
//
confirmArrivalApi(idList).then(res => {
this.$modal.msgSuccess('提交成功')
this.$refs.tableRef.getTableList()
}).catch(err => {})
}) })
//
confirmArrivalApi(idList).then(res => {
this.$modal.msgSuccess('提交成功')
this.$refs.tableRef.getTableList()
}).catch(err => {})
} }
}, },
toggleDetail(data) { toggleDetail(data) {

View File

@ -27,9 +27,7 @@ export const commonMixin = {
/** 删除 */ /** 删除 */
handleDeleteData(id, method) { handleDeleteData(id, method) {
this.$modal.confirm('是否确定删除').then(() => { this.$modal.confirm('是否确定删除').then(() => {
console.log('确定删除--', id)
method(id).then(res => { method(id).then(res => {
console.log(res)
if(res.code === 200) { if(res.code === 200) {
this.$modal.msgSuccess('操作成功!') this.$modal.msgSuccess('操作成功!')
this.$refs.tableRef.getTableList() this.$refs.tableRef.getTableList()

View File

@ -4,7 +4,7 @@ import {
export const queryStatusSelData = () => { export const queryStatusSelData = () => {
queryStatusSelApi().then(res => { queryStatusSelApi().then(res => {
formLabel[3].f_selList = res.data.data.map(item => { formLabel[2].f_selList = res.data.data.map(item => {
return { return {
label: item.dictLabel, label: item.dictLabel,
value: item.dictCode value: item.dictCode
@ -14,8 +14,7 @@ export const queryStatusSelData = () => {
} }
export const formLabel = [ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '日期范围', f_model: 'time', f_type: 'dateRange' },
{ 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: 'sel', f_selList: [] }, { f_label: '状态', f_model: 'status', f_type: 'sel', f_selList: [] },
] ]

View File

@ -4,7 +4,7 @@ import {
export const queryStatusSelData = () => { export const queryStatusSelData = () => {
queryStatusSelApi().then(res => { queryStatusSelApi().then(res => {
formLabel[3].f_selList = res.data.data.map(item => { formLabel[2].f_selList = res.data.data.map(item => {
return { return {
label: item.dictLabel, label: item.dictLabel,
value: item.dictCode value: item.dictCode
@ -14,8 +14,7 @@ export const queryStatusSelData = () => {
} }
export const formLabel = [ export const formLabel = [
{ f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '日期范围', f_model: 'time', f_type: 'dateRange' },
{ 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: 'sel', f_selList: [] }, { f_label: '状态', f_model: 'status', f_type: 'sel', f_selList: [] },
] ]