7/30 前修改问题

This commit is contained in:
shawnzhang 2020-07-30 18:10:14 +08:00
parent 2dd91f0730
commit c827494faa
30 changed files with 2404 additions and 1784 deletions

View file

@ -488,4 +488,38 @@ for (let i = 0, l = newarr.length; i < l - 1; i++) {
return time.getTime() > _now || time.getTime() < sevenDays
}
},
```
#### 去除json中重复数据
```
uniqueArray(array, key) {
var result = [array[0]]
for (var i = 1; i < array.length; i++) {
var item = array[i]
var repeat = false
for (var j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
},
const nowlistdata = this.$refs.editable.getRecords()
this.$refs.editable.clear()
console.log('val============', val)
const alldata = [...nowlistdata, ...val]
const filterdata = this.uniqueArray(alldata, 'productCode')
console.log('filterdata=====', filterdata)
// this.list2 = filterdata
for (let i = 0; i < filterdata.length; i++) {
// val[i].quantity = 1
this.$refs.editable.insert(filterdata[i])
}
```

View file

@ -424,6 +424,9 @@ export function productlist(query) {
if (query.categoryid !== '' && query.categoryid !== null && query.categoryid !== undefined) {
params.append('categoryid', query.categoryid) // 你要传给后台的参数值 key/value
}
if (query.detailCategoryId !== '' && query.detailCategoryId !== null && query.detailCategoryId !== undefined) {
params.append('detailCategoryId', query.detailCategoryId) // 你要传给后台的参数值 key/value
}
if (query.typeid !== '' && query.typeid !== null && query.typeid !== undefined) {
params.append('typeid', query.typeid) // 你要传给后台的参数值 key/value
}

View file

@ -4054,6 +4054,8 @@ export default {
createTime: 'create time'
},
collectAndPay: {
preReturn: 'preReturn',
hhd: 'exchange',
time: 'time',
saleOut: 'sales stock out',
stockRetreat: 'purchase return',

View file

@ -4054,6 +4054,8 @@ export default {
createTime: '创建时间'
},
collectAndPay: {
preReturn: '预收退款',
hhd: '换货单',
time: '时间',
saleOut: '销售出库',
stockRetreat: '采购退货',

View file

@ -1117,28 +1117,32 @@ export default {
},
//
restAllForm() {
this.personalForm = {
createPersonId: this.$store.getters.userId,
countryId: this.$store.getters.countryId,
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
inspectionPersonId: this.$store.getters.userId,
isRecheck: 1,
sampleQuantity: null,
checkQuantity: null,
failedQuantity: '',
passQuantity: '',
checkMode: '1',
checkType: '1',
checkDate: null,
checkResult: '1',
checkPersonId: this.$store.getters.userId
}
this.judgequilty = null
this.inspectionPersonId = this.$store.getters.name
this.workCenterId = null
this.produceManagerId = null
this.checkPersonId = this.$store.getters.name
this.personalForm.productName = ''
this.personalForm.unit = ''
this.typeId = ''
this.personalForm.typeId = ''
// this.personalForm = {
// createPersonId: this.$store.getters.userId,
// countryId: this.$store.getters.countryId,
// repositoryId: this.$store.getters.repositoryId,
// regionId: this.$store.getters.regionId,
// inspectionPersonId: this.$store.getters.userId,
// isRecheck: 1,
// sampleQuantity: null,
// checkQuantity: null,
// failedQuantity: '',
// passQuantity: '',
// checkMode: '1',
// checkType: '1',
// checkDate: null,
// checkResult: '1',
// checkPersonId: this.$store.getters.userId
// }
// this.judgequilty = null
// this.inspectionPersonId = this.$store.getters.name
// this.workCenterId = null
// this.produceManagerId = null
// this.checkPersonId = this.$store.getters.name
this.getdatatime()
},
//
@ -1232,7 +1236,7 @@ export default {
this.restAllForm()
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.$refs.personalForm3.clearValidate()

View file

@ -120,6 +120,7 @@ export default {
watch: {
reportcontrol() {
this.editVisible = this.reportcontrol
this.getdata()
if (this.reportcontrol) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180

View file

@ -110,6 +110,7 @@ export default {
watch: {
reportcontrol2() {
this.editVisible = this.reportcontrol2
this.getData()
if (this.reportcontrol2) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180

View file

@ -99,6 +99,7 @@ export default {
watch: {
reportcontrol3() {
this.editVisible = this.reportcontrol3
this.getData()
if (this.reportcontrol3) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180

View file

@ -94,6 +94,7 @@ export default {
watch: {
reportcontrol4() {
this.editVisible = this.reportcontrol4
this.getdata()
if (this.reportcontrol4) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180

View file

@ -75,6 +75,18 @@
sortable
width="240"
align="center"/>
<el-table-column
:label="$t('collectAndPay.hhd')"
prop="exchangeMoney"
sortable
width="240"
align="center"/>
<el-table-column
:label="$t('collectAndPay.preReturn')"
prop="preReturn"
sortable
width="240"
align="center"/>
<el-table-column
:label="$t('collectAndPay.stockRetreat')"
prop="stockRetreat"

View file

@ -374,9 +374,9 @@ export default {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return (Number(prev) + Number(curr)).toFixed(6)
return (Number(prev) + Number(curr)).toFixed(2)
} else {
return (Number(prev)).toFixed(6)
return (Number(prev)).toFixed(2)
}
}, 0)
sums[index] += ''

View file

@ -91,10 +91,21 @@
@selection-change="handleSelectionChange">
<el-editable-column type="selection" width="55" align="center"/>
<el-editable-column type="index" width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.hw')" prop="locationCode" align="center" width="200px">
<!-- <el-editable-column :label="$t('Hmodule.hw')" prop="locationCode" align="center" width="200px">
<template slot-scope="scope">
<p>{{ getLocationData(scope.row) }}</p>
</template>
</el-editable-column> -->
<el-editable-column :edit-render="{name: 'ElSelect', type: 'default'}" :label="$t('Hmodule.hw')" prop="locationId" align="center" width="200px">
<template slot-scope="scope">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" :placeholder="$t('Hmodule.xzhw')" filterable clearable style="margin-left: 18px;width: 100%;margin-bottom: 0" >
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
</el-editable-column>
<!--<el-editable-column :edit-render="{name: 'ElSelect', options: batchlist, type: 'visible'}" prop="batch" align="center" :label="$t('Hmodule.pc')" width="150px"/>-->
<!-- <el-editable-column :edit-render="{type: 'default'}" :label="$t('Hmodule.pc')" prop="batch" align="center" width="200px">-->
@ -106,18 +117,11 @@
<!-- :value="item"-->
<!-- :label="item"/>-->
<!-- </el-select>-->
<el-editable-column :label="$t('Hmodule.pc')" prop="batch" align="center" min-width="150" />
<!-- <template slot="edit" slot-scope="scope">
<el-select v-if="scope.row.batch !== '不使用'" v-model="scope.row.batch" :value="scope.row.batch" :placeholder="$t('Hmodule.xcpc')" filterable clearable style="width: 100%;" @visible-change="updatebatch2($event,scope)">
<el-option
v-for="(item, index) in batchlist"
:key="index"
:value="item"
:label="item"/>
</el-select>
<span v-else>{{ scope.row.batch }}</span>
<el-editable-column :label="$t('Hmodule.pc')" prop="batch" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ getBatch(scope.row) }}</span>
</template>
</el-editable-column> -->
</el-editable-column>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" width="150px"/>
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" width="150px"/>
@ -199,7 +203,7 @@
<!--操作-->
<div class="buttons" style="position:fixed;bottom: 0;width: 100%;height: 40px; background: #fff;z-index: 99">
<el-button v-no-more-click type="primary" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button :loading="saveloading" type="primary" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button type="success" @click="handleentry()">{{ $t('updates.jxlr') }}</el-button>
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
</div>
@ -239,7 +243,7 @@
import '@/directive/noMoreClick/index.js'
import { getdeptlist } from '@/api/BasicSettings'
import { addinventorycount } from '@/api/InventoryCount'
import { batchlist, getQuantity, getlocation, countlist } from '@/api/public'
import { batchlist, getQuantity, getlocation, countlist, locationlist } from '@/api/public'
import MyCreate from './components/MyCreate'
import MyRepository from './components/MyRepository'
import MyDetail from './components/MyDetail'
@ -280,6 +284,7 @@ export default {
}
}
return {
saveloading: false,
heji1: 0,
heji2: 0,
heji3: 0,
@ -367,7 +372,7 @@ export default {
num4 += this.list2[i].price * this.list2[i].inventoryQuantity
num5 += this.list2[i].price * this.list2[i].actualQuantity
num6 += this.list2[i].price * this.list2[i].diffQuantity
console.log('this.list2[i].diffQuantity', this.list2[i].diffQuantity)
// console.log('this.list2[i].diffQuantity', this.list2[i].diffQuantity)
}
this.heji1 = num1
this.heji2 = num2
@ -388,6 +393,68 @@ export default {
_that = this
},
methods: {
getBatch(row) {
if (row.flag === undefined) {
row.flag = true
} else {
return row.batch
}
if (row.flag) {
const parms3 = row.productCode
// batchlist(this.personalForm.countRepositoryId, parms3).then(res => {
// if (res.data.data.content.length !== 0) {
// row.batch = res.data.data.content[0]
// }
// })
getlocation(this.personalForm.countRepositoryId, row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
if (res.data.data.content.length === 1) {
row.locationId = res.data.data.content[0].id
}
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.countRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
// return row.batch
}
row.flag = false
},
updateLocation(event, scope) {
if (event === true) {
console.log(this.personalForm.countRepositoryId)
if (!this.personalForm.countRepositoryId) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.sqslcg'),
offset: 100
})
return false
}
getlocation(this.personalForm.countRepositoryId, scope.row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
if (res.data.data.content.length === 1) {
scope.row.locationId = res.data.data.content[0].id
}
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.countRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
}
},
getLocationData(row) {
//
// if (row.batch === null || row.batch === '' || row.batch === undefined) {
@ -473,8 +540,8 @@ export default {
},
//
getDiff(par1, par2, par3) {
console.log('par1', par1)
console.log('par2', par2)
// console.log('par1', par1)
// console.log('par2', par2)
par3.diffQuantity = Math.abs(par2 - par1)
let num1 = 0
let num2 = 0
@ -504,50 +571,56 @@ export default {
return quan * pric
},
getquantity(sco) {
const parms2 = sco.locationId
const parms3 = sco.productCode
const parms4 = sco.batch
if (parms4 !== '' && parms4 !== null && parms4 !== undefined) {
getQuantity(this.personalForm.countRepositoryId, parms2, parms3, parms4).then(res => {
this.out = res.data.data.content
sco.inventoryQuantity = res.data.data.content
})
return sco.inventoryQuantity
} else {
sco.inventoryQuantity = 0
return sco.inventoryQuantity
if (sco.flag === undefined) {
sco.flag = true
}
},
updatebatch(event, scope) {
if (event === true) {
console.log(this.personalForm.countRepositoryId)
if (this.personalForm.countRepositoryId === undefined || this.personalForm.countRepositoryId === '') {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.sqslcg'),
offset: 100
if (sco.flag) {
const parms2 = sco.locationId
const parms3 = sco.productCode
const parms4 = sco.batch
if (parms4 !== '' && parms4 !== null && parms4 !== undefined) {
getQuantity(this.personalForm.countRepositoryId, parms2, parms3, parms4).then(res => {
this.out = res.data.data.content
sco.inventoryQuantity = res.data.data.content
})
return false
return sco.inventoryQuantity
} else {
sco.inventoryQuantity = 0
return sco.inventoryQuantity
}
getlocation(this.personalForm.countRepositoryId, scope.row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
this.locationlist = res.data.data.content
scope.row.locationId = res.data.data.content[0].id
this.updatebatch3(scope)
} else if (res.data.data.content.length === 0) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.gckmygsp'),
offset: 100
})
this.locationlist = []
return false
}
}
})
}
sco.flag = false
},
// updatebatch(event, scope) {
// if (event === true) {
// console.log(this.personalForm.countRepositoryId)
// if (this.personalForm.countRepositoryId === undefined || this.personalForm.countRepositoryId === '') {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.sqslcg'),
// offset: 100
// })
// return false
// }
// getlocation(this.personalForm.countRepositoryId, scope.row).then(res => {
// if (res.data.ret === 200) {
// if (res.data.data.content.length !== 0) {
// this.locationlist = res.data.data.content
// scope.row.locationId = res.data.data.content[0].id
// this.updatebatch3(scope)
// } else if (res.data.data.content.length === 0) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.gckmygsp'),
// offset: 100
// })
// this.locationlist = []
// return false
// }
// }
// })
// }
// },
updatebatch3(scope) {
const parms3 = scope.row.productCode
batchlist(this.personalForm.countRepositoryId, parms3).then(res => {
@ -564,123 +637,147 @@ export default {
},
//
handlesave() {
if (this.Time === null) {
this.personalForm.beginTime = null
this.personalForm.endTime = null
} else {
this.personalForm.beginTime = this.Time[0]
this.personalForm.endTime = this.Time[1]
}
const EnterDetail = this.$refs.editable.getRecords()
// if (EnterDetail.length === 0) {
// this.$notify.error({
// title: 'wrong',
// message: '',
// offset: 100
// })
// return false
// }
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
delete elem.locationId
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.typeId === null || elem.typeId === '' || elem.typeId === undefined) {
delete elem.typeId
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.inventoryQuantity === null || elem.inventoryQuantity === '' || elem.inventoryQuantity === undefined) {
delete elem.inventoryQuantity
}
if (elem.actualQuantity === null || elem.actualQuantity === '' || elem.actualQuantity === undefined) {
delete elem.actualQuantity
}
if (elem.price === null || elem.price === '' || elem.price === undefined) {
delete elem.price
}
if (elem.totalMoney === null || elem.totalMoney === '' || elem.totalMoney === undefined) {
delete elem.totalMoney
}
if (elem.diffQuantity === null || elem.diffQuantity === '' || elem.diffQuantity === undefined) {
delete elem.diffQuantity
}
if (elem.diffType === null || elem.diffType === '' || elem.diffType === undefined) {
delete elem.diffType
}
if (elem.remarks === null || elem.remarks === '' || elem.remarks === undefined) {
delete elem.remarks
}
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
return elem
})
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
const parms1 = JSON.stringify(Data)
let parms2 = ''
if (EnterDetail.length !== 0) {
parms2 = JSON.stringify(EnterDetail)
}
this.$refs.personalForm.validate((valid) => {
if (valid) {
this.$refs.editable.validate((valid) => {
if (valid) {
addinventorycount(parms1, parms2, this.personalForm.repositoryId, this.personalForm.regionId).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.restAllForm()
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
return false
}
})
this.saveloading = true
setTimeout(() => {
if (this.Time === null) {
this.personalForm.beginTime = null
this.personalForm.endTime = null
} else {
this.personalForm.beginTime = this.Time[0]
this.personalForm.endTime = this.Time[1]
}
const EnterDetail = this.$refs.editable.getRecords()
if (EnterDetail.length === 0) {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
message: '明细表不能为空',
offset: 100
})
this.saveloading = false
return false
}
})
let judgestat = 1
for (const i in EnterDetail) {
if (!EnterDetail[i].locationId) {
judgestat = 2
}
}
if (judgestat === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
this.saveloading = false
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.locationId === null || elem.locationId === '' || elem.locationId === undefined) {
delete elem.locationId
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.typeId === null || elem.typeId === '' || elem.typeId === undefined) {
delete elem.typeId
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.inventoryQuantity === null || elem.inventoryQuantity === '' || elem.inventoryQuantity === undefined) {
delete elem.inventoryQuantity
}
if (elem.actualQuantity === null || elem.actualQuantity === '' || elem.actualQuantity === undefined) {
delete elem.actualQuantity
}
if (elem.price === null || elem.price === '' || elem.price === undefined) {
delete elem.price
}
if (elem.totalMoney === null || elem.totalMoney === '' || elem.totalMoney === undefined) {
delete elem.totalMoney
}
if (elem.diffQuantity === null || elem.diffQuantity === '' || elem.diffQuantity === undefined) {
delete elem.diffQuantity
}
if (elem.diffType === null || elem.diffType === '' || elem.diffType === undefined) {
delete elem.diffType
}
if (elem.remarks === null || elem.remarks === '' || elem.remarks === undefined) {
delete elem.remarks
}
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
return elem
})
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
const parms1 = JSON.stringify(Data)
let parms2 = ''
if (EnterDetail.length !== 0) {
parms2 = JSON.stringify(EnterDetail)
}
this.$refs.personalForm.validate((valid) => {
if (valid) {
this.$refs.editable.validate((valid) => {
if (valid) {
addinventorycount(parms1, parms2, this.personalForm.repositoryId, this.personalForm.regionId).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.restAllForm()
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
this.saveloading = false
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.saveloading = false
return false
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.saveloading = false
return false
}
})
}, 1000 * 0.5)
},
//
restAllForm() {
@ -746,112 +843,230 @@ export default {
if (this.countRepositoryId === '' || this.countRepositoryId === null || this.countRepositoryId === undefined) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.sqslcg'),
message: this.$t('prompt.qxxzck'),
offset: 100
})
return false
}
this.control = true
},
uniqueArray(array, key) {
var result = [array[0]]
for (var i = 1; i < array.length; i++) {
var item = array[i]
var repeat = false
for (var j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
},
async productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
if (nowlistdata.length === 0) {
const batcharr = await Promise.all(val.map(item => {
return batchlist(this.personalForm.countRepositoryId, item.productCode)
}))
const newbatch = batcharr.map(item => {
return {
pcode: item.data.data.pCode,
batchs: item.data.data.content
}
})
console.log('newbatch---======', newbatch)
this.$refs.editable.clear()
console.log('val============', val)
const alldata = [...nowlistdata, ...val]
const filterdata = this.uniqueArray(alldata, 'productCode')
console.log('filterdata=====', filterdata)
const needarr = newbatch.map(item => {
const arrned = item.batchs.map(zitem => {
return {
productCode: item.pcode,
batch: zitem
}
})
return arrned
})
const onearr = [].concat.apply([], needarr)
for (const i in val) {
for (const j in onearr) {
if (val[i].productCode === onearr[j].productCode) {
onearr[j].productName = val[i].productName
onearr[j].color = val[i].color
onearr[j].locationId = val[i].locationId
onearr[j].typeId = val[i].typeId
onearr[j].inventoryQuantity = val[i].inventoryQuantity
onearr[j].actualQuantity = val[i].actualQuantity
onearr[j].enterQuantity = val[i].enterQuantity
onearr[j].taxRate = val[i].taxRate
onearr[j].unit = val[i].unit
onearr[j].totalMoney = val[i].totalMoney
onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
onearr[j].basicQuantity = val[i].basicQuantity
onearr[j].price = val[i].price
onearr[j].productType = val[i].productType
onearr[j].countPerson = val[i].countPerson
onearr[j].countPersonId = val[i].countPersonId
onearr[j].countDate = val[i].countDate
const batcharr = await Promise.all(filterdata.map(item => {
return batchlist(this.personalForm.countRepositoryId, item.productCode)
}))
console.log('batcharr', batcharr)
const nonebatch = []
for (const i in batcharr) {
for (const j in filterdata) {
if (batcharr[i].data.data.content.length === 0) {
if (batcharr[i].data.data.pCode === filterdata[j].productCode) {
nonebatch.push(filterdata[j])
}
}
}
console.log('needarr---======', onearr)
this.list2 = onearr
} else {
const batcharr = await Promise.all(val.map(item => {
return batchlist(this.personalForm.countRepositoryId, item.productCode)
}))
const newbatch = batcharr.map(item => {
return {
pcode: item.data.data.pCode,
batchs: item.data.data.content
}
})
console.log('newbatch---======', newbatch)
const needarr = newbatch.map(item => {
const arrned = item.batchs.map(zitem => {
return {
productCode: item.pcode,
batch: zitem
}
})
return arrned
})
const onearr = [].concat.apply([], needarr)
for (const i in val) {
for (const j in onearr) {
if (val[i].productCode === onearr[j].productCode) {
onearr[j].productName = val[i].productName
onearr[j].color = val[i].color
onearr[j].locationId = val[i].locationId
onearr[j].typeId = val[i].typeId
onearr[j].inventoryQuantity = val[i].inventoryQuantity
onearr[j].actualQuantity = val[i].actualQuantity
onearr[j].enterQuantity = val[i].enterQuantity
onearr[j].taxRate = val[i].taxRate
onearr[j].unit = val[i].unit
onearr[j].totalMoney = val[i].totalMoney
onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
onearr[j].basicQuantity = val[i].basicQuantity
onearr[j].price = val[i].price
onearr[j].productType = val[i].productType
onearr[j].countPerson = val[i].countPerson
onearr[j].countPersonId = val[i].countPersonId
onearr[j].countDate = val[i].countDate
}
}
}
console.log('needarr---======', onearr)
const newarr = Object.assign([], onearr, nowlistdata)
this.list2 = newarr
}
console.log('nonebatch', nonebatch)
const newbatch = batcharr.map(item => {
return {
pcode: item.data.data.pCode,
batchs: item.data.data.content
}
})
console.log('newbatch---======', newbatch)
const needarr = newbatch.map(item => {
const arrned = item.batchs.map(zitem => {
return {
productCode: item.pcode,
batch: zitem
}
})
return arrned
})
console.log('needarr', needarr)
const onearr = [].concat.apply([], needarr)
for (const i in filterdata) {
for (const j in onearr) {
if (filterdata[i].productCode === onearr[j].productCode) {
onearr[j].productName = filterdata[i].productName
onearr[j].color = filterdata[i].color
onearr[j].locationId = filterdata[i].locationId
onearr[j].typeId = filterdata[i].typeId
onearr[j].inventoryQuantity = filterdata[i].inventoryQuantity
onearr[j].actualQuantity = filterdata[i].actualQuantity
onearr[j].enterQuantity = filterdata[i].enterQuantity
onearr[j].taxRate = filterdata[i].taxRate
onearr[j].unit = filterdata[i].unit
onearr[j].totalMoney = filterdata[i].totalMoney
onearr[j].actualEnterQuantity = filterdata[i].actualEnterQuantity
onearr[j].basicQuantity = filterdata[i].basicQuantity
onearr[j].price = filterdata[i].price
onearr[j].productType = filterdata[i].productType
onearr[j].countPerson = filterdata[i].countPerson
onearr[j].countPersonId = filterdata[i].countPersonId
onearr[j].countDate = filterdata[i].countDate
}
}
}
console.log('needarr---======', onearr)
const finallyarr = [...nonebatch, ...onearr]
this.list2 = finallyarr
// this.list2 = filterdata
// for (let i = 0; i < filterdata.length; i++) {
// // val[i].quantity = 1
// this.$refs.editable.insert(filterdata[i])
// }
}
// async productdetail(val) {
// const nowlistdata = this.$refs.editable.getRecords()
// if (nowlistdata.length === 0) {
// const batcharr = await Promise.all(val.map(item => {
// return batchlist(this.personalForm.countRepositoryId, item.productCode)
// }))
// console.log('batcharr', batcharr)
// const nonebatch = []
// for (const i in batcharr) {
// for (const j in val) {
// if (batcharr[i].data.data.content.length === 0) {
// if (batcharr[i].data.data.pCode === val[j].productCode) {
// nonebatch.push(val[j])
// }
// }
// }
// }
// console.log('nonebatch', nonebatch)
// const newbatch = batcharr.map(item => {
// return {
// pcode: item.data.data.pCode,
// batchs: item.data.data.content
// }
// })
// console.log('newbatch---======', newbatch)
// const needarr = newbatch.map(item => {
// const arrned = item.batchs.map(zitem => {
// return {
// productCode: item.pcode,
// batch: zitem
// }
// })
// return arrned
// })
// console.log('needarr', needarr)
// const onearr = [].concat.apply([], needarr)
// for (const i in val) {
// for (const j in onearr) {
// if (val[i].productCode === onearr[j].productCode) {
// onearr[j].productName = val[i].productName
// onearr[j].color = val[i].color
// onearr[j].locationId = val[i].locationId
// onearr[j].typeId = val[i].typeId
// onearr[j].inventoryQuantity = val[i].inventoryQuantity
// onearr[j].actualQuantity = val[i].actualQuantity
// onearr[j].enterQuantity = val[i].enterQuantity
// onearr[j].taxRate = val[i].taxRate
// onearr[j].unit = val[i].unit
// onearr[j].totalMoney = val[i].totalMoney
// onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
// onearr[j].basicQuantity = val[i].basicQuantity
// onearr[j].price = val[i].price
// onearr[j].productType = val[i].productType
// onearr[j].countPerson = val[i].countPerson
// onearr[j].countPersonId = val[i].countPersonId
// onearr[j].countDate = val[i].countDate
// }
// }
// }
// console.log('needarr---======', onearr)
// const finallyarr = [...nonebatch, ...onearr]
// this.list2 = finallyarr
// } else {
// console.log(123)
// const batcharr = await Promise.all(val.map(item => {
// return batchlist(this.personalForm.countRepositoryId, item.productCode)
// }))
// const nonebatch = []
// for (const i in batcharr) {
// for (const j in val) {
// if (batcharr[i].data.data.content.length === 0) {
// if (batcharr[i].data.data.pCode === val[j].productCode) {
// nonebatch.push(val[j])
// }
// }
// }
// }
// const newbatch = batcharr.map(item => {
// return {
// pcode: item.data.data.pCode,
// batchs: item.data.data.content
// }
// })
// console.log('newbatch---======', newbatch)
// const needarr = newbatch.map(item => {
// const arrned = item.batchs.map(zitem => {
// return {
// productCode: item.pcode,
// batch: zitem
// }
// })
// return arrned
// })
// const onearr = [].concat.apply([], needarr)
// for (const i in val) {
// for (const j in onearr) {
// if (val[i].productCode === onearr[j].productCode) {
// onearr[j].productName = val[i].productName
// onearr[j].color = val[i].color
// onearr[j].locationId = val[i].locationId
// onearr[j].typeId = val[i].typeId
// onearr[j].inventoryQuantity = val[i].inventoryQuantity
// onearr[j].actualQuantity = val[i].actualQuantity
// onearr[j].enterQuantity = val[i].enterQuantity
// onearr[j].taxRate = val[i].taxRate
// onearr[j].unit = val[i].unit
// onearr[j].totalMoney = val[i].totalMoney
// onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
// onearr[j].basicQuantity = val[i].basicQuantity
// onearr[j].price = val[i].price
// onearr[j].productType = val[i].productType
// onearr[j].countPerson = val[i].countPerson
// onearr[j].countPersonId = val[i].countPersonId
// onearr[j].countDate = val[i].countDate
// }
// }
// }
// console.log('needarr---======', onearr)
// const newarr = Object.assign([], onearr, nowlistdata)
// const finallyarr = [...nonebatch, ...newarr]
// this.list2 = newarr
// }
// }
//
// 2
// console.log(val)

View file

@ -129,7 +129,7 @@
</template>
<script>
import { chooseProduct1, searchEmpCategory2 } from '@/api/Product'
import { productlist, searchEmpCategory2 } from '@/api/Product'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MySupplier from '../../Product/components/MySupplier'
@ -228,7 +228,7 @@ export default {
//
this.listLoading = true
this.getemplist.searchRepositoryId = this.query.countRepositoryId
chooseProduct1(this.getemplist).then(res => {
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
@ -256,7 +256,7 @@ export default {
handleFilter() {
this.getemplist.pagenum = 1
this.getemplist.searchRepositoryId = this.query.countRepositoryId
chooseProduct1(this.getemplist).then(res => {
productlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount

View file

@ -75,11 +75,27 @@
@selection-change="handleSelectionChange">
<el-editable-column type="selection" width="55" align="center"/>
<el-editable-column type="index" width="55" align="center"/>
<el-editable-column :edit-render="{type: 'default'}" :label="$t('Hmodule.hw')" prop="locationCode" align="center" width="200px">
<el-editable-column :edit-render="{name: 'ElSelect', type: 'default'}" :label="$t('Hmodule.hw')" prop="locationId" align="center" width="200px">
<template slot-scope="scope">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" :placeholder="$t('Hmodule.xzhw')" filterable clearable style="margin-left: 18px;width: 100%;margin-bottom: 0" >
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
</el-editable-column>
<el-editable-column :label="$t('Hmodule.pc')" prop="batch" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ getBatch(scope.row) }}</span>
</template>
</el-editable-column>
<!-- <el-editable-column :edit-render="{type: 'default'}" :label="$t('Hmodule.hw')" prop="locationCode" align="center" width="200px">
<template slot-scope="scope">
<p>{{ getLocationData(scope.row) }}</p>
</template>
</el-editable-column>
</el-editable-column> -->
<!--<el-editable-column :edit-render="{name: 'ElSelect', options: batchlist, type: 'visible'}" prop="batch" align="center" :label="$t('Hmodule.pc')" width="150px"/>-->
<!--<el-editable-column :edit-render="{name: 'ElSelect', options: batchlist, type: 'visible'}" prop="batch" align="center" :label="$t('Hmodule.pc')" width="150px"/>-->
<!-- <el-editable-column :edit-render="{type: 'default'}" :label="$t('Hmodule.pc')" prop="batch" align="center" width="200px">-->
@ -91,7 +107,7 @@
<!-- :value="item"-->
<!-- :label="item"/>-->
<!-- </el-select>-->
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('Hmodule.pc')" prop="batch" align="center" min-width="150" />
<!-- <el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('Hmodule.pc')" prop="batch" align="center" min-width="150" /> -->
<!-- <template slot="edit" slot-scope="scope">
<el-select v-if="scope.row.batch !== '不使用'" v-model="scope.row.batch" :value="scope.row.batch" :placeholder="$t('Hmodule.xcpc')" filterable clearable style="width: 100%;" @visible-change="updatebatch2($event,scope)">
<el-option
@ -181,10 +197,10 @@
</template>
<script>
import { locationlist } from '@/api/WarehouseAdjust'
// import { locationlist } from '@/api/WarehouseAdjust'
import { getdeptlist } from '@/api/BasicSettings'
import { updatecount, deletecountdetail } from '@/api/InventoryCount'
import { batchlist, getQuantity, getlocation } from '@/api/public'
import { batchlist, getQuantity, getlocation, countlist, locationlist } from '@/api/public'
import MyCreate from './MyCreate'
import MyRepository from './MyRepository'
import MyDetail from './MyDetail'
@ -345,6 +361,39 @@ export default {
_that = this
},
methods: {
getBatch(row) {
if (row.flag === undefined) {
row.flag = true
} else {
return row.batch
}
if (row.flag) {
const parms3 = row.productCode
batchlist(this.personalForm.countRepositoryId, parms3).then(res => {
if (res.data.data.content.length !== 0) {
row.batch = res.data.data.content[0]
}
})
getlocation(this.personalForm.countRepositoryId, row).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.length !== 0) {
if (res.data.data.content.length === 1) {
row.locationId = res.data.data.content[0].id
}
this.locationlist = res.data.data.content
} else if (res.data.data.content.length === 0) {
locationlist(this.personalForm.countRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
}
}
})
return row.batch
}
row.flag = false
},
getLocationData(row) {
//
if (row.batch === null || row.batch === '' || row.batch === undefined) {
@ -578,105 +627,135 @@ export default {
handleAddproduct() {
this.control = true
},
async productdetail(val) {
uniqueArray(array, key) {
var result = [array[0]]
for (var i = 1; i < array.length; i++) {
var item = array[i]
var repeat = false
for (var j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
},
productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
if (nowlistdata.length === 0) {
const batcharr = await Promise.all(val.map(item => {
return batchlist(this.personalForm.countRepositoryId, item.productCode)
}))
const newbatch = batcharr.map(item => {
return {
pcode: item.data.data.pCode,
batchs: item.data.data.content
}
})
console.log('newbatch---======', newbatch)
const needarr = newbatch.map(item => {
const arrned = item.batchs.map(zitem => {
return {
productCode: item.pcode,
batch: zitem
}
})
return arrned
})
const onearr = [].concat.apply([], needarr)
for (const i in val) {
for (const j in onearr) {
if (val[i].productCode === onearr[j].productCode) {
onearr[j].productName = val[i].productName
onearr[j].color = val[i].color
onearr[j].locationId = val[i].locationId
onearr[j].typeId = val[i].typeId
onearr[j].inventoryQuantity = val[i].inventoryQuantity
onearr[j].actualQuantity = val[i].actualQuantity
onearr[j].enterQuantity = val[i].enterQuantity
onearr[j].taxRate = val[i].taxRate
onearr[j].unit = val[i].unit
onearr[j].totalMoney = val[i].totalMoney
onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
onearr[j].basicQuantity = val[i].basicQuantity
onearr[j].price = val[i].price
onearr[j].productType = val[i].productType
onearr[j].countPerson = val[i].countPerson
onearr[j].countPersonId = val[i].countPersonId
onearr[j].countDate = val[i].countDate
}
}
}
console.log('needarr---======', onearr)
this.list2 = onearr
} else {
const batcharr = await Promise.all(val.map(item => {
return batchlist(this.personalForm.countRepositoryId, item.productCode)
}))
const newbatch = batcharr.map(item => {
return {
pcode: item.data.data.pCode,
batchs: item.data.data.content
}
})
console.log('newbatch---======', newbatch)
const needarr = newbatch.map(item => {
const arrned = item.batchs.map(zitem => {
return {
productCode: item.pcode,
batch: zitem
}
})
return arrned
})
const onearr = [].concat.apply([], needarr)
for (const i in val) {
for (const j in onearr) {
if (val[i].productCode === onearr[j].productCode) {
onearr[j].productName = val[i].productName
onearr[j].color = val[i].color
onearr[j].locationId = val[i].locationId
onearr[j].typeId = val[i].typeId
onearr[j].inventoryQuantity = val[i].inventoryQuantity
onearr[j].actualQuantity = val[i].actualQuantity
onearr[j].enterQuantity = val[i].enterQuantity
onearr[j].taxRate = val[i].taxRate
onearr[j].unit = val[i].unit
onearr[j].totalMoney = val[i].totalMoney
onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
onearr[j].basicQuantity = val[i].basicQuantity
onearr[j].price = val[i].price
onearr[j].productType = val[i].productType
onearr[j].countPerson = val[i].countPerson
onearr[j].countPersonId = val[i].countPersonId
onearr[j].countDate = val[i].countDate
}
}
}
console.log('needarr---======', onearr)
const newarr = Object.assign([], onearr, nowlistdata)
this.list2 = newarr
this.$refs.editable.clear()
console.log('val============', val)
const alldata = [...nowlistdata, ...val]
const filterdata = this.uniqueArray(alldata, 'productCode')
console.log('filterdata=====', filterdata)
// this.list2 = filterdata
for (let i = 0; i < filterdata.length; i++) {
// val[i].quantity = 1
this.$refs.editable.insert(filterdata[i])
}
},
// async productdetail(val) {
// const nowlistdata = this.$refs.editable.getRecords()
// if (nowlistdata.length === 0) {
// const batcharr = await Promise.all(val.map(item => {
// return batchlist(this.personalForm.countRepositoryId, item.productCode)
// }))
// const newbatch = batcharr.map(item => {
// return {
// pcode: item.data.data.pCode,
// batchs: item.data.data.content
// }
// })
// console.log('newbatch---======', newbatch)
// const needarr = newbatch.map(item => {
// const arrned = item.batchs.map(zitem => {
// return {
// productCode: item.pcode,
// batch: zitem
// }
// })
// return arrned
// })
// const onearr = [].concat.apply([], needarr)
// for (const i in val) {
// for (const j in onearr) {
// if (val[i].productCode === onearr[j].productCode) {
// onearr[j].productName = val[i].productName
// onearr[j].color = val[i].color
// onearr[j].locationId = val[i].locationId
// onearr[j].typeId = val[i].typeId
// onearr[j].inventoryQuantity = val[i].inventoryQuantity
// onearr[j].actualQuantity = val[i].actualQuantity
// onearr[j].enterQuantity = val[i].enterQuantity
// onearr[j].taxRate = val[i].taxRate
// onearr[j].unit = val[i].unit
// onearr[j].totalMoney = val[i].totalMoney
// onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
// onearr[j].basicQuantity = val[i].basicQuantity
// onearr[j].price = val[i].price
// onearr[j].productType = val[i].productType
// onearr[j].countPerson = val[i].countPerson
// onearr[j].countPersonId = val[i].countPersonId
// onearr[j].countDate = val[i].countDate
// }
// }
// }
// console.log('needarr---======', onearr)
// this.list2 = onearr
// } else {
// const batcharr = await Promise.all(val.map(item => {
// return batchlist(this.personalForm.countRepositoryId, item.productCode)
// }))
// const newbatch = batcharr.map(item => {
// return {
// pcode: item.data.data.pCode,
// batchs: item.data.data.content
// }
// })
// console.log('newbatch---======', newbatch)
// const needarr = newbatch.map(item => {
// const arrned = item.batchs.map(zitem => {
// return {
// productCode: item.pcode,
// batch: zitem
// }
// })
// return arrned
// })
// const onearr = [].concat.apply([], needarr)
// for (const i in val) {
// for (const j in onearr) {
// if (val[i].productCode === onearr[j].productCode) {
// onearr[j].productName = val[i].productName
// onearr[j].color = val[i].color
// onearr[j].locationId = val[i].locationId
// onearr[j].typeId = val[i].typeId
// onearr[j].inventoryQuantity = val[i].inventoryQuantity
// onearr[j].actualQuantity = val[i].actualQuantity
// onearr[j].enterQuantity = val[i].enterQuantity
// onearr[j].taxRate = val[i].taxRate
// onearr[j].unit = val[i].unit
// onearr[j].totalMoney = val[i].totalMoney
// onearr[j].actualEnterQuantity = val[i].actualEnterQuantity
// onearr[j].basicQuantity = val[i].basicQuantity
// onearr[j].price = val[i].price
// onearr[j].productType = val[i].productType
// onearr[j].countPerson = val[i].countPerson
// onearr[j].countPersonId = val[i].countPersonId
// onearr[j].countDate = val[i].countDate
// }
// }
// }
// console.log('needarr---======', onearr)
// const newarr = Object.assign([], onearr, nowlistdata)
// this.list2 = newarr
// }
// },
//
//
handleEditok() {
@ -687,14 +766,29 @@ export default {
this.personalForm.modifyPersonId = this.$store.getters.userId
console.log(this.personalForm)
const rest = this.$refs.editable.getRecords()
// if (rest.length === 0) {
// this.$notify.error({
// title: 'wrong',
// message: '',
// offset: 100
// })
// return false
// }
if (rest.length === 0) {
this.$notify.error({
title: 'wrong',
message: '明细表不能为空',
offset: 100
})
return false
}
let judgestat = 1
for (const i in rest) {
if (!rest[i].locationId) {
judgestat = 2
}
}
if (judgestat === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
this.saveloading = false
return false
}
rest.map(function(elem) {
return elem
}).forEach(function(elem) {

View file

@ -5,7 +5,8 @@
<el-input v-model="getemplist.code" :placeholder="$t('Product.code')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.productname" :placeholder="$t('Product.productname')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="supplierid" :placeholder="$t('Product.supplierid')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechoose" @clear="clear"/>
<el-input v-model="categoryid" placeholder="物品详细分类" size="small" class="filter-item" clearable @focus="treechoose"/>
<my-tree :treecontrol.sync="treecontrol" @tree="tree"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
<el-popover
v-model="visible2"
@ -587,7 +588,7 @@ export default {
//
tree(val) {
this.categoryid = val.categoryName
this.getemplist.categoryid = val.id
this.getemplist.detailCategoryId = val.id
},
//
handleEdit(row) {

View file

@ -52,17 +52,17 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('ReturnExchange.diffMoney')" prop="diffMoney" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.diffMoney" disabled style="width: 200px" clearable/>
<el-form-item :label="$t('ReturnExchange.diffMoney')" prop="shouldMoney" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.shouldMoney" disabled style="width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.actialdiffermoney')" prop="shouldMoney" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input-number v-model="personalForm.shouldMoney" :controls="false" :step="0.1" style="width: 200px"/>
<el-form-item :label="$t('update4.actialdiffermoney')" prop="diffMoney" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input-number v-model="personalForm.diffMoney" :controls="false" :step="0.1" style="width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOut.invoiceNumber')" prop="invoiceNumber" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-form-item :label="$t('SaleOut.invoiceNumber')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.invoiceNumber" style="width: 200px" @blur="judgeinvoce"/>
</el-form-item>
</el-col>
@ -228,6 +228,7 @@
:precision="6"
:controls="false"
v-model="scope.row.discount"
disable
@change="getdiscountRate(scope.row)"/>
</template>
</el-editable-column>
@ -237,7 +238,8 @@
:precision="6"
:controls="false"
v-model="scope.row.discountMoney"
@change="getdiscountMoney(scope.row)"/>
@change="getdiscountMoney(scope.row, $event, scope)"
@input="notundefined(scope.row)"/>
</template>
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('updates.cjbm')" prop="carCode" align="center" min-width="150" >
@ -273,7 +275,7 @@
<script>
import { createsaleOut, getCustomerOutCount, checkInvoiceExist } from '@/api/SaleOut'
import { searchRoleDiscount } from '@/api/BasicSettings'
import '@/directive/noMoreClick/index.js'
import { addReturnExchange } from '@/api/ReturnExchange'
import { getdeptlist } from '@/api/EmployeeInformation'
@ -380,7 +382,10 @@ export default {
},
//
personalrules: {
shouldMoney: [
invoiceNumber: [
{ required: true, message: 'please input invoiceNumber', trigger: 'blur' }
],
diffMoney: [
{ required: true, message: 'please input actialdiffermoney', trigger: 'blur' }
],
title: [
@ -410,8 +415,8 @@ export default {
customerPhone: [
{ required: true, message: 'please select customerPhone', trigger: 'blur' }
],
diffMoney: [
{ required: true, message: 'please input diffMoney', trigger: 'blur' }
shouldMoney: [
{ required: true, message: 'please input shouldMoney', trigger: 'blur' }
],
repositoryId: [
{ required: true, validator: validatePass4, trigger: 'change' }
@ -440,6 +445,7 @@ export default {
}
console.log('num1', num1)
console.log('num2', num2)
this.personalForm.shouldMoney = (num2 - num1).toFixed(6)
this.personalForm.diffMoney = (num2 - num1).toFixed(6)
},
deep: true,
@ -458,6 +464,7 @@ export default {
console.log('list3', this.list3)
console.log('num1', num1)
console.log('num2', num2)
this.personalForm.shouldMoney = (num2 - num1).toFixed(6)
this.personalForm.diffMoney = (num2 - num1).toFixed(6)
},
deep: true,
@ -583,15 +590,105 @@ export default {
// }
if (re === '01') { return true } else { return false }
},
notundefined(row) {
if (row.discount === undefined) {
this.$set(row, 'discount', 0)
}
if (row.discountMoney === undefined) {
this.$set(row, 'discountMoney', 0)
}
},
//
getdiscountMoney(row) {
getdiscountMoney(row, val, scope) {
console.log(row)
if (row.taxprice !== 0 && row.quantity !== 0 && row.discountMoney !== 0) {
if (row.includeTaxCostMoney !== 0) {
row.discount = (((row.discountMoney / row.includeTaxCostMoney)) * 100).toFixed(6)
} else {
row.discount = 0
// if (row.taxprice !== 0 && row.quantity !== 0 && row.discountMoney !== 0) {
// if (row.includeTaxCostMoney !== 0) {
// row.discount = (((row.discountMoney / row.includeTaxCostMoney)) * 100).toFixed(6)
// } else {
// row.discount = 0
// }
// }
console.log('row', row)
const re = row.productCode.slice(0, 2)
if (re === '01') {
const discountparms = {
typeId: row.type,
roleId: this.$store.getters.roleId,
category: 1,
pageNum: 1,
pageSize: 1
}
searchRoleDiscount(discountparms).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.list.length === 0) {
row.discountMoney = 0
row.discount = 0
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.cgzdzke'),
offset: 100
})
} else {
const isoverdiscount = val / row.quantity
if (res.data.data.content.list[0].discountMoney < isoverdiscount) {
row.discountMoney = 0
row.discount = 0
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.cgzdzke'),
offset: 100
})
} else {
if (row.taxprice !== 0 && row.quantity !== 0 && row.discountMoney !== 0 && row.includeTaxCostMoney !== 0) {
row.discount = (((isoverdiscount / row.includeTaxCostMoney)) * 100).toFixed(6)
} else {
row.discountMoney = 0
row.discount = 0
}
}
}
}
})
} else {
const discountparms = {
roleId: this.$store.getters.roleId,
category: 2,
pageNum: 1,
pageSize: 1
}
searchRoleDiscount(discountparms).then(res => {
if (res.data.ret === 200) {
if (res.data.data.content.list.length === 0) {
row.discountMoney = 0
row.discount = 0
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.cgzdzke'),
offset: 100
})
} else {
const isoverdiscount = res.data.data.content.list[0].discount * row.includeTaxCostMoney
console.log('isoverdiscount', isoverdiscount)
console.log('val', val)
if (isoverdiscount < val) {
row.discountMoney = 0
row.discount = 0
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.cgzdzke'),
offset: 100
})
}
if (row.taxprice !== 0 && row.quantity !== 0 && row.discountMoney !== 0 && row.includeTaxCostMoney !== 0) {
row.discount = (((val / row.includeTaxCostMoney)) * 100).toFixed(6)
} else {
row.discountMoney = 0
row.discount = 0
}
}
}
})
}
},
//

View file

@ -52,6 +52,16 @@
<el-input v-model="personalForm.summary" style="width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.createDate')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-date-picker
v-model="personalForm.createDate"
:picker-options="pickerOptions2"
type="date"
value-format="yyyy-MM-dd"
style="width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
@ -78,6 +88,14 @@ export default {
components: { MyCustomer, MyRepository },
data() {
return {
pickerOptions2: {
disabledDate: (time) => {
const _now = Date.now()
const seven = 30 * 24 * 60 * 60 * 1000
const sevenDays = _now - seven
return time.getTime() > _now || time.getTime() < sevenDays
}
},
saveloding: false,
customercontrol: false,
repositorycontrol: false,
@ -95,7 +113,8 @@ export default {
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
currency: '1',
receiptMoney: 0
receiptMoney: 0,
createDate: null
},
//
personalrules: {
@ -106,14 +125,31 @@ export default {
},
created() {
this.getTypes()
this.getdatatime()
},
activated() {
this.getTypes()
this.getdatatime()
},
beforeCreate() {
_that = this
},
methods: {
getdatatime() { //
var date = new Date()
var seperator1 = '-'
var year = date.getFullYear()
var month = date.getMonth() + 1
var strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
var currentdate = year + seperator1 + month + seperator1 + strDate
this.personalForm.createDate = currentdate
},
chooseCustomer() {
this.customercontrol = true
},
@ -130,22 +166,22 @@ export default {
}
})
},
getdatatime() { //
var date = new Date()
var seperator1 = '-'
var year = date.getFullYear()
var month = date.getMonth() + 1
var strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
var currentdate = year + seperator1 + month + seperator1 + strDate
this.personalForm.transDate = currentdate
this.personalForm.createDate = currentdate
},
// getdatatime() { //
// var date = new Date()
// var seperator1 = '-'
// var year = date.getFullYear()
// var month = date.getMonth() + 1
// var strDate = date.getDate()
// if (month >= 1 && month <= 9) {
// month = '0' + month
// }
// if (strDate >= 0 && strDate <= 9) {
// strDate = '0' + strDate
// }
// var currentdate = year + seperator1 + month + seperator1 + strDate
// this.personalForm.transDate = currentdate
// this.personalForm.createDate = currentdate
// },
repositoryname(val) {
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.id
@ -164,7 +200,8 @@ export default {
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
currency: '1',
receiptMoney: 0
receiptMoney: 0,
createDate: null
}
this.customerId = ''

View file

@ -50,6 +50,16 @@
<el-input v-model="personalForm.summary" style="width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.createDate')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-date-picker
v-model="personalForm.createDate"
:picker-options="pickerOptions2"
type="date"
value-format="yyyy-MM-dd"
style="width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
@ -114,13 +124,16 @@ export default {
}
}
return {
colseTypes: [],
repositorycontrol: false,
pickerOptions2: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
const _now = Date.now()
const seven = 30 * 24 * 60 * 60 * 1000
const sevenDays = _now - seven
return time.getTime() > _now || time.getTime() < sevenDays
}
},
colseTypes: [],
repositorycontrol: false,
rate: 1,
//
choosedata: [],

View file

@ -87,7 +87,7 @@
<el-form-item :label="$t('SaleOut.sendDate')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-date-picker
v-model="personalForm.sendDate"
:picker-options="pickerOptions1"
:picker-options="pickerOptions2"
type="date"
value-format="yyyy-MM-dd"
style="width: 200px"/>
@ -1005,6 +1005,7 @@ export default {
changeisdeduct() {
if (this.isdeduct === 2) {
this.personalForm.advanceMoney = 0
this.getReceivableMoney()
} else {
if (!this.personalForm.customerId) {
this.$notify.error({
@ -1021,7 +1022,6 @@ export default {
}
})
}
this.getReceivableMoney()
},
//
getinformationcopy() {
@ -1339,7 +1339,7 @@ export default {
}
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') {
console.log('1')
console.log('this.personalForm.personalForm', this.personalForm.personalForm)
let needmoney = (Number(this.heji3) - Number(this.heji4) - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney)) + Number(this.personalForm.otherMoney)
const needmoney2 = (Number(this.heji3) - Number(this.heji4) - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.advanceMoney)) + Number(this.personalForm.otherMoney)
if (needmoney < 0) {

View file

@ -718,7 +718,9 @@ export default {
formatter(row, column) {
if (row.discountRate === 1) {
return 100
} else {
} else if (row.discountRate > 1) {
return row.discountRate
} else if (row.discountRate < 1) {
return row.discountRate * 100
}
},

View file

@ -86,7 +86,7 @@
<el-form-item :label="$t('SaleOut.sendDate')" prop="sendDate" style="width: 100%;">
<el-date-picker
v-model="personalForm.sendDate"
:picker-options="pickerOptions1"
:picker-options="pickerOptions2"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/>
@ -634,8 +634,8 @@
</el-card>
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
<el-button type="primary" @click="handleEditok()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button :loading="saveloding" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
<el-button :loading="saveloding" type="primary" @click="handleEditok()">{{ $t('Hmodule.baoc') }}</el-button>
</div>
</el-card>
</el-dialog>
@ -762,6 +762,7 @@ export default {
}
}
return {
saveloding: false,
packagerepository: '',
materialcontrol: false,
personalForm2: {
@ -2527,6 +2528,7 @@ export default {
//
//
async handleEditok() {
this.saveloding = true
const controlcategorys = await batteryList2(8).then(res => {
return res.data.data.content
})
@ -2539,413 +2541,431 @@ export default {
const chargecategorysdetail = chargecategorys.map(item => {
return item.id
})
setTimeout(() => {
// const EnterDetailgift = this.deepClone(this.$refs.editable2.getRecords())
const EnterDetail2 = this.deepClone(this.$refs.editable2.getRecords())
console.log('EnterDetail2', EnterDetail2)
//
let j = 1
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
const EnterDetail2 = this.deepClone(this.$refs.editable2.getRecords())
console.log('EnterDetail2', EnterDetail2)
//
let j = 1
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
// if (elem.batch === null || elem.batch === undefined || elem.batch === '' || elem.location === null || elem.location === undefined || elem.location === '') {
// j = 2
// }
if (elem.location === null || elem.location === undefined || elem.location === '') {
j = 2
}
})
console.log(j)
if (j === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
if (elem.location === null || elem.location === undefined || elem.location === '') {
j = 2
}
})
return false
}
console.log(j)
if (j === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
this.saveloding = false
return false
}
delete this.personalForm.saleOutRetreatVos
delete this.personalForm.saleOutDetailVos
delete this.personalForm.approvalUseVos
delete this.personalForm.saleOutGiftVos
delete this.personalForm.judgeStat
delete this.personalForm.receiptStat
delete this.personalForm.isDeliver
delete this.personalForm.payType
delete this.personalForm.currency
delete this.personalForm.saleOutRetreatVos
delete this.personalForm.saleOutDetailVos
delete this.personalForm.approvalUseVos
delete this.personalForm.saleOutGiftVos
delete this.personalForm.judgeStat
delete this.personalForm.receiptStat
delete this.personalForm.isDeliver
delete this.personalForm.payType
delete this.personalForm.currency
this.$refs.personalForm.validate((valid) => {
if (valid) {
if (this.personalForm.sourceType === '5') {
if (this.personalForm.saleType === '2') {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.ckslcgpcsl'),
offset: 100
})
return false
}
}
if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
this.personalForm.couponSupportOld = 0
}
this.personalForm.repositoryId = this.$store.getters.repositoryId
this.personalForm.regionId = this.$store.getters.regionId
this.personalForm.createPersonId = this.$store.getters.userId
this.personalForm.countryId = this.$store.getters.countryId
this.personalForm.modifyPersonId = this.$store.getters.userId
const EnterDetail = this.$refs.editable.getRecords()
//
let m = 1
//
let m3 = 1
const m4 = this.personalForm.isFree
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
const re = elem.productCode.slice(0, 2)
if (re === '01') {
if (m4 === 1) {
m3 = 2
}
if (elem.carCode === null || elem.carCode === undefined || elem.carCode === '' || elem.motorCode === null || elem.motorCode === undefined || elem.motorCode === '') {
m = 2
this.$refs.personalForm.validate((valid) => {
if (valid) {
if (this.personalForm.sourceType === '5') {
if (this.personalForm.saleType === '2') {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.ckslcgpcsl'),
offset: 100
})
this.saveloding = false
return false
}
}
if (re === '05') {
if (elem.batteryCode === null || elem.batteryCode === undefined || elem.batteryCode === '') {
m = 3
}
if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
this.personalForm.couponSupportOld = 0
}
if (controlcategorysdetail.includes(elem.category) && (elem.controlCode === null || elem.controlCode === undefined || elem.controlCode === '')) {
m = 4
}
if (chargecategorysdetail.includes(elem.category) && (elem.chargeCode === null || elem.chargeCode === undefined || elem.chargeCode === '')) {
m = 5
}
})
if (m === 5) {
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.cdqbmwtx'),
offset: 100
})
return false
}
if (m === 4) {
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.kzqbmwtx'),
offset: 100
})
return false
}
if (m === 3) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.dcckytbm'),
offset: 100
})
return false
}
if (m === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.zcckytbm'),
offset: 100
})
return false
}
if (m3 === 2) {
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) {
const re = elem2.productCode.slice(0, 2)
//
if (re !== '01') {
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) {
return elem
}).forEach(function(elem) {
// if (elem.batch === null || elem.batch === undefined || elem.batch === '' || elem.location === null || elem.location === undefined || elem.location === '') {
// j = 2
// }
if (elem.location === null || elem.location === undefined || elem.location === '') {
j = 2
}
})
console.log(j)
if (j === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
return false
}
if (EnterDetail.length === 0) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.mxbbnwk'),
offset: 100
})
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.batch === '不使用') {
delete elem.batch
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate
}
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
return elem
})
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
return elem
})
const parms3 = JSON.stringify(EnterDetail2)
let couponNumbers = ''
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
}
}
console.log('couponNumbers', couponNumbers)
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
console.log('couponNumbers', couponNumbers)
this.personalForm.couponNumbers = couponNumbers
if (this.personalForm.shouldMoney === '' || this.personalForm.shouldMoney === undefined || this.personalForm.shouldMoney === null) {
this.$notify.error({
title: 'wrong',
message: '本次收款金额不能为空',
offset: 100
})
return false
}
if (Number(this.personalForm.shouldMoney) !== 0 && Number(this.personalForm.customerPay) === 0 && this.$store.getters.countryId === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.qsrshijshk'),
offset: 100
})
return false
}
console.log('Number(this.personalForm.shouldMoney)', Number(this.personalForm.shouldMoney))
console.log('Number(this.personalForm.customerPay)', Number(this.personalForm.receivableMoney))
if (Number(this.personalForm.shouldMoney) !== Number(this.personalForm.receivableMoney) && this.$store.getters.countryId === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.bcskyw'),
offset: 100
})
return false
}
// eslint-disable-next-line use-isnan
if (this.personalForm.customerPay === '' || this.personalForm.customerPay === undefined || this.personalForm.customerPay === NaN || this.personalForm.customerPay === null) {
this.$notify.error({
title: 'wrong',
message: '实际收到客户金额不能为空',
offset: 100
})
return false
}
if (this.personalForm.isFree === 1) {
console.log('進入了2')
this.personalForm.taxMoney = 0
this.personalForm.includeTaxMoney = 0
this.personalForm.money = 0
this.personalForm.shouldMoney = 0
this.personalForm.discount_money = 0
this.personalForm.actualMoney = 0
this.personalForm.repositoryId = this.$store.getters.repositoryId
this.personalForm.regionId = this.$store.getters.regionId
this.personalForm.createPersonId = this.$store.getters.userId
this.personalForm.countryId = this.$store.getters.countryId
this.personalForm.modifyPersonId = this.$store.getters.userId
const EnterDetail = this.$refs.editable.getRecords()
//
let m = 1
//
let m3 = 1
const m4 = this.personalForm.isFree
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
elem.money = 0
elem.taxprice = 0
elem.includeTaxMoney = 0
elem.includeTaxCostMoney = 0
elem.salePrice = 0
const re = elem.productCode.slice(0, 2)
if (re === '01') {
if (m4 === 1) {
m3 = 2
}
if (elem.carCode === null || elem.carCode === undefined || elem.carCode === '' || elem.motorCode === null || elem.motorCode === undefined || elem.motorCode === '') {
m = 2
}
}
if (re === '05') {
if (elem.batteryCode === null || elem.batteryCode === undefined || elem.batteryCode === '') {
m = 3
}
}
if (controlcategorysdetail.includes(elem.category) && (elem.controlCode === null || elem.controlCode === undefined || elem.controlCode === '')) {
m = 4
}
if (chargecategorysdetail.includes(elem.category) && (elem.chargeCode === null || elem.chargeCode === undefined || elem.chargeCode === '')) {
m = 5
}
})
}
const parms2 = JSON.stringify(EnterDetail)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
if (key === 'judgeStat') {
delete Data[key]
}
}
const parms = JSON.stringify(Data)
console.log('parms3', parms3)
updatesaleOut(parms, parms2, parms3, this.personalForm.receivableMoney2).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: this.$t('prompt.czcg'),
message: this.$t('prompt.czcg'),
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.editVisible = false
} else {
if (m === 5) {
this.$notify.error({
title: 'wrong',
message: 'wrong',
message: this.$t('tongyo.cdqbmwtx'),
offset: 100
})
this.saveloding = false
return false
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
return false
}
})
if (m === 4) {
this.$notify.error({
title: 'wrong',
message: this.$t('tongyo.kzqbmwtx'),
offset: 100
})
this.saveloding = false
return false
}
if (m === 3) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.dcckytbm'),
offset: 100
})
this.saveloding = false
return false
}
if (m === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.zcckytbm'),
offset: 100
})
this.saveloding = false
return false
}
if (m3 === 2) {
this.$notify.error({
title: 'wrong',
message: '整车不能算作质保',
offset: 100
})
this.saveloding = false
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) {
const re = elem2.productCode.slice(0, 2)
//
if (re !== '01') {
i++
}
}
})
})
console.log(i)
if (i > EnterDetail.length) {
this.$notify.error({
title: 'wrong',
message: '同样商品不能有同一个批次',
offset: 100
})
this.saveloding = false
return false
}
//
let j = 1
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
// if (elem.batch === null || elem.batch === undefined || elem.batch === '' || elem.location === null || elem.location === undefined || elem.location === '') {
// j = 2
// }
if (elem.location === null || elem.location === undefined || elem.location === '') {
j = 2
}
})
console.log(j)
if (j === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
this.saveloding = false
return false
}
if (EnterDetail.length === 0) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.mxbbnwk'),
offset: 100
})
this.saveloding = false
return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.batch === '不使用') {
delete elem.batch
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate
}
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
return elem
})
EnterDetail2.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.batch === null || elem.batch === '' || elem.batch === undefined) {
delete elem.batch
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
return elem
})
const parms3 = JSON.stringify(EnterDetail2)
let couponNumbers = ''
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
}
}
console.log('couponNumbers', couponNumbers)
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
console.log('couponNumbers', couponNumbers)
this.personalForm.couponNumbers = couponNumbers
if (this.personalForm.shouldMoney === '' || this.personalForm.shouldMoney === undefined || this.personalForm.shouldMoney === null) {
this.$notify.error({
title: 'wrong',
message: '本次收款金额不能为空',
offset: 100
})
this.saveloding = false
return false
}
if (Number(this.personalForm.shouldMoney) !== 0 && Number(this.personalForm.customerPay) === 0 && this.$store.getters.countryId === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.qsrshijshk'),
offset: 100
})
this.saveloding = false
return false
}
console.log('Number(this.personalForm.shouldMoney)', Number(this.personalForm.shouldMoney))
console.log('Number(this.personalForm.customerPay)', Number(this.personalForm.receivableMoney))
if (Number(this.personalForm.shouldMoney) !== Number(this.personalForm.receivableMoney) && this.$store.getters.countryId === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.bcskyw'),
offset: 100
})
this.saveloding = false
return false
}
// eslint-disable-next-line use-isnan
if (this.personalForm.customerPay === '' || this.personalForm.customerPay === undefined || this.personalForm.customerPay === NaN || this.personalForm.customerPay === null) {
this.$notify.error({
title: 'wrong',
message: '实际收到客户金额不能为空',
offset: 100
})
this.saveloding = false
return false
}
if (this.personalForm.isFree === 1) {
console.log('進入了2')
this.personalForm.taxMoney = 0
this.personalForm.includeTaxMoney = 0
this.personalForm.money = 0
this.personalForm.shouldMoney = 0
this.personalForm.discount_money = 0
this.personalForm.actualMoney = 0
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
elem.money = 0
elem.taxprice = 0
elem.includeTaxMoney = 0
elem.includeTaxCostMoney = 0
elem.salePrice = 0
})
}
const parms2 = JSON.stringify(EnterDetail)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
if (key === 'judgeStat') {
delete Data[key]
}
}
const parms = JSON.stringify(Data)
console.log('parms3', parms3)
updatesaleOut(parms, parms2, parms3, this.personalForm.receivableMoney2).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: this.$t('prompt.czcg'),
message: this.$t('prompt.czcg'),
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.editVisible = false
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
this.saveloding = false
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.saveloding = false
return false
}
})
}, 1000 * 0.5)
},
handlecancel() {
// this.$refs.editable.clear()
@ -2955,6 +2975,7 @@ export default {
// this.$refs.personalForm2.clearValidate()
// this.$refs.personalForm2.resetFields()
this.editVisible = false
this.saveloding = false
}
// -------------------------------------------------
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -81,7 +81,23 @@
<el-table-column :reserve-selection="true" type="selection" min-width="55" align="center" />
<el-table-column :label="$t('Stockenter.id')" :resizable="false" fixed="left" prop="id" align="center" width="150">
<template slot-scope="scope">
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.id }}</span>
<el-popover
placement="right"
width="720"
trigger="hover">
<el-table :data="scope.row.stockEnterDetailVos" border size="small">
<el-table-column :label="$t('Hmodule.wpbh')" min-width="200" property="productCode"/>
<el-table-column :label="$t('Hmodule.wpmc')" min-width="200" property="productName"/>
<el-table-column :label="$t('updates.dhsl')" min-width="100" property="arrivalQuantity"/>
<el-table-column :label="$t('Hmodule.gg')" min-width="100" property="productType"/>
<!-- <el-table-column :label="$t('updates.jhrq')" min-width="200" property="deliveryDate"/> -->
<el-table-column :label="$t('updates.ys')" min-width="100" property="color"/>
<el-table-column :label="$t('Hmodule.dw')" min-width="100" property="unit"/>
</el-table>
<div slot="reference" class="name-wrapper">
<el-tag size="small">{{ scope.row.enterNumber }}</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column :label="$t('Stockenter.title')" :resizable="false" fixed="left" prop="title" align="center" width="150">
@ -89,11 +105,11 @@
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Stockenter.enterNumber')" :resizable="false" prop="sourceNumber" align="center" width="150">
<!-- <el-table-column :label="$t('Stockenter.enterNumber')" :resizable="false" prop="sourceNumber" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.enterNumber }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column :label="$t('Stockenter.deliveryPersonId')" :resizable="false" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.deliveryPersonName }}</span>

View file

@ -419,7 +419,7 @@ export default {
}
this.heji1 = num
this.heji2 = num2
this.allTaxMoney = num4
this.allTaxMoney = (num4).toFixed(2)
this.allIncludeTaxMoney = num3
this.allDiscountMoney = num5
this.allMoneyMoveDiscount = num3 - num5

View file

@ -412,7 +412,6 @@ export default {
row.newPrice = row.newIncludeTaxPrice
} else {
row.newPrice = row.newIncludeTaxPrice / (1 + row.newTaxRate / 100)
}
// if (row.taxPriceFlag === 1) {
// row.newPrice = row.newIncludeTaxPrice / (1 + row.newTaxRate / 100)

View file

@ -672,7 +672,7 @@ export default {
const subjectdata = [1, 2, 9, 43, 236]
this.$refs.editable.insertAt({ subjectFinance: subjectdata }, index)
} else {
this.$refs.editable.insertAt({ }, index)
this.$refs.editable.insertAt({}, index)
}
}
},

View file

@ -619,6 +619,8 @@ export default {
} else if (needata.includes(90)) {
const subjectdata = [1, 2, 9, 43, 236]
this.$refs.editable.insertAt({ subjectFinance: subjectdata }, index)
} else {
this.$refs.editable.insertAt({}, index)
}
}
},

View file

@ -15,7 +15,7 @@
<el-form-item :label="$t('income.incomeDate')" prop="incomeDate" style="width: 100%;">
<el-date-picker
v-model="personalForm.incomeDate"
:picker-options="pickerOptions1"
:picker-options="pickerOptions2"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px;width: 200px"/>
@ -180,6 +180,14 @@ export default {
return time.getTime() < new Date().getTime() - 8.64e7
}
},
pickerOptions2: {
disabledDate: (time) => {
const _now = Date.now()
const seven = 30 * 24 * 60 * 60 * 1000
const sevenDays = _now - seven
return time.getTime() > _now || time.getTime() < sevenDays
}
},
//
props: {
value: 'id',

View file

@ -229,7 +229,7 @@ export default {
},
//
handleFilter() {
if (!this.date && this.date.length !== 0) {
if (this.date && this.date.length !== 0) {
this.getemplist.beginTime = this.date[0] + ' 00:00:00'
this.getemplist.endTime = this.date[1] + ' 23:59:59'
}