This commit is contained in:
shawnzhang 2020-04-18 17:03:53 +08:00
commit 7bc3c200a9
7 changed files with 74 additions and 57 deletions

View file

@ -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>

View file

@ -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">

View file

@ -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) {

View file

@ -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])
}

View file

@ -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) {

View file

@ -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) {

View file

@ -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)
}