4.21 修改采购订单问题若干

This commit is contained in:
tczjx58520 2020-04-21 15:41:31 +08:00
parent de85006a26
commit fb39fc5240
13 changed files with 763 additions and 72 deletions

View file

@ -58,6 +58,9 @@ export function stockenterlist(query) {
if (query.supplierId !== '' && query.supplierId !== null && query.supplierId !== undefined) {
params.append('supplierId', query.supplierId) // 你要传给后台的参数值 key/value
}
if (query.isActive !== '' && query.isActive !== null && query.isActive !== undefined) {
params.append('isActive', query.isActive) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pagenum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pagesize) // 你要传给后台的参数值 key/value
return request({

View file

@ -1969,6 +1969,7 @@ export default {
workCenterId: 'production center'
},
CheckReport: {
color: 'color',
checkItemId: 'inspection items',
checkContent: 'inspection standards',
checkTools: 'inspection tools',

View file

@ -1975,6 +1975,7 @@ export default {
workCenterId: '生产中心'
},
CheckReport: {
color: '颜色',
checkItemId: '检验项目',
checkContent: '检验指标',
checkTools: '检验工具',

View file

@ -1126,14 +1126,15 @@ export default {
checkMode: '1',
checkType: '1',
checkDate: null,
checkResult: '1'
checkResult: '1',
checkPersonId: this.$store.getters.userId
}
this.judgequilty = null
this.inspectionPersonId = this.$store.getters.name
this.supplierId = null
this.workCenterId = null
this.produceManagerId = null
this.checkPersonId = null
this.checkPersonId = this.$store.getters.name
this.getdatatime()
},
//

View file

@ -103,6 +103,11 @@
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('CheckReport.color')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('CheckReport.supplierId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.supplierName }}</span>

View file

@ -132,6 +132,7 @@
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
show-summary
stripe
border
size="small"
@ -162,6 +163,31 @@
</el-editable>
</div>
</el-card>
<!-- 合计信息 -->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never" style="margin-top: 5px;margin-bottom: 20px">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('updates.hjxx') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.heji1')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allNumber" style="width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('updates.sehj')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allTaxMoney" style="width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('updates.hsjehj')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allIncludeTaxMoney" style="width: 200px" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--操作-->
<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" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
@ -394,6 +420,7 @@ export default {
val.row.costCategory = this.costs[i].costCategory
val.row.subject = this.costs[i].subjectId
val.row.subjectName = this.costs[i].subjectName
val.row.unit = this.costs[i].unit
}
}
},
@ -507,17 +534,12 @@ export default {
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = ''
sums[10] = ''
sums[15] = ''
sums[18] = ''
sums[19] = ''
this.allNumber = sums[7]
sums[12] = ''
sums[13] = ''
this.allNumber = sums[6]
this.allMoney = sums[12]
this.allTaxMoney = sums[14]
this.allIncludeTaxMoney = sums[13]
this.allDiscountMoney = sums[16]
this.allMoneyMoveDiscount = sums[13] - sums[16]
this.allTaxMoney = sums[9]
this.allIncludeTaxMoney = sums[8]
return sums
},
getdiscountMoney(row) {

View file

@ -132,6 +132,7 @@
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
show-summary
stripe
border
size="small"
@ -160,6 +161,31 @@
</el-editable>
</div>
</el-card>
<!-- 合计信息 -->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never" style="margin-top: 5px;margin-bottom: 20px">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('updates.hjxx') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.heji1')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allNumber" style="width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('updates.sehj')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allTaxMoney" style="width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('updates.hsjehj')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="allIncludeTaxMoney" style="width: 200px" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</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>
@ -356,6 +382,7 @@ export default {
val.row.costCode = this.costs[i].costCode
val.row.subject = this.costs[i].subjectId
val.row.subjectName = this.costs[i].subjectName
val.row.unit = this.costs[i].unit
}
}
},
@ -396,17 +423,12 @@ export default {
sums[3] = ''
sums[4] = ''
sums[5] = ''
sums[6] = ''
sums[10] = ''
sums[15] = ''
sums[18] = ''
sums[19] = ''
this.allNumber = sums[7]
sums[12] = ''
sums[13] = ''
this.allNumber = sums[6]
this.allMoney = sums[12]
this.allTaxMoney = sums[14]
this.allIncludeTaxMoney = sums[13]
this.allDiscountMoney = sums[16]
this.allMoneyMoveDiscount = sums[13] - sums[16]
this.allTaxMoney = sums[9]
this.allIncludeTaxMoney = sums[8]
return sums
},
getdiscountMoney(row) {

View file

@ -132,7 +132,7 @@
<h2 ref="fuzhu" class="form-name" >红字采购发票明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button style="width: 130px" @click="handleAddSouce">{{ $t('updates.cydzxz') }}</el-button>
<my-enter :entercontrol.sync="entercontrol" :supp.sync="supp" @enter="enter" @enterinfo="enterinfo"/>
<my-invoice :entercontrol.sync="entercontrol" :supp.sync="supp" @enter="enter" @enterinfo="enterinfo"/>
<!-- <el-button :disabled="addpro" @click="handleAddproduct">{{ $t('Hmodule.tjsp') }}</el-button>-->
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
@ -312,11 +312,12 @@ import MyLnquiry from './components/MyLnquiry'
import MyOrder from './components/MyOrder'
import MyArrival from './components/MyArrival'
import MyEnter from './components/MyEnter'
import MyInvoice from './components/MyInvoice'
import MyRepository from './components/MyRepository'
var _that
export default {
name: 'AddStockInvoice',
components: { MyRepository, MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp, MyEnter },
components: { MyRepository, MyArrival, MyOrder, MyLnquiry, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp, MyEnter, MyInvoice },
data() {
const validatePass = (rule, value, callback) => {
console.log(this.handlePersonId)

View file

@ -131,7 +131,7 @@
</el-form>
</div>
</el-card>
<!--子件信息-->
<!--子件信息123-->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never" style="margin-top: 5px">
<div ref="fuzhu" class="form-name" >{{ $t('updates.cgfpmx') }}</div>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">

View file

@ -55,7 +55,8 @@
align="center"/>
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" min-width="150">
<template slot-scope="scope">
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.number }}</span>
<span v-if="scope.row.judgeStat === 0" class="link-type" @click="handleEdit(scope.row)">{{ scope.row.number }}</span>
<span v-else class="link-type" @click="handleDetail(scope.row)">{{ scope.row.number }}</span>
</template>
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
</el-table-column>

View file

@ -267,6 +267,7 @@
<div class="buttons" style="margin-top: 20px;margin-left: 30px">
<el-button type="primary" @click="handleEditok()">{{ $t('public.edit') }}</el-button>
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
<el-button type="info" @click="handleReview()">{{ $t('prompt.sh') }}</el-button>
</div>
</el-card>
</el-dialog>
@ -278,6 +279,7 @@ import { updatestockinvoice } from '@/api/StockInvoice'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import { searchCategory } from '@/api/Supplier'
import { updatestockinvoice2 } from '@/api/StockInvoice'
import MyEmp from './MyEmp'
import MyDetail from './MyDetail'
import MySupplier from './MySupplier'
@ -434,7 +436,12 @@ export default {
receiptVisible2: false,
list111: [],
//
moreaction: []
moreaction: [],
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
}
}
},
watch: {
@ -456,6 +463,69 @@ export default {
_that = this
},
methods: {
//
handleReview() {
this.reviewParms = {}
this.reviewParms.id = this.personalForm.id
this.reviewParms.judgePersonId = this.$store.getters.userId
this.$confirm(this.$t('prompt.qsh'), this.$t('prompt.sh'), {
distinguishCancelAndClose: true,
confirmButtonText: this.$t('prompt.tg'),
cancelButtonText: this.$t('prompt.btg'),
type: 'warning'
}).then(() => {
this.reviewParms.judgeStat = 2
const parms = JSON.stringify(this.reviewParms)
updatestockinvoice2(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: this.$t('prompt.shcg')
})
this.$emit('rest', true)
this.editVisible = false
}
})
}).catch(action => {
if (action === 'cancel') {
//
this.$confirm('是否确认审核不通过?', 'Warning', {
distinguishCancelAndClose: true,
confirmButtonText: '确认',
cancelButtonText: '取消'
})
.then(() => {
this.reviewParms.judgeStat = 3
const parms = JSON.stringify(this.reviewParms)
updatestockinvoice2(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: this.$t('prompt.shcg')
})
this.$emit('rest', true)
this.editVisible = false
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
})
})
.catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '确认取消'
: '停留在当前页面'
})
})
// ================
}
})
},
//
change() {
this.$forceUpdate()

View file

@ -75,47 +75,58 @@
style="width: 100%;"
@current-change="handleCurrentChange"
@selection-change="handleSelectionChange">
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" min-width="150">
<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">{{ scope.row.number }}</span>
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.sourceType')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.title')" :resizable="false" fixed="left" prop="title" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.invoiceNumber')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.enterNumber')" :resizable="false" prop="sourceNumber" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.invoiceNumber }}</span>
<span>{{ scope.row.enterNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.supplierId')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.deliveryPersonId')" :resizable="false" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.supplierName }}</span>
<span>{{ scope.row.deliveryPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.isRed')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.acceptPersonId')" :resizable="false" prop="acceptPersonName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.isRed | isRedFilter }}</span>
<span>{{ scope.row.acceptPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.createDate')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.enterDeptId')" :resizable="false" prop="deliveryPersonName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createDate }}</span>
<span>{{ scope.row.deliveryPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.payDate')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.endPersonName')" :resizable="false" prop="endPersonName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.payDate }}</span>
<span>{{ scope.row.enterPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.endDate')" :resizable="false" prop="endDate" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.enterDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Stockenter.summary')" :resizable="false" prop="stockEnterDetails" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.summary }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Stockenter.judgeStat')" :resizable="false" prop="judgeStat" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('Stockenter.receiptStat')" :resizable="false" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
</template>
@ -132,7 +143,6 @@
<script>
import { stockenterlist } from '@/api/Stockenter'
import { getdeptlist } from '@/api/BasicSettings'
import { stockInvoiceList } from '@/api/StockInvoice'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import MyRepository from './MyRepository'
@ -171,16 +181,9 @@ export default {
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.cgdhd'),
2: _that.$t('Hmodule.Nosource'),
3: _that.$t('updates.cgrkd')
}
return statusMap[status]
},
isRedFilter(status) {
const statusMap = {
1: '否',
2: '是'
1: _that.$t('updates.cgsq'),
2: _that.$t('updates.cgxq'),
3: _that.$t('Hmodule.Nosource')
}
return statusMap[status]
}
@ -246,10 +249,12 @@ export default {
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
pagenum: 1,
pagesize: 10,
judgeStat: 2,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionIds,
isActive: 1,
supplierId: this.supp
},
visible2: {},
@ -359,23 +364,23 @@ export default {
getlist() {
//
this.listLoading = true
stockInvoiceList(this.getemplist).then(res => {
stockenterlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
// for (let i = 0; i < this.list.length; i++) {
// for (let j = 0; j < this.list[i].stockEnterDetailVos.length; j++) {
// if (this.list[i].stockEnterDetailVos[j].invoiceQuantity === this.list[i].stockEnterDetailVos[j].actualEnterQuantity) {
// this.list[i].stockEnterDetailVos.splice(j, 1)
// j--
// }
// }
// }
// for (let i = 0; i < this.list.length; i++) {
// if (this.list[i].stockEnterDetailVos.length === 0) {
// this.list.splice(i, 1)
// i--
// }
// }
for (let i = 0; i < this.list.length; i++) {
for (let j = 0; j < this.list[i].stockEnterDetailVos.length; j++) {
if (this.list[i].stockEnterDetailVos[j].invoiceQuantity === this.list[i].stockEnterDetailVos[j].actualEnterQuantity) {
this.list[i].stockEnterDetailVos.splice(j, 1)
j--
}
}
}
for (let i = 0; i < this.list.length; i++) {
if (this.list[i].stockEnterDetailVos.length === 0) {
this.list.splice(i, 1)
i--
}
}
this.total = res.data.data.content.totalCount
this.memoryChecked()
}
@ -457,7 +462,82 @@ export default {
//
async handleConfirm() {
this.employeeVisible = false
this.$emit('enterinfo', this.choosedata)
console.log(this.choosedata)
// const enterdata = this.choosedata.stockEnterDetailVos
// const number = this.choosedata.enterNumber
const enterdata = []
for (const i in this.moreaction) {
for (let j = 0; j < this.moreaction[i].stockEnterDetailVos.length; j++) {
this.moreaction[i].stockEnterDetailVos[j].sourceNumber = this.moreaction[i].enterNumber
enterdata.push(this.moreaction[i].stockEnterDetailVos[j])
}
// this.moreaction[i].stockEnterDetailVos.sourceNumber = this.moreaction[i].enterNumber
// enterdata.push(this.moreaction[i].stockEnterDetailVos)
}
const enterDetail = enterdata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productType: item.productType,
typeName: item.productType,
typeId: item.typeId,
unit: item.unit,
color: item.color,
arrivalQuantity: item.arrivalQuantity,
retreatQuantity: 0,
retreatReason: '',
sourceNumber: item.sourceNumber,
sourceSerialNumber: item.id,
remark: item.remark,
quantity: item.actualEnterQuantity,
quantity2: item.actualEnterQuantity,
price: item.enterPrice,
includeTaxPrice: (item.enterPrice * (1 + item.taxRate)).toFixed(2),
taxRate: item.taxRate,
money: item.money,
includeTaxMoney: item.includeTaxMoney,
taxMoney: item.taxMoney,
discountMoney: 0.0,
discountRate: 0.0,
orderNumber: item.orderNumber,
actualEnterQuantity: item.actualEnterQuantity,
invoiceQuantity: item.invoiceQuantity
}
})
console.log('enterDetail==============================>', enterDetail)
for (let i = 0; i < enterDetail.length; i++) {
for (let j = 0; j < this.checklistprop.length; j++) {
if (enterDetail[i].sourceNumber === this.checklistprop[j]) {
console.log('i======================>', enterDetail[i].sourceNumber)
// enterDetail.splice(i, 1)
// i--
}
}
}
const myenterDetail = enterDetail
const obj = {}
const processaction = this.moreaction.reduce((cur, next) => {
obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
return cur
}, [])
console.log('processaction', processaction)
const cancelid = []
console.log('添加标志=====================>', this.flagarr)
// checklistpropflagarrmoreaction
this.checklistprop.forEach(item => {
console.log(item)
var index = processaction.findIndex(myindex => myindex.enterNumber === item)
console.log('index', index)
console.log(this.flagarr.includes(item), !processaction.includes(item))
if (this.flagarr.includes(item) && index) {
cancelid.push(item)
}
})
console.log('取消的id', cancelid)
console.log(myenterDetail)
this.$store.dispatch('getmyflagApproval', cancelid)
this.$emit('enter', myenterDetail)
this.$emit('enterinfo', this.moreaction)
}
//
}

View file

@ -0,0 +1,484 @@
<template>
<el-dialog :visible.sync="employeeVisible" :entercontrol="entercontrol" :supp="supp" :close-on-press-escape="false" top="10px" title="选择采购入库单" append-to-body width="1100px" @close="$emit('update:entercontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.title" :placeholder="$t('Stockenter.title')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.enterNumber" :placeholder="$t('Stockenter.enterNumber')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-input v-model="deliveryPersonId" :placeholder="$t('Stockenter.deliveryPersonId')" clearable @keyup.enter.native="handleFilter" @focus="handlechooseDelivery" @clear="restFilter2"/>
</el-form-item>
<my-delivery :deliverycontrol.sync="deliverycontrol" @deliveryName="deliveryName"/>
</el-col>
<!--更多搜索条件-->
<!-- <el-col :span="3" style="margin-left: 30px">-->
<!-- <el-popover-->
<!-- v-model="visible2"-->
<!-- placement="bottom"-->
<!-- width="500"-->
<!-- trigger="click">-->
<!-- <el-select v-model="getemplist.enterDeptId" placeholder="请选择入库部门" clearable style="width: 40%;float: left;margin-left: 20px">-->
<!-- <el-option-->
<!-- v-for="(item, index) in depts"-->
<!-- :key="index"-->
<!-- :value="item.id"-->
<!-- :label="item.deptName"/>-->
<!-- </el-select>-->
<!-- <el-input v-model="enterRepositoryId" placeholder="请选择入库仓库" class="filter-item" clearable style="width: 40%;float: left;margin-left: 20px" @keyup.enter.native="handleFilter" @focus="handlechooseRep"/>-->
<!-- <my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>-->
<!-- <el-input v-model="acceptPersonId" :placeholder="$t('Stockenter.acceptPersonId')" class="filter-item" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" @keyup.enter.native="handleFilter" @focus="handlechooseAccept"/>-->
<!-- <el-date-picker-->
<!-- v-model="date"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- unlink-panels-->
<!-- start-placeholder="Start"-->
<!-- end-placeholder="End"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- style="margin-top: 20px;margin-left: 20px"/>-->
<!-- <div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">-->
<!-- <el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>-->
<!-- </div>-->
<!-- <el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>-->
<!-- </el-popover>-->
<!-- </el-col>-->
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始1.13 -->
<el-table
v-loading="listLoading"
ref="multipleTable"
:key="tableKey"
:data="list"
:row-key="getRowKeys"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange"
@selection-change="handleSelectionChange">
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" min-width="150">
<template slot-scope="scope">
<span class="link-type">{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.sourceType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.invoiceNumber')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.invoiceNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.supplierId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.supplierName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.isRed')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.isRed | isRedFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.createDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.createDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('StockInvoice.payDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.payDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">{{ $t('Hmodule.sure') }}</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { stockenterlist } from '@/api/Stockenter'
import { getdeptlist } from '@/api/BasicSettings'
import { stockInvoiceList } from '@/api/StockInvoice'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import MyRepository from './MyRepository'
import MySupplier from './MySupplier'
import MyEmp from './MyEmp'
import MyDelivery from './MyDelivery'
import MyDetail from './MyDetail'
import DetailList from './DetailList'
var _that
export default {
directives: { waves },
components: { DetailList, Pagination, MyRepository, MySupplier, MyEmp, MyDelivery, MyDetail },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: _that.$t('updates.wsh'),
1: _that.$t('updates.shz'),
2: _that.$t('Hmodule.shtg'),
3: _that.$t('Hmodule.shbtg')
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.cgdhd'),
2: _that.$t('Hmodule.Nosource'),
3: _that.$t('updates.cgrkd')
}
return statusMap[status]
},
isRedFilter(status) {
const statusMap = {
1: '否',
2: '是'
}
return statusMap[status]
}
},
props: {
entercontrol: {
type: Boolean,
default: false
},
supp: {
type: Number,
default: null
},
checklist: {
type: Array,
default() {
return []
}
}
},
data() {
return {
// rowkey
getRowKeys(row) {
return row.id
},
//
employeeVisible: this.entercontrol,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
enterRepositoryId: '',
//
repositorycontrol: false,
//
acceptPersonId: '',
//
accetpcontrol: false,
//
deliveryPersonId: '',
//
deliverycontrol: false,
//
depts: [],
//
stockControl: false,
//
stockPersonId: '',
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionIds,
supplierId: this.supp
},
visible2: {},
//
personalForm: {},
personalForm2: {},
//
editVisible: false,
//
date: [],
checklistprop: this.checklist,
flagarr: [],
myarr: []
}
},
watch: {
entercontrol() {
this.employeeVisible = this.entercontrol
this.getlist()
setTimeout(() => {
this.$refs.multipleTable.clearSelection()
}, 0)
this.flagarr = []
this.moreaction = []
},
supp() {
this.getemplist.supplierId = this.supp
this.getlist()
console.log(this.supp)
},
checklist() {
const mychecklistprop = this.checklist.map(item => {
return item.sourceNumber
})
this.checklistprop = Array.from(new Set(mychecklistprop))
console.log('this.checklistprop==============>', this.checklistprop)
// const needarr = this.$refs.multipleTable.selection
// const delearr = this.checklistprop
// const add = needarr.filter(item => !delearr.some(ele => ele === item.id))
// console.log('add', add)
// for (const i in this.$refs.multipleTable.selection) {
// for (const j in add) {
// if (this.$refs.multipleTable.selection[i].code === add[j].code) {
// this.$refs.multipleTable.selection.splice(i, 1)
// }
// }
// }
// console.log('this.$refs.multipleTable.selection', this.$refs.multipleTable.selection)
// if (this.checklistprop) {
// this.checklistprop.forEach(row => {
// if (row) {
// this.select_orderId.push(row.productCode)
// }
// })
// }
}
},
beforeCreate() {
_that = this
},
methods: {
//
memoryChecked() {
console.log('我执行啦')
this.list.forEach((row, index) => {
if (this.checklistprop.includes(row.enterNumber)) {
this.$refs.multipleTable.toggleRowSelection(row, true)
// myarr = []
this.myarr.push(row.enterNumber)
this.flagarr = Array.from(new Set(this.myarr))
console.log('this.flagarr=====================>', this.flagarr)
} else {
try {
this.$refs.multipleTable.toggleRowSelection(row, false)
} catch (error) {
console.log(error)
}
}
})
},
handleSelectionChange(rows) {
// console.log(val)
// this.moreaction = val
console.log('myrows==========>', rows)
const obj = {}
const processaction = rows.reduce((cur, next) => {
obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
return cur
}, [])
this.moreaction = processaction
console.log('this.moreaction===>', this.moreaction)
this.select_order_number = this.moreaction.length
this.select_orderId = []
if (rows) {
rows.forEach(row => {
if (row) {
this.select_orderId.push(row.id)
}
})
}
console.log('this.select_orderId', this.select_orderId)
},
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
stockInvoiceList(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
// for (let i = 0; i < this.list.length; i++) {
// for (let j = 0; j < this.list[i].stockEnterDetailVos.length; j++) {
// if (this.list[i].stockEnterDetailVos[j].invoiceQuantity === this.list[i].stockEnterDetailVos[j].actualEnterQuantity) {
// this.list[i].stockEnterDetailVos.splice(j, 1)
// j--
// }
// }
// }
// for (let i = 0; i < this.list.length; i++) {
// if (this.list[i].stockEnterDetailVos.length === 0) {
// this.list.splice(i, 1)
// i--
// }
// }
this.total = res.data.data.content.totalCount
this.memoryChecked()
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
},
//
restFilter() {
this.enterRepositoryId = ''
this.getemplist.enterRepositoryId = ''
},
restFilter2() {
this.deliveryPersonId = ''
this.getemplist.deliveryPersonId = ''
},
restFilter3() {
this.acceptPersonId = ''
this.getemplist.acceptPersonId = ''
},
//
handleFilter() {
this.getemplist.pagenum = 1
stockenterlist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.memoryChecked()
// this.restFilter()
} else {
// this.restFilter()
}
})
},
// focus
handlechooseRep() {
this.repositorycontrol = true
},
repositoryname(val) {
console.log(val)
this.enterRepositoryId = val.repositoryName
this.getemplist.enterRepositoryId = val.id
},
// focus
updatedept() {
this.getlist()
},
// foucs
handlechooseDelivery() {
this.deliverycontrol = true
},
deliveryName(val) {
this.deliveryPersonId = val.personName
this.getemplist.deliveryPersonId = val.id
},
// focus
handlechooseAccept() {
this.accetpcontrol = true
},
acceptName(val) {
this.acceptPersonId = val.personName
this.getemplist.acceptPersonId = val.id
},
//
handleAdd() {
this.$router.push('/Stockenter/addstockenter')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
async handleConfirm() {
this.employeeVisible = false
this.$emit('enterinfo', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>