Browse Source

Merge branch 'dev' of http://47.108.105.48:3000/java_project/logpm_page into dev

fix_bug_pro20231227
13208366016 1 year ago
parent
commit
e725073acc
  1. 44
      src/api/distribution/createTask.js
  2. 16
      src/utils/print.js
  3. 2
      src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue
  4. 401
      src/views/distribution/checkInventoryTask/createTask.vue
  5. 3
      vite/plugins/index.js

44
src/api/distribution/createTask.js

@ -10,4 +10,48 @@ export const getDictList = params => {
method: 'get',
params,
});
};
/**
* 添加盘点任务
*/
export const postAddtaskQuest = data => {
return request({
url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/save',
method: 'post',
data,
});
};
/**
* 获取盘点列表
*/
export const getTaskQuestPage = params => {
return request({
url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/page',
method: 'get',
params,
});
};
/**
* 编辑盘点任务
*/
export const postEditTaskQuestUpdate = data => {
return request({
url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/update',
method: 'post',
data,
});
};
/**
* 批量删除盘点任务
*/
export const postBatchDelete = params => {
return request({
url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/remove',
method: 'post',
params,
});
};

16
src/utils/print.js

@ -13,18 +13,18 @@ const point = nodeList => {
// 当列表内没有元素时, 退出函数
if (nodeList.length === 0) return;
LODOP.PRINT_INITA(1, 1, 900, 660, '测试预览功能');
LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
// // 设置打印整宽且不变形
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Auto-Width');
// // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// 循环列表内元素并打印
nodeList.forEach(orderNode => {
let templateData = orderNode.innerHTML;
LODOP.PRINT_INITA(1, 1, 900, 660, '测试预览功能');
LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
// // 设置打印整宽且不变形
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Auto-Width');
// // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// // data就是一段html文本
LODOP.ADD_PRINT_HTM('20', '0%', '100%', '100%', templateData);
LODOP.ADD_PRINT_HTM('45', '0%', '100%', '100%', templateData);
// LODOP.PREVIEW(); //预览(预览打印无脚标)
LODOP.PRINT(); //直接打印
});

2
src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue

@ -418,7 +418,7 @@ export default {
// //
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// // datahtml
LODOP.ADD_PRINT_HTM('0%', '0%', '100%', '100%', templateData);
LODOP.ADD_PRINT_HTM('40', '0%', '100%', '100%', templateData);
// LODOP.PREVIEW(); //()
LODOP.PRINT(); //
},

401
src/views/distribution/checkInventoryTask/createTask.vue

@ -1,8 +1,8 @@
<template>
<basic-container>
<div class="avue-crud">
<!-- 查询模块 -->
<el-row v-if="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<div class="fo-rl">
<el-form-item label="货物名称:">
@ -22,6 +22,8 @@
</el-form-item>
</el-form>
</el-row>
<!-- 控件区 -->
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
@ -29,6 +31,9 @@
<el-button icon="el-icon-plus" type="primary" @click="createCheckTask"
>创建盘点任务</el-button
>
<el-button icon="el-icon-delete" type="primary" @click="handleBatchDelete">
批量删除
</el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
@ -38,8 +43,9 @@
</div>
</div>
</el-row>
<!-- 列表模块 -->
<el-row>
<!-- 列表模块 -->
<tablecmt
:columnList="columnList"
:tableData="data"
@ -55,30 +61,32 @@
type="primary"
text
icon="el-icon-view"
@click="handleViewCheck(slotProps.scope)"
@click="handleViewCheck(slotProps.scope.row)"
> </el-text
>
<el-text
type="primary"
text
icon="el-icon-view"
@click="handleEditCheck(slotProps.scope)"
@click="handleEditCheck(slotProps.scope.row)"
> </el-text
>
<el-text
type="primary"
text
icon="el-icon-view"
@click="handleDeleteCheck(slotProps.scope)"
@click="handleDeleteCheck(slotProps.scope.row)"
> </el-text
>
</template>
</tablecmt>
</el-row>
<!-- 分页模块 -->
<el-row>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<!-- 分页 -->
<el-pagination
align="right"
background
@ -102,14 +110,12 @@
center
:before-close="beforeClose"
append-to-body
:disabled="view"
>
<el-form :disabled="view" ref="form" :model="form" label-width="120px">
<!-- 表单字段 -->
<el-form-item label="订单自编号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入订单自编号" clearable />
</el-form-item>
<el-form-item label="商场名称" prop="orderCode">
<el-select v-model="form.region" multiple placeholder="请选择商场" clearable>
<!-- 商场名称 -->
<el-form-item label="商场名称">
<el-select v-model="form.clientList" multiple placeholder="请选择商场" clearable>
<template v-if="form.selectList && form.selectList.length !== 0">
<el-option
v-for="item in form.selectList"
@ -119,10 +125,14 @@
</template>
</el-select>
</el-form-item>
<el-form-item label="品牌" prop="orderCode">
<!-- 品牌 -->
<el-form-item label="品牌">
<el-input v-model="form.brandName" placeholder="品牌名称" disabled />
</el-form-item>
<el-form-item label="订单时间">
<!-- 盘点时间 -->
<el-form-item label="盘点时间">
<div class="block" prop="time">
<el-date-picker
v-model="form.time"
@ -134,6 +144,21 @@
/>
</div>
</el-form-item>
<!-- 盘点订单状态 -->
<template v-if="isEdit">
<el-form-item label="盘点订单状态">
<el-select v-model="form.dictKey" placeholder="请选择订单状态" clearable>
<template v-if="this.typeData.length !== 0">
<el-option
v-for="item in this.typeData"
:label="item.dictValue"
:value="item.dictKey"
/>
</template>
</el-select>
</el-form-item>
</template>
</el-form>
<!-- 表单按钮 -->
<template #footer>
@ -163,7 +188,13 @@
</template>
<script>
import { getDictList } from '@/api/distribution/createTask';
import {
getDictList,
postAddtaskQuest,
getTaskQuestPage,
postEditTaskQuestUpdate,
postBatchDelete,
} from '@/api/distribution/createTask';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
import { getDictionaryBiz } from '@/api/system/dict';
@ -185,52 +216,71 @@ export default {
checkarr: [],
fixed: true,
},
{
prop: 'serviceNumber',
prop: 'questNum',
label: '任务编号',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'warehouseName',
label: '仓库名称',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: true,
fixed: false,
sortable: true,
head: false,
},
{
prop: 'serviceNumber',
prop: 'marketName',
label: '商城名称',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: true,
fixed: false,
sortable: true,
head: false,
},
{
prop: 'serviceNumber',
prop: 'brandName',
label: '品牌名称',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'startTime',
label: '任务开始时间',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: true,
fixed: false,
sortable: true,
head: false,
},
{
prop: 'serviceNumber',
prop: 'endTime',
label: '任务结束时间',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: true,
fixed: false,
sortable: true,
head: false,
},
{
@ -240,26 +290,25 @@ export default {
values: '',
width: '130',
checkarr: [],
fixed: true,
fixed: false,
sortable: true,
head: false,
},
{
prop: 'unpack',
label: '拆包状态',
prop: 'questStatusName',
label: '状态',
type: 1,
values: '',
width: '130',
checkarr: [
{
value: `true`,
label: '是',
},
{
value: `false`,
label: '否',
},
// {
// value: `true`,
// label: '',
// },
// {
// value: `false`,
// label: '',
// },
],
fixed: false,
sortable: true,
@ -282,11 +331,6 @@ export default {
//
title: '',
stockList: {}, //
// stockId: '', //id
// materialId: '', //id
// marketId: '', //id
// storeId: '', //id
//
box: false,
//
@ -313,6 +357,9 @@ export default {
selectionList: [],
//
data: [],
//
typeData: [],
};
},
mounted() {
@ -401,15 +448,47 @@ export default {
},
},
methods: {
/**
* 表单事件选择器改变时触发回调
*/
timeChange(value) {
console.log('value :>> ', value);
value.forEach((item)=>{
console.log('item :>> ', item);
item.getFullYear()
console.log('item.getFullYear() :>> ', item.getFullYear());
// const date = new Date(item)
// console.log('date :>> ', date);
})
//
const _time = new Date().getTime();
//
const _isTime = value.every(item => {
console.log('item.toLocaleString() :>> ', item.toLocaleString());
return _time < item.getTime();
});
if (!_isTime) {
this.form.time = [];
return this.$message({
type: 'error',
message: '开始时间不能小于当前时间',
});
}
// _time.toLocaleTimeString()
// console.log('_time.toLocaleTimeString() :>> ', _time.toLocaleString());
},
//
filterTime(time) {
const y = time.getFullYear();
const m = time;
myDate.getYear(); //(2)
myDate.getFullYear(); //(4,1970-????)
myDate.getMonth(); //(0-11,01)
myDate.getDate(); //(1-31)
myDate.getDay(); //X(0-6,0)
myDate.getTime(); //(1970.1.1)
myDate.getHours(); //(0-23)
myDate.getMinutes(); //(0-59)
myDate.getSeconds(); //(0-59)
myDate.getMilliseconds(); //(0-999)
myDate.toLocaleDateString(); //
var mytime = myDate.toLocaleTimeString(); //
myDate.toLocaleString(); //
},
showdrawer(value) {
@ -433,6 +512,40 @@ export default {
}
},
/**
* 批量删除
*/
handleBatchDelete() {
if (this.selectionList.length === 0)
return this.$message({
type: 'error',
message: '最少选择一条数据',
});
const ids = this.selectionList.map(item => item.id).join(',');
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
return postBatchDelete({ ids });
})
.then((res) => {
this.onLoad(this.page);
const { code, msg } = res.data;
if (code === 200) {
return this.$message({
type: 'success',
message: msg,
});
}
});
},
btnsc(index, row) {
console.log(index, row);
},
@ -540,45 +653,104 @@ export default {
},
//
handleSubmit() {},
async handleSubmit() {
//
if (!this.form.time || this.form.time.length === 0) {
return this.$message({
type: 'error',
message: '请选择盘点时间',
});
}
//
handleEditSubmit() {},
const formData = {};
formData.list = [];
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
//
this.form.selectList.forEach(val => {
if (this.form.clientList.includes(val.id))
formData.list.push({
refId: val.id,
refName: val.clientName,
});
});
//
formData.startTime = this.form.time[0].toLocaleString();
//
formData.endTime = this.form.time[1].toLocaleString();
console.log('formData :>> ', formData);
const res = await postAddtaskQuest(formData);
const { code, msg } = res.data;
if (code === 200)
this.$message({
message: msg,
type: 'success',
});
//
this.onLoad();
//
this.box = false;
},
//
async handleEditSubmit() {
console.log('this.form :>> ', this.form);
//
if (!this.form.time || this.form.time.length === 0) {
return this.$message({
type: 'error',
message: '请选择盘点时间',
});
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return;
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
const formData = {};
formData.list = [];
//
this.form.selectList.forEach(val => {
if (this.form.clientList.includes(val.id))
formData.list.push({
refId: val.id,
refName: val.clientName,
});
});
//
formData.startTime = this.form.time[0].toLocaleString();
//
formData.endTime = this.form.time[1].toLocaleString();
console.log('formData :>> ', formData);
formData.questStatus = this.form.dictKey;
formData.id = this.form.id;
const res = await postEditTaskQuestUpdate(formData);
const { code, msg } = res.data;
console.log('msg :>> ', msg);
console.log('res :>> ', res);
if (code === 200)
this.$message({
message: msg,
type: 'success',
});
//
this.onLoad();
//
this.box = false;
},
/**
* 删除单个任务
*/
handleDeleteCheck() {
handleDeleteCheck(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return;
return postBatchDelete({ids: row.id});
})
.then(() => {
this.onLoad(this.page);
@ -601,11 +773,36 @@ export default {
/**
* 编辑单个任务
*/
handleEditCheck(row) {
async handleEditCheck(row) {
this.title = '编辑盘点任务';
this.isEdit = true; //
this.box = true; //
console.log('row :>> ', row);
this.form.brandName = row.brandName;
this.form.time = [row.startTime, row.endTime];
this.form.clientList = row.list.map(val => val.refId);
this.form.dictKey = row.questStatus;
this.form.selectList = [];
this.form.id = row.id;
console.log('this.form :>> ', this.form);
//
const res = await getDictList();
const { code, data } = res.data;
if (code === 200 && !!data) {
console.log('data :>> ', data);
this.form.selectList = data.map(item => {
return {
//
clientName: item.clientName,
// id
id: item.id,
//
brandName: item.brandName,
};
});
}
},
beforeClose(done) {
@ -615,6 +812,7 @@ export default {
},
selectionChange(list) {
this.selectionList = list;
console.log('this.selectionList :>> ', this.selectionList);
},
selectionClear() {
this.selectionList = [];
@ -627,31 +825,60 @@ export default {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad(page, params = {}) {
async onLoad(page, params = {}) {
this.loading = true;
this.query.serviceType = '3';
const postData = { ...page, ...params };
const res = await getTaskQuestPage(postData);
const {
code,
data: { records },
} = res.data;
this.data = [];
if (code === 200) this.data = records;
console.log('records :>> ', records);
this.data.forEach(val => {
val.brandName = '';
val.marketName = '';
val.list.forEach(item => {
if (item.brandName) val.brandName += item.brandName + ',';
if (item.refName) val.marketName += item.refName + ',';
});
});
this.loading = false;
//
getDictionaryBiz('warehouse_quest_status').then(res => {
this.typeData = res.data.data.map(val => {
return {
dictKey: val.dictKey,
dictValue: val.dictValue,
};
});
});
},
},
watch: {
//
'form.region'(newVal) {
'form.clientList'(newVal) {
let _newVal = Array.from(newVal);
let _value = '';
// ,
if (newVal.length === 0) return (this.form.brandName = _value);
if (_newVal.length === 0) return (this.form.brandName = _value);
console.log('this.form.selectList :>> ', this.form.selectList);
//
this.form.brandName = newVal.reduce((curr, item)=> {
const _brandName = this.form.selectList.find(val => val.id === item).brandName;
if (_brandName) return curr += _brandName;
return curr
}, '')
this.form.brandName = _newVal.reduce((curr, item) => {
const _brand = this.form.selectList.find(val => val.id === item);
if (_brand) return (curr += _brand.brandName);
return curr;
}, '');
},
},
};
</script>
<style lang="scss" scoped>
<style scoped lang="scss">
.zhu {
display: flex;
flex-direction: row;
@ -676,8 +903,6 @@ export default {
.demo-form-inline .el-input {
--el-input-width: 220px;
}
</style>
<style scoped lang="scss">
.el-row:first-of-type {
/* 样式规则 */
.el-form {

3
vite/plugins/index.js

@ -9,7 +9,8 @@ export default function createVitePlugins(viteEnv, isBuild = false) {
const vitePlugins = [vue()];
vitePlugins.push(createAutoImport());
vitePlugins.push(createSetupExtend());
vitePlugins.push(createSetupMock());
// 取消对mockJS的加载
// vitePlugins.push(createSetupMock());
isBuild && vitePlugins.push(...createCompression(viteEnv));
return vitePlugins;
}

Loading…
Cancel
Save