新购管理

This commit is contained in:
jjLv 2024-10-25 17:29:52 +08:00
parent e6ef257459
commit 9f84d8dace
5 changed files with 61 additions and 34 deletions

View File

@ -10,10 +10,11 @@ export function getListNewBuy(query) {
} }
//任务 详情 //任务 详情
export function getPurchaseCheckInfo(id) { export function getPurchaseCheckInfo(query) {
return request({ return request({
url: '/material/purchase_check_info/'+ id, url: '/material//purchase_check_info/getInfo',
method: 'get', method: 'get',
params: query,
}) })
} }

View File

@ -13,7 +13,7 @@
<el-date-picker <el-date-picker
v-model="maForm.arrivalTime" v-model="maForm.arrivalTime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss"
:picker-options="pickerOptions" :picker-options="pickerOptions"
type="date" type="date"
placeholder="请选择到货日期" placeholder="请选择到货日期"
@ -24,7 +24,7 @@
<el-date-picker <el-date-picker
v-model="maForm.productionTime" v-model="maForm.productionTime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss"
:picker-options="pickerOptions" :picker-options="pickerOptions"
type="date" type="date"
placeholder="请选择出厂日期" placeholder="请选择出厂日期"
@ -39,7 +39,9 @@
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@input="taxRateChange"
/> />
<span>%</span>
</el-form-item> </el-form-item>
<el-form-item label="类型规格" prop="deviceType"> <el-form-item label="类型规格" prop="deviceType">
@ -114,7 +116,7 @@
prop="purchasePrice" prop="purchasePrice"
align="center" align="center"
> >
<template slot-scope="scope"> <template v-slot="scope">
<el-input-number <el-input-number
v-model="scope.row.purchasePrice" v-model="scope.row.purchasePrice"
controls-position="right" controls-position="right"
@ -125,15 +127,16 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="购置单价(元不含税)" label="购置单价(元不含税)"
prop="purchasePrice" prop="purchaseNoPrice"
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
v-model="scope.row.purchasePrice" v-model="scope.row.purchaseNoPrice"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
:min="0" :min="0"
@input="purchaseNoPriceChange(scope.row,scope.$index)"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
@ -165,7 +168,7 @@
<el-date-picker <el-date-picker
v-model="scope.row.productionTime" v-model="scope.row.productionTime"
style="width: 100%" style="width: 100%"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss"
type="date" type="date"
range-separator="-" range-separator="-"
placeholder="出厂日期" placeholder="出厂日期"
@ -292,6 +295,12 @@ export default {
return '' return ''
}, },
}, },
editId: {
type: [String, Number],
default: () => {
return ''
},
},
}, },
data() { data() {
return { return {
@ -337,6 +346,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
id:undefined, id:undefined,
taskId:undefined,
typesList:[], typesList:[],
}, },
// //
@ -373,6 +383,7 @@ export default {
supplierId: '', supplierId: '',
}, },
maForm: { maForm: {
taxRate:0,
purchaseTime: '', purchaseTime: '',
arrivalTime: '', arrivalTime: '',
purchaser: '', purchaser: '',
@ -414,6 +425,7 @@ export default {
}, },
deviceType: [], deviceType: [],
propsKey: 1000, propsKey: 1000,
taxRate:0,
} }
}, },
computed: { computed: {
@ -435,18 +447,11 @@ export default {
}, },
}, },
mounted() { mounted() {
// const taskId = this.$route.query && this.$route.query.taskId
// this.taskId = taskId
// if (this.taskId == '' || !this.taskId) {
// this.isEdit = false
// } else if (this.taskId != '') {
// this.isEdit = true
// this.getTaskInfo()
// }
if (this.isEdit) { if (this.isEdit) {
console.log('isEdit',this.isEdit) console.log('isEdit',this.isEdit)
this.id = this.editTaskId this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo() this.getTaskInfo()
} }
@ -456,7 +461,15 @@ export default {
// this.supplierInfoList() // this.supplierInfoList()
}, },
methods: { methods: {
taxRateChange(val){
this.equipmentList.forEach(item=>{
item.purchasePrice = item.purchaseNoPrice*(1 + val/100)
})
},
purchaseNoPriceChange(row,val){
this.equipmentList[val].purchasePrice = row.purchaseNoPrice*(1 + this.maForm.taxRate/100)
row.purchasePrice = row.purchaseNoPrice*(1 + this.maForm.taxRate/100)
},
getParentsById(list, id) { getParentsById(list, id) {
for (let i in list) { for (let i in list) {
@ -506,7 +519,7 @@ export default {
item4.specificationType = item4.specificationType =
item4.typeName item4.typeName
this.$set(item4, 'purchasePrice', 0) this.$set(item4, 'purchasePrice', 0)
this.$set(item4, 'purchaseNum', 1) this.$set(item4, 'purchaseNoPrice', 0)
}) })
} }
}) })
@ -567,13 +580,14 @@ export default {
//--- //---
getTaskInfo() { getTaskInfo() {
// this.loading = true; // this.loading = true;
getPurchaseCheckInfo(this.id).then((response) => { getPurchaseCheckInfo({taskId:this.taskId,id:this.id}).then((response) => {
// this.taskInfo = response.data // this.taskInfo = response.data
this.maForm.purchaseTime = response.data.purchaseTime this.maForm.purchaseTime = response.data.purchaseTime
this.maForm.arrivalTime = response.data.arrivalTime this.maForm.arrivalTime = response.data.purchaseCheckInfo.arrivalTime
this.maForm.purchaser = response.data.purchaser // this.maForm.purchaser = response.data.purchaser
this.maForm.remark = response.data.remark this.maForm.remark = response.data.purchaseCheckInfo.remark
this.maForm.purchaseNumber = response.data.purchaseNumber // this.maForm.purchaseNumber = response.data.purchaseNumber
this.maForm.productionTime = response.data.purchaseCheckInfo.productionTime
this.equipmentList = response.data.purchaseCheckDetailsList this.equipmentList = response.data.purchaseCheckDetailsList
// this.loading = false; // this.loading = false;
@ -706,7 +720,7 @@ export default {
console.log('新增') console.log('新增')
this.loading = true this.loading = true
addPurchaseCheckInfo( addPurchaseCheckInfo(
// {purchaseCheckDetailsList: this.maForm.checkDetailsList,purchaseCheckInfo:} {purchaseCheckDetailsList: this.maForm.checkDetailsList,purchaseCheckInfo:this.maForm}
).then((response) => { ).then((response) => {
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess( this.$modal.msgSuccess(

View File

@ -668,11 +668,11 @@ export default {
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.$emit('queryTools', row.taskId) this.$emit('queryTools', row.taskId,row.id)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$emit('editTools', row.taskId) this.$emit('editTools', row.taskId, row.id)
}, },
//---- //----

View File

@ -541,6 +541,12 @@ export default {
return '' return ''
}, },
}, },
queryId: {
type: [String, Number],
default: () => {
return ''
},
},
}, },
data() { data() {
return { return {
@ -599,6 +605,7 @@ export default {
uploadUrl: process.env.VUE_APP_BASE_API + '/system', // uploadUrl: process.env.VUE_APP_BASE_API + '/system', //
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
taskId:undefined,
//-------------- //--------------
// //
form: {}, form: {},
@ -703,8 +710,8 @@ export default {
// } else { // } else {
// this.isView = false // this.isView = false
// } // }
this.id = this.queryTaskId this.taskId = this.queryTaskId
this.id = this.queryId
this.getTaskInfo() this.getTaskInfo()
// this.getAllUserList() // this.getAllUserList()
// this.getNoticeUserList() // this.getNoticeUserList()
@ -713,7 +720,7 @@ export default {
//- //-
getTaskInfo() { getTaskInfo() {
this.loading = true this.loading = true
getPurchaseCheckInfo(this.id).then((response) => { getPurchaseCheckInfo({taskId:this.taskId,id:this.id}).then((response) => {
this.taskInfo = response.data this.taskInfo = response.data
this.equipmentList = response.data.purchaseCheckDetailsList this.equipmentList = response.data.purchaseCheckDetailsList
// this.equipmentList.forEach((item) => { // this.equipmentList.forEach((item) => {

View File

@ -10,7 +10,9 @@
:is="isShowComponent" :is="isShowComponent"
:isEdit="isEdit" :isEdit="isEdit"
:editTaskId="editTaskId" :editTaskId="editTaskId"
:editId="editId"
:queryTaskId="queryTaskId" :queryTaskId="queryTaskId"
:queryId="queryId"
:isView="isView" :isView="isView"
:codingTaskId="codingTaskId" :codingTaskId="codingTaskId"
@addTools="addTools" @addTools="addTools"
@ -39,6 +41,7 @@ export default {
pageContent: "新增机具", pageContent: "新增机具",
isEdit: false, isEdit: false,
editTaskId: "", editTaskId: "",
editId: "",
queryTaskId: "", queryTaskId: "",
isView: false, isView: false,
codingTaskId: "", codingTaskId: "",
@ -59,17 +62,19 @@ export default {
this.isShowComponent = 'Home' this.isShowComponent = 'Home'
}, },
/* 编辑工机具 */ /* 编辑工机具 */
editTools(id) { editTools(taskId,id) {
this.isEdit = true this.isEdit = true
this.pageContent = '编辑机具' this.pageContent = '编辑机具'
this.editTaskId = id this.editTaskId = taskId
this.editId = id
this.isShowComponent = 'AddTools' this.isShowComponent = 'AddTools'
}, },
/* 查询工机具 */ /* 查询工机具 */
queryTools(id) { queryTools(taskId,id) {
this.isView = true this.isView = true
this.pageContent = '详情信息' this.pageContent = '详情信息'
this.queryTaskId = id this.queryTaskId = taskId
this.queryId = id
this.isShowComponent = 'QueryTools' this.isShowComponent = 'QueryTools'
}, },
/* 返回按钮 */ /* 返回按钮 */