Commit aee01501 authored by hubaoshan's avatar hubaoshan

wcp

parent 942407cf
...@@ -47,3 +47,9 @@ export function delPd(data) { ...@@ -47,3 +47,9 @@ export function delPd(data) {
params: data params: data
}) })
} }
export function getDicts(dictType) {
return request({
url: '/system/dict/data/type/' + dictType,
method: 'get'
})
}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="orderSn" prop="orderSn"> <el-form-item label="orderSn" prop="orderSn">
<template> <template>
<span>{{ queryForm.orderSn || '-' }}</span> <span>{{ moveSn || '-' }}</span>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="盘点总数" prop="totalCount"> <el-form-item label="盘点总数" prop="totalCount">
...@@ -30,17 +30,13 @@ ...@@ -30,17 +30,13 @@
<span v-if="values" :class="valuePd">{{ values }}</span> <span v-if="values" :class="valuePd">{{ values }}</span>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="pallet" prop="pallet"> <el-form-item label="pallet:">
<el-input {{ palletLable }}
ref="pallet" <el-button size="small" style="position: relative;right: -50px" @click="dialogVisible = true">
v-model="queryForm.pallet" 选择
clearable </el-button>
placeholder="请输入pallet"
style="width: 200px"
@keyup.enter.native="move"
/>
</el-form-item> </el-form-item>
<el-form-item label="value" prop="value"> <el-form-item label="value:" prop="value">
<el-input <el-input
ref="input1" ref="input1"
v-model="queryForm.value" v-model="queryForm.value"
...@@ -56,7 +52,7 @@ ...@@ -56,7 +52,7 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<el-dialog class="pd" :title="title" :visible.sync="open" width="80%" append-to-body> <el-dialog class="pd" :title="title" :visible.sync="open" width="100%" append-to-body>
<el-table v-loading="loading" border :data="queryPd.PdList" :row-class-name="rowClassName"> <el-table v-loading="loading" border :data="queryPd.PdList" :row-class-name="rowClassName">
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column v-if="false" label="orderId" prop="orderId" :show-overflow-tooltip="true"> <el-table-column v-if="false" label="orderId" prop="orderId" :show-overflow-tooltip="true">
...@@ -83,6 +79,8 @@ ...@@ -83,6 +79,8 @@
<pagination <pagination
v-show="Pdtotal>0" v-show="Pdtotal>0"
class="pagination" class="pagination"
:pager-count="1"
layout="total, sizes, prev, next"
:total="Pdtotal" :total="Pdtotal"
:page.sync="queryPd.page" :page.sync="queryPd.page"
:limit.sync="queryPd.rows" :limit.sync="queryPd.rows"
...@@ -95,34 +93,74 @@ ...@@ -95,34 +93,74 @@
<el-button <el-button
id="primary_del" id="primary_del"
ref="buttonAAAA" ref="buttonAAAA"
:class="selectedButton === 'AAAA' ? 'button_rowBtn_action' : ''" :class="selectedButton === 'A' ? 'button_rowBtn_action' : ''"
@click="handleButton('AAAA')" @click="handleButton('A')"
> >
<div class="buttionText"> <div class="buttionText">
<span>AAAA</span> <span>A</span>
<span v-if="totalA" style="color: red">({{ totalA }})</span> <span v-if="totalA" style="color: red">({{ totalA }})</span>
</div> </div>
</el-button> </el-button>
<el-button <el-button
id="primary_del" id="primary_del"
:class="selectedButton === 'BBBB' ? 'button_rowBtn_action' : ''" :class="selectedButton === 'B' ? 'button_rowBtn_action' : ''"
@click="handleButton('BBBB')" @click="handleButton('B')"
> >
<div class="buttionText"> <div class="buttionText">
<span>BBBB</span> <span>B</span>
<span v-if="totalB" style="color: red">({{ totalB }})</span> <span v-if="totalB" style="color: red">({{ totalB }})</span>
</div> </div>
</el-button> </el-button>
<el-button <el-button
id="primary_del" id="primary_del"
:class="selectedButton === 'CCCC' ? 'button_rowBtn_action' : ''" :class="selectedButton === 'C' ? 'button_rowBtn_action' : ''"
@click="handleButton('CCCC')" @click="handleButton('C')"
> >
<div class="buttionText"> <div class="buttionText">
<span>CCCC</span> <span>C</span>
<span v-if="totalC" style="color: red">({{ totalC }})</span> <span v-if="totalC" style="color: red">({{ totalC }})</span>
</div> </div>
</el-button> </el-button>
<el-button
id="primary_del"
:class="selectedButton === 'D' ? 'button_rowBtn_action' : ''"
@click="handleButton('D')"
>
<div class="buttionText">
<span>D</span>
<span v-if="totalD" style="color: red">({{ totalD }})</span>
</div>
</el-button>
<el-button
id="primary_del"
:class="selectedButton === 'E' ? 'button_rowBtn_action' : ''"
@click="handleButton('E')"
>
<div class="buttionText">
<span>E</span>
<span v-if="totalE" style="color: red">({{ totalE }})</span>
</div>
</el-button>
<el-button
id="primary_del"
:class="selectedButton === 'F' ? 'button_rowBtn_action' : ''"
@click="handleButton('F')"
>
<div class="buttionText">
<span>F</span>
<span v-if="totalF" style="color: red">({{ totalF }})</span>
</div>
</el-button>
<el-button
id="primary_del"
:class="selectedButton === '0' ? 'button_rowBtn_action' : ''"
@click="handleButton('0')"
>
<div class="buttionText">
<span></span>
<span v-if="total0" style="color: red">({{ total0 }})</span>
</div>
</el-button>
</div> </div>
</div> </div>
<br> <br>
...@@ -131,99 +169,28 @@ ...@@ -131,99 +169,28 @@
<el-button class="button_rowBtn_del" type="primary" @click="deletePd">删除</el-button> <el-button class="button_rowBtn_del" type="primary" @click="deletePd">删除</el-button>
</div> </div>
<br> <br>
<el-table v-loading="loading" class="queryTable" border :data="queryPdDel.PdDelList" :row-class-name="rowClassName"> <el-table v-loading="loading" class="queryTable" border :data="queryPdDel.PdDelList">
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column v-if="false" label="orderId" prop="orderId" :show-overflow-tooltip="true"> <el-table-column v-if="false" label="orderId" prop="orderId" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.orderId || '-' }} {{ scope.row.orderId || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="custCode" prop="custCode" :show-overflow-tooltip="true"> <el-table-column label="packingList" prop="packingList" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.custCode || '-' }}
</template>
</el-table-column>
<el-table-column label="cusrAbbr" prop="cusrAbbr" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.cusrAbbr || '-' }}
</template>
</el-table-column>
<el-table-column label="dueDate" prop="dueDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.dueDate || '-' }}
</template>
</el-table-column>
<el-table-column label="packingList" prop="packingList" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.packingList || '-' }} {{ scope.row.packingList || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="currency" prop="currency" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.currency || '-' }}
</template>
</el-table-column>
<el-table-column label="dest" prop="dest" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.dest || '-' }}
</template>
</el-table-column>
<el-table-column label="quantity" prop="quantity" :show-overflow-tooltip="true"> <el-table-column label="quantity" prop="quantity" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.quantity || '-' }} {{ scope.row.quantity || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="amount" prop="amount" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.amount || '-' }}
</template>
</el-table-column>
<el-table-column label="newWeight" prop="newWeight" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.newWeight || '-' }}
</template>
</el-table-column>
<el-table-column label="crossWeight" prop="crossWeight" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.crossWeight || '-' }}
</template>
</el-table-column>
<el-table-column label="m3" prop="m3" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.m3 || '-' }}
</template>
</el-table-column>
<el-table-column label="pdCode" prop="pdCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.pdCode || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="orderListId" prop="orderListId" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.orderListId || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="payTerms" prop="payTerms" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.payTerms || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="shipment" prop="shipment" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.shipment || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="subCode" prop="subCode" :show-overflow-tooltip="true"> <el-table-column label="subCode" prop="subCode" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.subCode || '-' }} {{ scope.row.subCode || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="status" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.status || '-' }}
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
...@@ -234,15 +201,46 @@ ...@@ -234,15 +201,46 @@
@pagination="handlePa" @pagination="handlePa"
/> />
</el-dialog> </el-dialog>
<el-dialog
title="选择人员"
:visible.sync="dialogVisible"
width="500px"
@close="handleDialogClose"
>
<div class="button-container">
<el-button
v-for="item in palletList"
:key="item.dictValue"
:type="pallet === item.dictLabel ? 'primary' : 'default'"
style="width: 130px;margin-bottom: 10px;margin-left: 10px"
@click="handleSelect(item.dictValue)"
>
{{ item.dictLabel }}
</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import { delPd, getDelList, getPdList, getViewList, updatePd } from '@/api/materialInventory' import { delPd, getDelList, getDicts, getPdList, getViewList, updatePd } from '@/api/materialInventory'
export default { export default {
name: 'Inventory', name: 'Inventory',
data() { data() {
return { return {
dialogVisible: false,
pallet: '',
palletList: [],
listA: [],
listB: [],
listC: [],
listD: [],
listE: [],
listF: [],
listZero: [],
moveId: '',
moveSn: '',
valuePd: 'bacc-red', valuePd: 'bacc-red',
selectedButton: '', selectedButton: '',
loading: false, loading: false,
...@@ -261,6 +259,10 @@ export default { ...@@ -261,6 +259,10 @@ export default {
totalA: undefined, totalA: undefined,
totalB: undefined, totalB: undefined,
totalC: undefined, totalC: undefined,
totalD: undefined,
totalE: undefined,
totalF: undefined,
total0: undefined,
open: false, open: false,
openDel: false, openDel: false,
title: '', title: '',
...@@ -273,22 +275,39 @@ export default { ...@@ -273,22 +275,39 @@ export default {
}, },
values: '', values: '',
userIdNew: '', userIdNew: '',
userNew: '',
// 表单校验 // 表单校验
rules: { rules: {
} }
} }
}, },
computed: {
palletLable() {
const lable = this.palletList.find(item => String(item.dictValue) === String(this.pallet))
return lable ? lable.dictLabel : ''
}
},
created() { created() {
this.moveId = this.$route.query.businessId
this.moveSn = this.$route.query.orderSn
this.getList() this.getList()
this.getPallet()
this.getInfo()
}, },
mounted() { mounted() {
}, },
methods: { methods: {
getPallet() {
getDicts('WCP_ORDER_PALLET').then(res => {
console.log('dict', res)
this.palletList = res.data
})
},
handleView() { handleView() {
this.queryPd.PdList = []
getInfo().then(response => { getInfo().then(response => {
const queryParams = { const queryParams = {
businessId: response.data.user.businessId, businessId: response.data.user.businessId,
orderSn: this.$route.query.orderSn,
page: this.queryPd.page, page: this.queryPd.page,
rows: this.queryPd.rows rows: this.queryPd.rows
} }
...@@ -304,28 +323,98 @@ export default { ...@@ -304,28 +323,98 @@ export default {
this.Pdtotal = '' this.Pdtotal = ''
} }
}, },
handleDel() { getInfo() {
this.selectedButton = 'AAAA'
getInfo().then(response => { getInfo().then(response => {
const queryParams = { this.userNew = response.data.user.businessId
businessId: response.data.user.businessId, })
page: this.queryPd.page, },
rows: this.queryPd.rows, buttonLable(data) {
pallet: 'AAAA' const lable = this.palletList.find(item => String(item.dictValue) === String(data))
} return lable ? lable.dictLabel : ''
getDelList(queryParams).then(response => { },
this.queryPdDel.PdDelList = response.data.records buttonValue(data) {
this.total = response.data.total const item = this.palletList.find(item => item.dictLabel === data)
this.totalA = response.data.total return item ? item.dictValue : ''
this.title = '删除' },
this.openDel = true async handleDel() {
if (this.openDel === false) { const queryParams = {
this.selectedButton = '' businessId: this.userNew,
page: this.queryPd.page,
rows: this.queryPd.rows,
pallet: ''
}
const count = [0, 1, 2, 3, 4, 5, 6]
for (let i = 0; i < count.length; i++) {
const item = count[i]
queryParams.pallet = item
await getDelList(queryParams).then(response => {
switch (item) {
case 0:
this.listZero.push(response.data.records)
this.total0 = Number(response.data.total)
break
case 1:
this.listA.push(response.data.records)
this.totalA = Number(response.data.total)
break
case 2:
this.listB.push(response.data.records)
this.totalB = Number(response.data.total)
break
case 3:
this.listC.push(response.data.records)
this.totalC = Number(response.data.total)
break
case 4:
this.listD.push(response.data.records)
this.totalD = Number(response.data.total)
break
case 5:
this.listE.push(response.data.records)
this.totalE = Number(response.data.total)
break
case 6:
this.listF.push(response.data.records)
this.totalF = Number(response.data.total)
break
}
if (Number(response.data.total) > 0) {
this.selectedButton = String(this.buttonLable(item))
console.log('this.this.buttonLable', this.selectedButton)
console.log('this.listA', this.listA)
} }
}) })
}) }
this.getList() switch (this.selectedButton) {
case '无':
this.queryPdDel.PdDelList = this.listZero[0]
break
case 'A':
this.queryPdDel.PdDelList = this.listA[0]
break
case 'B':
this.queryPdDel.PdDelList = this.listB[0]
break
case 'C':
this.queryPdDel.PdDelList = this.listC[0]
break
case 'D':
this.queryPdDel.PdDelList = this.listD[0]
break
case 'E':
this.queryPdDel.PdDelList = this.listE[0]
break
case 'F':
this.queryPdDel.PdDelList = this.listF[0]
break
default:
this.queryPdDel.PdDelList = []
break
}
this.title = '删除'
this.openDel = true
}, },
handlePa() { handlePa() {
getInfo().then(response => { getInfo().then(response => {
const queryParams = { const queryParams = {
...@@ -339,50 +428,53 @@ export default { ...@@ -339,50 +428,53 @@ export default {
this.total = response.data.total this.total = response.data.total
}) })
}) })
this.queryPdDel.PdDelList = []
}, },
handleButton(buttonName) { handleButton(buttonName) {
console.log('buttonName', buttonName)
this.selectedButton = buttonName this.selectedButton = buttonName
getInfo().then(response => { const queryParams = {
const queryParams = { businessId: this.userNew,
businessId: response.data.user.businessId, page: this.queryPdDel.page,
page: this.queryPdDel.page, rows: this.queryPdDel.rows,
rows: this.queryPdDel.rows, pallet: ''
pallet: '' }
} queryParams.pallet = this.buttonValue(buttonName)
switch (this.selectedButton) { getDelList(queryParams).then(response => {
case 'AAAA': this.queryPdDel.PdDelList = response.data.records
queryParams.pallet = 'AAAA' this.total = response.data.total
break if (queryParams.pallet === '0') {
case 'BBBB': this.total0 = response.data.total
queryParams.pallet = 'BBBB' } else if (queryParams.pallet === '1') {
break this.totalA = response.data.total
case 'CCCC': } else if (queryParams.pallet === '2') {
queryParams.pallet = 'CCCC' this.totalB = response.data.total
break } else if (queryParams.pallet === '3') {
this.totalC = response.data.total
} else if (queryParams.pallet === '4') {
this.totalD = response.data.total
} else if (queryParams.pallet === '5') {
this.totalE = response.data.total
} else if (queryParams.pallet === '6') {
this.totalF = response.data.total
} }
getDelList(queryParams).then(response => {
this.queryPdDel.PdDelList = response.data.records
this.total = response.data.total
if (queryParams.pallet === 'AAAA') {
this.totalA = response.data.total
} else if (queryParams.pallet === 'BBBB') {
this.totalB = response.data.total
} else if (queryParams.pallet === 'CCCC') {
this.totalC = response.data.total
}
})
}) })
this.getList() this.resetTotal()
this.queryPdDel.PdDelList = [] },
resetTotal() {
this.totalA = '' this.totalA = ''
this.totalB = '' this.totalB = ''
this.totalC = '' this.totalC = ''
this.totalD = ''
this.totalE = ''
this.totalF = ''
this.total0 = ''
}, },
getList() { getList() {
getInfo().then(response => { getInfo().then(response => {
const data = { const data = {
businessId: response.data.user.businessId businessId: this.$route.query.businessId,
orderSn: this.$route.query.orderSn,
userId: response.data.user.businessId
} }
this.userIdNew = response.data.user.businessId this.userIdNew = response.data.user.businessId
getPdList(data).then(res => { getPdList(data).then(res => {
...@@ -397,11 +489,6 @@ export default { ...@@ -397,11 +489,6 @@ export default {
this.$refs.input1.focus() this.$refs.input1.focus()
}) })
}, },
movePallet() {
this.$nextTick().then(() => {
this.$refs.pallet.focus()
})
},
handleEnd() { handleEnd() {
this.values = this.queryForm.value this.values = this.queryForm.value
const values = this.queryForm.value.split('-') const values = this.queryForm.value.split('-')
...@@ -409,9 +496,11 @@ export default { ...@@ -409,9 +496,11 @@ export default {
packingList: values[0], packingList: values[0],
subCode: values[1], subCode: values[1],
userId: this.userIdNew, userId: this.userIdNew,
pdCode: this.queryForm.orderSn, pdCode: this.queryForm.value,
pallet: this.queryForm.pallet pallet: this.pallet,
orderSn: this.moveSn
} }
console.log('obj', obj)
updatePd(obj).then(res => { updatePd(obj).then(res => {
this.valuePd = res.code === 200 ? 'bacc-green' : '' this.valuePd = res.code === 200 ? 'bacc-green' : ''
}) })
...@@ -419,43 +508,36 @@ export default { ...@@ -419,43 +508,36 @@ export default {
this.getList() this.getList()
}, },
deletePd() { deletePd() {
getInfo().then(response => { const queryParams = {
const queryParams = { businessId: this.userNew,
businessId: response.data.user.businessId, page: this.queryPd.page,
page: this.queryPd.page, rows: this.queryPd.rows,
rows: this.queryPd.rows, pallet: ''
pallet: '' }
} queryParams.pallet = String(this.buttonValue(this.selectedButton))
switch (this.selectedButton) { this.$confirm('是否确认操作?', '提示', {
case 'AAAA': confirmButtonText: '确定',
queryParams.pallet = 'AAAA' cancelButtonText: '取消',
break type: 'warning'
case 'BBBB': }).then(function() {
queryParams.pallet = 'BBBB' return delPd(queryParams)
break }).then(() => {
case 'CCCC': this.getList()
queryParams.pallet = 'CCCC' this.$message({
break message: '删除成功',
} type: 'success'
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delPd(queryParams)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
}) })
}) })
this.handleDel() this.handleDel()
}, },
rowClassName({ row }) { rowClassName({ row }) {
return row.status === '2' ? 'orange-row' : '' return row.status === '2' ? 'orange-row' : ''
},
handleSelect(value) {
this.pallet = value
this.dialogVisible = false
},
handleDialogClose() {
} }
} }
} }
...@@ -485,7 +567,9 @@ export default { ...@@ -485,7 +567,9 @@ export default {
bottom: initial; bottom: initial;
} }
.oneButtion{ .oneButtion{
width: 300px; width: 200px;
position: relative;
right: -40px;
} }
.buttonRegion { .buttonRegion {
margin-top: 20px; margin-top: 20px;
...@@ -498,17 +582,23 @@ export default { ...@@ -498,17 +582,23 @@ export default {
.button_rowBtn_del { .button_rowBtn_del {
font-size: 17px; font-size: 17px;
width: 80px; width: 80px;
background-color: #f6c761;
border-color: #f6c761;
} }
.button_rowBtn_action{ .button_rowBtn_action{
background-color: #46bcf3 !important; background-color: #46bcf3 !important;
border-color:#46bcf3;
color: white;
} }
#primary_del{ #primary_del{
color: black; color: black;
background-color: #ecf9fe; background-color: #808080;
border-color:#46bcf3; border-color:#808080;
margin-left: 10px;
margin-bottom: 10px;
} }
::v-deep .el-table .orange-row { ::v-deep .el-table .orange-row {
background-color: #abfaff !important; background-color: #e8d8a2 !important;
} }
.bacc-green{ .bacc-green{
color: green; color: green;
......
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column label="orderSn"> <el-table-column label="orderSn">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.orderSn || '-' }}</span> <span>{{ scope.row.orderSn || '-' }}({{ scope.row.name || '-' }})</span>
</template>
</el-table-column>
<el-table-column label="人员">
<template slot-scope="scope">
<span>{{ scope.row.name || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
...@@ -54,7 +49,8 @@ export default { ...@@ -54,7 +49,8 @@ export default {
this.$router.push({ this.$router.push({
path: '/setup/inventory', path: '/setup/inventory',
query: { query: {
businessId: item.businessId businessId: item.businessId,
orderSn: item.orderSn
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment