Commit 05cafbbf authored by hubaoshan's avatar hubaoshan

wcp

parent ff5cfcf5
...@@ -26,7 +26,20 @@ export function listWcpOrderPd(query) { ...@@ -26,7 +26,20 @@ export function listWcpOrderPd(query) {
params: query params: query
}) })
} }
export function getUserPd(query) {
return request({
url: '/wcporderuser/getUserPd',
method: 'get',
params: query
})
}
export function getUserId(query) {
return request({
url: '/wcporderuser/getUserPd',
method: 'get',
params: query
})
}
export function getWcpOrderId(query) { export function getWcpOrderId(query) {
return request({ return request({
url: '/wcporderlist/detailId/', url: '/wcporderlist/detailId/',
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 250px" style="width: 250px"
type="daterange" type="date range"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
......
...@@ -21,6 +21,20 @@ ...@@ -21,6 +21,20 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="操作时间" prop="date">
<div class="block">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
style="width: 250px"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleChange"
/>
</div>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
:class="commonField.queryClass" :class="commonField.queryClass"
...@@ -161,6 +175,14 @@ ...@@ -161,6 +175,14 @@
@click="handlePdPackingList" @click="handlePdPackingList"
>查询</el-button> >查询</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetPd"
>重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" class="queryPd" border :data="queryPd.PdList" :row-class-name="rowClassName"> <el-table v-loading="loading" class="queryPd" border :data="queryPd.PdList" :row-class-name="rowClassName">
<el-table-column type="index" label="序号" width="55" align="center" fixed /> <el-table-column type="index" label="序号" width="55" align="center" fixed />
...@@ -250,7 +272,7 @@ ...@@ -250,7 +272,7 @@
{{ 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" fixed="right"> <el-table-column v-if="false" label="status" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status || '-' }} {{ scope.row.status || '-' }}
</template> </template>
...@@ -285,6 +307,12 @@ ...@@ -285,6 +307,12 @@
:size="commonField.smallSize" :size="commonField.smallSize"
@click="handlePackingList" @click="handlePackingList"
>查询</el-button> >查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetDetails"
>重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<br> <br>
...@@ -466,7 +494,7 @@ ...@@ -466,7 +494,7 @@
import { import {
addWcpOrder, addWcpOrder,
delWcpOrder, delWcpOrder,
exportWcpOrder, exportWcpOrder, getUserId, getUserPd,
getWcpOrder, getWcpOrder,
getWcpOrderId, getWcpOrderId,
importExcel, listPackingList, listUser, importExcel, listPackingList, listUser,
...@@ -483,6 +511,7 @@ export default { ...@@ -483,6 +511,7 @@ export default {
name: 'WcpOrder', name: 'WcpOrder',
data() { data() {
return { return {
dateRange: [],
orderSn: '', orderSn: '',
Value: [], Value: [],
dispensePd: { dispensePd: {
...@@ -529,6 +558,7 @@ export default { ...@@ -529,6 +558,7 @@ export default {
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + '/system/user/importExcel' url: process.env.VUE_APP_BASE_API + '/system/user/importExcel'
}, },
list: [],
dispense: { dispense: {
Value: [], Value: [],
userList: [] userList: []
...@@ -581,7 +611,8 @@ export default { ...@@ -581,7 +611,8 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
} },
userIdList: []
} }
}, },
computed: { computed: {
...@@ -621,12 +652,11 @@ export default { ...@@ -621,12 +652,11 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.queryParams = {
dateRange: undefined,
businessId: undefined, businessId: undefined,
remarks: undefined,
orderSn: undefined, orderSn: undefined,
type: undefined, status: undefined
flag: '1'
} }
this.queryParamsNew = { this.queryParamsNew = {
page: 1, page: 1,
...@@ -651,6 +681,35 @@ export default { ...@@ -651,6 +681,35 @@ export default {
} }
this.handleQuery() this.handleQuery()
}, },
resetDetails() {
this.queryParamsNew.page = 1
this.queryParamsNew.packingList = ''
const queryParams = {
packingList: this.queryParamsNew.packingList,
page: this.queryParamsNew.page,
rows: this.queryParamsNew.rows
}
listPackingList(queryParams).then(
response => {
this.queryParamsNew.TempList = response.rows
this.Newtotal = response.total
})
},
resetPd() {
this.queryParamsNew.page = 1
this.queryParamsNew.packingList = ''
const queryParams = {
userId: this.dispensePd.valuePd,
packingList: this.dispensePd.packingList,
page: this.queryParamsNew.page,
rows: this.queryParamsNew.rows,
businessId: this.PdId
}
listWcpOrderPd(queryParams).then(response => {
this.queryPd.PdList = response.data.records
this.Pdtotal = response.data.total
})
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
...@@ -849,20 +908,30 @@ export default { ...@@ -849,20 +908,30 @@ export default {
this.PdId = row.businessId this.PdId = row.businessId
} }
this.queryPd.PdList = [] this.queryPd.PdList = []
listUser().then(response => { // listUser().then(response => {
// this.dispensePd.listPd = response.rows.map(item => ({
// value: item.businessId,
// label: `${item.username} ${item.name}`
// }))
const data = {
businessId: this.PdId
}
getUserId(data).then(response => {
this.dispensePd.listPd = response.rows.map(item => ({ this.dispensePd.listPd = response.rows.map(item => ({
value: item.businessId, value: item.id,
label: `${item.username} ${item.name}` label: `${item.username} ${item.name}`
})) }))
this.dispensePd.valuePd = this.dispensePd.listPd[1].value if (row.status !== '0') {
this.dispensePd.valuePd = this.dispensePd.listPd[0].value
}
}) })
// })
const queryParams = { const queryParams = {
userId: this.dispensePd.valuePd, userId: this.dispensePd.valuePd,
businessId: this.PdId, businessId: this.PdId,
page: this.queryPd.page, page: this.queryPd.page,
rows: this.queryPd.rows rows: this.queryPd.rows
} }
console.log(queryParams)
listWcpOrderPd(queryParams).then(response => { listWcpOrderPd(queryParams).then(response => {
this.queryPd.PdList = response.data.records this.queryPd.PdList = response.data.records
this.Pdtotal = response.data.total this.Pdtotal = response.data.total
...@@ -880,14 +949,28 @@ export default { ...@@ -880,14 +949,28 @@ export default {
label: `${item.username} ${item.name}` label: `${item.username} ${item.name}`
})) }))
}) })
const data = {
businessId: row.businessId
}
getUserPd(data).then(res => {
this.dispense.Value = res.data.map(item => item.userId)
this.list = res.data.map(item => item.userId)
})
this.title = '分配' this.title = '分配'
this.dispenseOpen = true this.dispenseOpen = true
}, },
handleStart() { handleStart() {
this.dispense.userList = [] const values = this.list.filter(value => !this.dispense.Value.includes(value))
if (values.length > 0) {
this.$message({
message: '不能换正在盘点的人,只允许添加要盘点的人员',
type: 'error'
})
return
}
const data = { const data = {
businessId: this.businessId, businessId: this.businessId,
...this.dispense Value: this.dispense.Value
} }
this.$confirm('确认要开始盘点吗?', '提示', { this.$confirm('确认要开始盘点吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -911,15 +994,17 @@ export default { ...@@ -911,15 +994,17 @@ export default {
}, },
handleEnd() { handleEnd() {
const id = this.businessId const id = this.businessId
this.$confirm('确认要重新盘点吗?', '提示', { this.$confirm('确认要重新盘点吗?,<span style="color: red;">会自动删除盘点中的数据</span>', '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(response => { }).then(response => {
wcpOrderEndPd(id).then(response => { wcpOrderEndPd(id).then(response => {
this.$message({ message: '盘点结束', type: 'success' }) this.$message({ message: '盘点结束', type: 'success' })
this.dispenseOpen = false
this.getList() this.getList()
this.dispense.Value = []
this.dispense.userList = []
}).catch(error => { }).catch(error => {
console.error('Error:', error) console.error('Error:', error)
this.dispenseOpen = false this.dispenseOpen = false
...@@ -934,6 +1019,8 @@ export default { ...@@ -934,6 +1019,8 @@ export default {
return className return className
}, },
handlePackingList() { handlePackingList() {
this.queryParamsNew.page = 1
// this.Newtotal = ''
const queryParams = { const queryParams = {
packingList: this.queryParamsNew.packingList, packingList: this.queryParamsNew.packingList,
page: this.queryParamsNew.page, page: this.queryParamsNew.page,
...@@ -942,7 +1029,7 @@ export default { ...@@ -942,7 +1029,7 @@ export default {
listPackingList(queryParams).then( listPackingList(queryParams).then(
response => { response => {
this.queryParamsNew.TempList = response.rows this.queryParamsNew.TempList = response.rows
this.Newtotal = response.data.total this.Newtotal = response.total
}) })
}, },
handlePdPackingList() { handlePdPackingList() {
...@@ -957,6 +1044,15 @@ export default { ...@@ -957,6 +1044,15 @@ export default {
this.queryPd.PdList = response.data.records this.queryPd.PdList = response.data.records
this.Pdtotal = response.data.total this.Pdtotal = response.data.total
}) })
},
handleChange() {
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:59'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
} }
} }
} }
......
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