Commit 05cafbbf authored by hubaoshan's avatar hubaoshan

wcp

parent ff5cfcf5
......@@ -26,7 +26,20 @@ export function listWcpOrderPd(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) {
return request({
url: '/wcporderlist/detailId/',
......
......@@ -68,7 +68,7 @@
v-model="dateRange"
value-format="yyyy-MM-dd"
style="width: 250px"
type="daterange"
type="date range"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
......
......@@ -21,6 +21,20 @@
/>
</el-select>
</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-button
:class="commonField.queryClass"
......@@ -161,6 +175,14 @@
@click="handlePdPackingList"
>查询</el-button>
</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-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 />
......@@ -250,7 +272,7 @@
{{ scope.row.subCode || '-' }}
</template>
</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">
{{ scope.row.status || '-' }}
</template>
......@@ -285,6 +307,12 @@
:size="commonField.smallSize"
@click="handlePackingList"
>查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetDetails"
>重置</el-button>
</el-form-item>
</el-form>
<br>
......@@ -466,7 +494,7 @@
import {
addWcpOrder,
delWcpOrder,
exportWcpOrder,
exportWcpOrder, getUserId, getUserPd,
getWcpOrder,
getWcpOrderId,
importExcel, listPackingList, listUser,
......@@ -483,6 +511,7 @@ export default {
name: 'WcpOrder',
data() {
return {
dateRange: [],
orderSn: '',
Value: [],
dispensePd: {
......@@ -529,6 +558,7 @@ export default {
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/system/user/importExcel'
},
list: [],
dispense: {
Value: [],
userList: []
......@@ -581,7 +611,8 @@ export default {
form: {},
// 表单校验
rules: {
}
},
userIdList: []
}
},
computed: {
......@@ -621,12 +652,11 @@ export default {
},
// 表单重置
reset() {
this.form = {
this.queryParams = {
dateRange: undefined,
businessId: undefined,
remarks: undefined,
orderSn: undefined,
type: undefined,
flag: '1'
status: undefined
}
this.queryParamsNew = {
page: 1,
......@@ -651,6 +681,35 @@ export default {
}
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() {
this.reset()
......@@ -849,20 +908,30 @@ export default {
this.PdId = row.businessId
}
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 => ({
value: item.businessId,
value: item.id,
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 = {
userId: this.dispensePd.valuePd,
businessId: this.PdId,
page: this.queryPd.page,
rows: this.queryPd.rows
}
console.log(queryParams)
listWcpOrderPd(queryParams).then(response => {
this.queryPd.PdList = response.data.records
this.Pdtotal = response.data.total
......@@ -880,14 +949,28 @@ export default {
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.dispenseOpen = true
},
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 = {
businessId: this.businessId,
...this.dispense
Value: this.dispense.Value
}
this.$confirm('确认要开始盘点吗?', '提示', {
confirmButtonText: '确定',
......@@ -911,15 +994,17 @@ export default {
},
handleEnd() {
const id = this.businessId
this.$confirm('确认要重新盘点吗?', '提示', {
this.$confirm('确认要重新盘点吗?,<span style="color: red;">会自动删除盘点中的数据</span>', '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(response => {
wcpOrderEndPd(id).then(response => {
this.$message({ message: '盘点结束', type: 'success' })
this.dispenseOpen = false
this.getList()
this.dispense.Value = []
this.dispense.userList = []
}).catch(error => {
console.error('Error:', error)
this.dispenseOpen = false
......@@ -934,6 +1019,8 @@ export default {
return className
},
handlePackingList() {
this.queryParamsNew.page = 1
// this.Newtotal = ''
const queryParams = {
packingList: this.queryParamsNew.packingList,
page: this.queryParamsNew.page,
......@@ -942,7 +1029,7 @@ export default {
listPackingList(queryParams).then(
response => {
this.queryParamsNew.TempList = response.rows
this.Newtotal = response.data.total
this.Newtotal = response.total
})
},
handlePdPackingList() {
......@@ -957,6 +1044,15 @@ export default {
this.queryPd.PdList = response.data.records
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