mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 15:06:11 +08:00
beyond 4.1.1
This commit is contained in:
parent
58dff457a1
commit
8acc117c75
|
@ -225,6 +225,61 @@ export function search(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 供应商列表
|
||||
export function search2(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.isEffective !== '' && query.isEffective !== null && query.isEffective !== undefined) {
|
||||
params.append('isEffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.productName !== '' && query.productName !== null && query.productName !== undefined) {
|
||||
params.append('productName', query.productName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.id !== '' && query.id !== null && query.id !== undefined) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.settleMode !== '' && query.settleMode !== null && query.settleMode !== undefined) {
|
||||
params.append('settleMode', query.settleMode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.deliveryMode !== '' && query.deliveryMode !== null && query.deliveryMode !== undefined) {
|
||||
params.append('deliveryMode', query.deliveryMode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.supplierName !== '' && query.supplierName !== null && query.supplierName !== undefined) {
|
||||
params.append('supplierName', query.supplierName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.payMode !== '' && query.payMode !== null && query.payMode !== undefined) {
|
||||
params.append('payMode', query.payMode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.productCode !== '' && query.productCode !== null && query.productCode !== undefined) {
|
||||
params.append('productCode', query.productCode) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.typeId !== '' && query.typeId !== null && query.typeId !== undefined) {
|
||||
params.append('typeId', query.typeId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.groupId !== '' && query.groupId !== null && query.groupId !== undefined) {
|
||||
params.append('groupId', query.groupId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.regionId !== '' && query.regionId !== null && query.regionId !== undefined) {
|
||||
params.append('regionId', query.regionId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.levelId !== '' && query.levelId !== null && query.levelId !== undefined) {
|
||||
params.append('levelId', query.levelId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.pagenum !== '' && query.pagenum !== null && query.pagenum !== undefined) {
|
||||
params.append('pagenum', query.pagenum) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.pagesize !== '' && query.pagesize !== null && query.pagesize !== undefined) {
|
||||
params.append('pagesize', query.pagesize) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isRole !== '' && query.isRole !== null && query.isRole !== undefined) {
|
||||
params.append('isRole', query.isRole) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: '/supplier/search2',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改供应商
|
||||
export function update(query, query2) {
|
||||
var params = new URLSearchParams()
|
||||
|
|
|
@ -125,10 +125,21 @@
|
|||
</el-editable-column>
|
||||
<el-editable-column :label="$t('updates.sqyy')" prop="applyReason" align="center" min-width="150px"/>
|
||||
<el-editable-column :label="$t('updates.ydbh')" prop="sourceNumber" align="center" min-width="150px"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('updates.gys')" prop="supplierName" align="center" min-width="150px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
|
||||
<my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
|
||||
<!-- <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('updates.gys')" prop="supplierName" align="center" min-width="150px">-->
|
||||
<!-- <template slot="edit" slot-scope="scope">-->
|
||||
<!-- <el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>-->
|
||||
<!-- <my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-editable-column>-->
|
||||
<el-editable-column :edit-render="{type: 'default'}" :label="$t('updates.gys')" prop="supplierId" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.supplierId" :value="scope.row.supplierId" filterable style="width: 100%;" @visible-change="updatesupp($event,scope)" @change="changeDate2($event,scope)">
|
||||
<el-option
|
||||
v-for="item in suppliers"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
:label="item.supplierName"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :label="$t('updates.ydgsl')" prop="orderQuantity" align="center" min-width="150px"/>
|
||||
|
@ -247,6 +258,7 @@
|
|||
import '@/directive/noMoreClick/index.js'
|
||||
import { getStockInfoByProduct } from '@/api/Supplier'
|
||||
// import { materialslist2 } from '@/api/MaterialsList'
|
||||
import { search2 } from '@/api/Supplier'
|
||||
import { countlist } from '@/api/public'
|
||||
import { addstockplan } from '@/api/StockPlan'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
|
@ -310,6 +322,7 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
suppliers: [],
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
|
@ -393,9 +406,6 @@ export default {
|
|||
list3: [],
|
||||
// 采购计划单明细列表规则
|
||||
validRules: {
|
||||
// supplierName: [
|
||||
// { required: true, validator: validatePass5, trigger: 'focus' }
|
||||
// ],
|
||||
planQuantity: [
|
||||
{ required: true, message: '请输入计划数量', trigger: 'blur' }
|
||||
],
|
||||
|
@ -425,6 +435,34 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
async changeDate2(event, scope) {
|
||||
console.log('event', event)
|
||||
const param = {}
|
||||
param.id = scope.row.supplierId
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const a = this.suppliers.find(item => item.id = event)
|
||||
console.log('this.suppliers', this.suppliers)
|
||||
scope.row.supplierName = a.supplierName
|
||||
console.log('scope.row', scope.row)
|
||||
// scope.row.productCode
|
||||
this.changeDate()
|
||||
},
|
||||
updatesupp(event, scope) {
|
||||
if (event === true) {
|
||||
console.log(scope.row.productCode)
|
||||
const param = {}
|
||||
param.productCode = scope.row.productCode
|
||||
param.isEffective = 1
|
||||
param.pagenum = 1
|
||||
param.pagesize = 9999
|
||||
search2(param).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.suppliers = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
console.log('this.location', this.suppliers)
|
||||
}
|
||||
},
|
||||
checkStock(row) {
|
||||
console.log('this.moreaction.length', this.moreaction.length)
|
||||
if (this.moreaction.length > 1 || this.moreaction.length === 0) {
|
||||
|
@ -586,6 +624,7 @@ export default {
|
|||
},
|
||||
// 两表联动
|
||||
changeDate() {
|
||||
console.log('ooooo')
|
||||
this.$refs.editable2.clear()
|
||||
const nowlistdata = this.deepClone(this.$refs.editable.getRecords())
|
||||
const newArr = []
|
||||
|
@ -760,9 +799,9 @@ export default {
|
|||
},
|
||||
allinfo(val) {
|
||||
console.log(val)
|
||||
this.personalForm.planDate = val.applyDate
|
||||
this.personalForm.stockType = val.stockType
|
||||
this.personalForm.stockDeptId = val.applyDeptId
|
||||
// this.personalForm.planDate = val.applyDate
|
||||
// this.personalForm.stockType = val.stockType
|
||||
// this.personalForm.stockDeptId = val.applyDeptId
|
||||
},
|
||||
async apply(val) {
|
||||
console.log('val', val)
|
||||
|
@ -785,35 +824,19 @@ export default {
|
|||
// this.$refs.editable.insert(val[i])
|
||||
// }
|
||||
// }
|
||||
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
async apply2(val) {
|
||||
// for (let i = 0; i < val.length; i++) {
|
||||
// if (val[i].productCode.substring(0, 2) === '01') {
|
||||
// console.log('01')
|
||||
// const list = await materialslist2(val[i].productCode)
|
||||
// console.log('list', list.data.data.content.list[0].materialsListDetailVos)
|
||||
// const list2 = list.data.data.content.list[0].materialsListDetailVos
|
||||
// for (let j = 0; j < list2.length; j++) {
|
||||
// list2[j].basicPrice = 0
|
||||
// list2[j].planQuantity = 0
|
||||
// console.log(list2[j])
|
||||
// this.$refs.editable2.insert(list2[j])
|
||||
// }
|
||||
// } else {
|
||||
// this.$refs.editable2.insert(val[i])
|
||||
// }
|
||||
// }
|
||||
|
||||
this.getTypes()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.$refs.editable2.insert(val[i])
|
||||
}
|
||||
},
|
||||
// 采购需求数据
|
||||
requiredata(val) {
|
||||
this.getTypes()
|
||||
console.log(val)
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.$refs.editable.insert(val[i])
|
||||
|
@ -838,6 +861,14 @@ export default {
|
|||
this.getTypes()
|
||||
},
|
||||
getTypes() {
|
||||
const param = {}
|
||||
param.pagenum = 1
|
||||
param.pagesize = 9999
|
||||
search2(param).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.suppliers = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
// 采购类别数据
|
||||
searchStockCategory(this.typeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
|
@ -887,6 +918,7 @@ export default {
|
|||
handlesave() {
|
||||
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
|
||||
const EnterDetail2 = this.deepClone(this.$refs.editable2.getRecords())
|
||||
console.log('EnterDetail2', EnterDetail2)
|
||||
let mm = 1
|
||||
if (EnterDetail.length === 0) {
|
||||
this.$notify.error({
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@current-change="handleCurrentChange">>
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
|
@ -147,6 +147,7 @@
|
|||
|
||||
<script>
|
||||
import { stocapplylist } from '@/api/StockApply'
|
||||
import { getStockInfoByProduct } from '@/api/Supplier'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
|
@ -321,11 +322,11 @@ export default {
|
|||
this.$router.push('/StockApply/AddStockApply')
|
||||
},
|
||||
// 选择主生产计划数据时的操作
|
||||
handleCurrentChange(val) {
|
||||
handleSelectionChange(val) {
|
||||
this.choosedata = val
|
||||
},
|
||||
// 确认添加数据
|
||||
handleConfirm() {
|
||||
async handleConfirm() {
|
||||
this.employeeVisible = false
|
||||
// console.log('this.choosedata', this.choosedata)
|
||||
// const neednewarr = this.choosedata.map(item => {
|
||||
|
@ -333,11 +334,19 @@ export default {
|
|||
// })
|
||||
// const applydata = [].concat.apply([], neednewarr)
|
||||
// console.log('applydata', applydata)
|
||||
console.log(this.choosedata)
|
||||
const applydata = this.choosedata.stockApplyDetailVos
|
||||
console.log('123', this.choosedata)
|
||||
const applydata = this.choosedata
|
||||
const number = this.choosedata.applyNumber
|
||||
console.log('1111122222', applydata)
|
||||
const applyDetail = applydata.map(function(item) {
|
||||
const orderdata = []
|
||||
// const number = this.choosedata.orderNumber
|
||||
for (let i = 0; i < this.choosedata.length; i++) {
|
||||
for (let j = 0; j < this.choosedata[i].stockApplyDetailVos.length; j++) {
|
||||
this.choosedata[i].stockApplyDetailVos[j].applyNumber = this.choosedata[i].applyNumber
|
||||
orderdata.push(this.choosedata[i].stockApplyDetailVos[j])
|
||||
}
|
||||
}
|
||||
const applyDetail = orderdata.map(function(item) {
|
||||
return {
|
||||
applyQuantity: item.applyQuantity,
|
||||
productCode: item.productCode,
|
||||
|
@ -356,15 +365,33 @@ export default {
|
|||
basicPrice: 0,
|
||||
planMoney: '0.00',
|
||||
orderQuantity: '0.00',
|
||||
requireQuantity: item.applyQuantity,
|
||||
requireDate: item.requireDate,
|
||||
sourceSerialNumber: item.id
|
||||
sourceSerialNumber: item.id,
|
||||
applyNumber: item.applyNumber
|
||||
}
|
||||
})
|
||||
console.log('22222333333', applyDetail[0].planQuantity)
|
||||
this.$emit('apply', applyDetail)
|
||||
this.$emit('apply2', applyDetail)
|
||||
this.$emit('allinfo', this.choosedata)
|
||||
const list = await Promise.all(applyDetail.map(function(item) {
|
||||
return getStockInfoByProduct(item.productCode, item.planQuantity).then(res => {
|
||||
for (let i = 0; i < res.data.data.content.length; i++) {
|
||||
res.data.data.content[i].sourceNumber = item.applyNumber
|
||||
}
|
||||
return res.data.data.content
|
||||
})
|
||||
}))
|
||||
const list2 = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
for (let m = 0; m < list[i].length; m++) {
|
||||
list[i][m].basicPrice = list[i][m].price
|
||||
list[i][m].requireQuantity = list[i][m].quantity
|
||||
list[i][m].planQuantity = list[i][m].quantity
|
||||
list[i][m].basicQuantity = list[i][m].quantity
|
||||
list2.push(list[i][m])
|
||||
}
|
||||
}
|
||||
console.log('22222333333', list2)
|
||||
this.$emit('apply', list2)
|
||||
this.$emit('apply2', list2)
|
||||
this.$emit('allinfo', list2)
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
|
|
|
@ -117,10 +117,15 @@
|
|||
</template>
|
||||
</el-editable-column> <el-editable-column :label="$t('updates.sqyy')" prop="applyReason" align="center" min-width="150px"/>
|
||||
<el-editable-column :label="$t('updates.ydbh')" prop="sourceNumber" align="center" min-width="150px"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('updates.gys')" prop="supplierName" align="center" min-width="150px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-model="scope.row.supplierName" @focus="handlechoose(scope)"/>
|
||||
<my-supplier :control.sync="empcontrol" :procode="procode" @supplierName="personName(scope, $event)"/>
|
||||
<el-editable-column :edit-render="{type: 'default'}" :label="$t('updates.gys')" prop="supplierId" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.supplierId" :value="scope.row.supplierId" filterable style="width: 100%;" @visible-change="updatesupp($event,scope)" @change="changeDate2($event,scope)">
|
||||
<el-option
|
||||
v-for="item in suppliers"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
:label="item.supplierName"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :label="$t('updates.ydgsl')" prop="orderQuantity" align="center" min-width="150px"/>
|
||||
|
@ -196,6 +201,7 @@
|
|||
<script>
|
||||
import { updatestockplan } from '@/api/StockPlan'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { search2 } from '@/api/Supplier'
|
||||
// import { productlist } from '@/api/public'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import MyEmp from './MyEmp'
|
||||
|
@ -244,6 +250,7 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
suppliers: [],
|
||||
zzz: 123,
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
|
@ -348,6 +355,34 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
async changeDate2(event, scope) {
|
||||
console.log('event', event)
|
||||
const param = {}
|
||||
param.id = scope.row.supplierId
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const a = this.suppliers.find(item => item.id = event)
|
||||
console.log('this.suppliers', this.suppliers)
|
||||
scope.row.supplierName = a.supplierName
|
||||
console.log('scope.row', scope.row)
|
||||
// scope.row.productCode
|
||||
this.changeDate()
|
||||
},
|
||||
updatesupp(event, scope) {
|
||||
if (event === true) {
|
||||
console.log(scope.row.productCode)
|
||||
const param = {}
|
||||
param.productCode = scope.row.productCode
|
||||
param.isEffective = 1
|
||||
param.pagenum = 1
|
||||
param.pagesize = 9999
|
||||
search2(param).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.suppliers = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
console.log('this.location', this.suppliers)
|
||||
}
|
||||
},
|
||||
planQuantity(row) {
|
||||
return (row.planQuantity).toFixed(2)
|
||||
},
|
||||
|
@ -537,9 +572,10 @@ export default {
|
|||
},
|
||||
allinfo(val) {
|
||||
console.log(val)
|
||||
this.personalForm.planDate = val.applyDate
|
||||
// this.personalForm.planDate = val.applyDate
|
||||
},
|
||||
apply(val) {
|
||||
this.getTypes()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
|
@ -551,6 +587,7 @@ export default {
|
|||
},
|
||||
// 采购需求数据
|
||||
requiredata(val) {
|
||||
this.getTypes()
|
||||
console.log(val)
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.$refs.editable.insert(val[i])
|
||||
|
@ -574,6 +611,14 @@ export default {
|
|||
this.getTypes()
|
||||
},
|
||||
getTypes() {
|
||||
const param = {}
|
||||
param.pagenum = 1
|
||||
param.pagesize = 9999
|
||||
search2(param).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.suppliers = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
// 采购类别数据
|
||||
searchStockCategory(this.typeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
|
|
Loading…
Reference in a new issue