mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 23:16:09 +08:00
Merge branch 'master' of https://github.com/shawncai/ERP
This commit is contained in:
commit
7bc3c200a9
|
@ -24,6 +24,11 @@
|
|||
<span>{{ scope.row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :resizable="false" :label="$t('installmentPayList.color')" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.color }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :resizable="false" :label="$t('tongyo.quantity')" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.quantity }}</span>
|
||||
|
|
|
@ -49,15 +49,15 @@
|
|||
width="55"
|
||||
fixed="left"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('OutFactory.factoryNumber')" :resizable="false" fixed="left" align="center" min-width="150">
|
||||
<el-table-column :label="$t('OutFactory.factoryName')" :resizable="false" fixed="left" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.factoryNumber }}</span>
|
||||
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.factoryName }}</span>
|
||||
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
|
||||
</template>
|
||||
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('OutFactory.factoryName')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column :label="$t('OutFactory.factoryNumber')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.factoryName }}</span>
|
||||
<span>{{ scope.row.factoryNumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('OutFactory.factoryContactPhone')" :resizable="false" align="center" min-width="150">
|
||||
|
|
|
@ -207,7 +207,6 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.getlist()
|
||||
},
|
||||
beforeCreate() {
|
||||
_that = this
|
||||
|
@ -215,13 +214,20 @@ export default {
|
|||
methods: {
|
||||
// 根据id选中
|
||||
selectFromId(showList, selectList) {
|
||||
if (selectList) {
|
||||
for (const i in showList) {
|
||||
if (selectList.findIndex(item => item.productCode === showList[i].code) > -1) {
|
||||
this.$refs.multipleTable.toggleRowSelection(showList[i], true)
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.$nextTick(() => {
|
||||
if (selectList) {
|
||||
console.log('showList和selectList', showList, selectList)
|
||||
for (const i in showList) {
|
||||
if (selectList.findIndex(item => item.productCode === showList[i].code) > -1) {
|
||||
console.log('选中==================', i, showList[i])
|
||||
this.$refs.multipleTable.toggleRowSelection(showList[i], true)
|
||||
} else {
|
||||
this.$refs.multipleTable.toggleRowSelection(showList[i], false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return showList
|
||||
},
|
||||
getlist() {
|
||||
|
@ -254,15 +260,7 @@ export default {
|
|||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pagenum = 1
|
||||
productlist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
// this.restFilter()
|
||||
} else {
|
||||
// this.restFilter()
|
||||
}
|
||||
})
|
||||
this.getlist()
|
||||
},
|
||||
// 批量操作
|
||||
handleSelectionChange(rows) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.factoryNumber +$t('updates.xg')" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
|
||||
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.factoryName +$t('updates.xg')" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
|
||||
<!--基本信息-->
|
||||
<el-card class="box-card" style="margin-top: 63px" shadow="never">
|
||||
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
|
||||
|
@ -464,28 +464,22 @@ export default {
|
|||
return result
|
||||
},
|
||||
productdetail(val) {
|
||||
console.log(val)
|
||||
// const nowlistdata = this.$refs.editable.getRecords()
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
const alldata = [...val, ...nowlistdata]
|
||||
const filterdata = this.uniqueArray(alldata, 'productCode')
|
||||
|
||||
console.log('filterdata=========', filterdata)
|
||||
for (let i = 0; i < filterdata.length; i++) {
|
||||
console.log(filterdata[i].price)
|
||||
let m = 1
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
if (filterdata[i].productCode === nowlistdata[j].productCode) {
|
||||
m = 2
|
||||
// this.$notify.error({
|
||||
// title: 'wrong',
|
||||
// message: this.$t('prompt.wpytj'),
|
||||
// offset: 100
|
||||
// })
|
||||
// return false
|
||||
}
|
||||
}
|
||||
filterdata[i].discountRate = 0
|
||||
filterdata[i].price = filterdata[i].purchasePrice
|
||||
if (filterdata[i].price === undefined) {
|
||||
filterdata[i].price = 0
|
||||
}
|
||||
// filterdata[i].price = filterdata[i].purchasePrice
|
||||
if (m === 1) {
|
||||
this.$refs.editable.insert(filterdata[i])
|
||||
}
|
||||
|
|
|
@ -671,27 +671,27 @@ export default {
|
|||
handlesave() {
|
||||
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
|
||||
// 保存时同样商品不能有同一个批次
|
||||
let i = 0
|
||||
EnterDetail.map(function(elem) {
|
||||
return elem
|
||||
}).forEach(function(elem) {
|
||||
EnterDetail.map(function(elem2) {
|
||||
return elem2
|
||||
}).forEach(function(elem2) {
|
||||
if (elem2.productCode === elem.productCode && elem2.batch === elem.batch) {
|
||||
i++
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(i)
|
||||
if (i > EnterDetail.length) {
|
||||
this.$notify.error({
|
||||
title: 'wrong',
|
||||
message: '同样商品不能有同一个批次',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
// let i = 0
|
||||
// EnterDetail.map(function(elem) {
|
||||
// return elem
|
||||
// }).forEach(function(elem) {
|
||||
// EnterDetail.map(function(elem2) {
|
||||
// return elem2
|
||||
// }).forEach(function(elem2) {
|
||||
// if (elem2.productCode === elem.productCode && elem2.batch === elem.batch) {
|
||||
// i++
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// console.log(i)
|
||||
// if (i > EnterDetail.length) {
|
||||
// this.$notify.error({
|
||||
// title: 'wrong',
|
||||
// message: '同样商品不能有同一个批次',
|
||||
// offset: 100
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// 批次货位不能为空
|
||||
let j = 1
|
||||
EnterDetail.map(function(elem) {
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.discountRate"
|
||||
@change="getdiscountRate(scope.row)"/>
|
||||
@input="getdiscountRate(scope.row, scope)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" :label="$t('updates.cke')" prop="discountMoney" align="center" min-width="170px">
|
||||
|
@ -636,12 +636,32 @@ export default {
|
|||
}
|
||||
},
|
||||
// 通过折扣计算折扣额
|
||||
getdiscountRate(row) {
|
||||
getdiscountRate(row, scope) {
|
||||
console.log('执行了')
|
||||
if (row.discountRate === 0) {
|
||||
row.discountMoney = 0
|
||||
} else {
|
||||
row.discountMoney = (row.includeTaxPrice * row.quantity * (row.discountRate / 100)).toFixed(2)
|
||||
}
|
||||
if (row !== '' && row !== null && row !== undefined && scope.$index === 0) {
|
||||
if (row.discountRate !== '' && row.discountRate !== null && row.discountRate !== undefined) {
|
||||
for (let i = 0; i < this.list2.length; i++) {
|
||||
this.list2[i].temp = i
|
||||
}
|
||||
for (let i = row.temp; i < this.list2.length; i++) {
|
||||
console.log('this.list2[i].discountRate', this.list2[i].discountRate)
|
||||
if (this.list2[i].discountRate !== null && this.list2[i].discountRate !== 0 && this.list2[i].discountRate !== '' && this.list2[i].discountRate !== undefined) {
|
||||
// this.list2[i].requireDate = row.requireDate
|
||||
// this.list2[i].requireQuantity = row.requireQuantity
|
||||
} else {
|
||||
console.log(222)
|
||||
// this.list2[i].requireDate = row.requireDate
|
||||
this.list2[i].discountRate = row.discountRate
|
||||
}
|
||||
}
|
||||
console.log(row)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 通过税率计算含税价
|
||||
gettaxRate(row) {
|
||||
|
|
|
@ -379,7 +379,7 @@ export default {
|
|||
color: item.color,
|
||||
basicQuantity: (Number(item.arrivalQuantity) - Number(item.hadStorageQuantity)).toFixed(2),
|
||||
actualEnterQuantity: (Number(item.arrivalQuantity) - Number(item.hadStorageQuantity)).toFixed(2),
|
||||
enterPrice: (item.includeTaxPrice).toFixed(2),
|
||||
enterPrice: item.includeTaxPrice,
|
||||
taxRate: (item.taxRate).toFixed(2),
|
||||
enterMoney: '0.00',
|
||||
remarks: '',
|
||||
|
@ -391,7 +391,7 @@ export default {
|
|||
hadStorageQuantity: item.hadStorageQuantity
|
||||
}
|
||||
})
|
||||
console.log(arrivalDetail)
|
||||
console.log('arrivalDetail', arrivalDetail)
|
||||
this.$emit('arrival', arrivalDetail)
|
||||
this.$emit('allarrivalinfo', this.choosedata)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue