From 0f612e9e7c1efd34c0938bb90e5fd6bd8aa181a0 Mon Sep 17 00:00:00 2001
From: xzg <4727863@qq.com>
Date: Fri, 24 Nov 2023 15:30:42 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/distribution/createTask.js | 45 ++-
.../checkInventoryTask/createTaskTemp.vue | 347 ++++++++++++------
vite.config.js | 3 +-
3 files changed, 262 insertions(+), 133 deletions(-)
diff --git a/src/api/distribution/createTask.js b/src/api/distribution/createTask.js
index 8e62ae20..b2c7bdc6 100644
--- a/src/api/distribution/createTask.js
+++ b/src/api/distribution/createTask.js
@@ -55,8 +55,14 @@ export const postBatchDelete = params => {
params,
});
};
-
-
+// 新增盘点任务
+export const $_submit = (data) => {
+ return request({
+ url: '/api/logpm-basic/material/submit',
+ method: 'post',
+ data
+ })
+}
/**
* 盘点详情
*/
@@ -104,6 +110,25 @@ export const $_materialList = params => {
});
};
+
+
+
+
+
+/**
+ * 删除盘点数据接口
+ */
+export const $_deleteQuestChild = params => {
+ return request({
+ url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/deleteQuestChild',
+ method:'get',
+ params,
+ });
+};
+
+
+
+
/**
* 盘点详情保存
*/
@@ -140,14 +165,14 @@ export const $_getContrastInfo = params => {
});
};
-// 查看详情
-// export const $_AddInfo = data => {
-// return request({
-// url: '/api/logpm-basic/pda/submit',
-// method: 'post',
-// data,
-// });
-// };
+// 删除盘点任务
+export const $_questDetailIds = data => {
+ return request({
+ url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/deleteQuestChild',
+ method: 'delete',
+ data,
+ });
+};
// 盘点任务包条
export const $_taskQuestSelectStrip = params => {
return request({
diff --git a/src/views/distribution/checkInventoryTask/createTaskTemp.vue b/src/views/distribution/checkInventoryTask/createTaskTemp.vue
index c02f4f0e..fe144ce6 100644
--- a/src/views/distribution/checkInventoryTask/createTaskTemp.vue
+++ b/src/views/distribution/checkInventoryTask/createTaskTemp.vue
@@ -28,10 +28,18 @@
创建盘点任务
- 取消盘点
- 盘点完成
- 取消完成
- 批量删除
+
+
@@ -173,7 +181,7 @@
- 删 除
+ 删 除
新 增
提交修改
修改状态
@@ -443,15 +451,20 @@
width="70%"
style="display: flex; flex-direction: column"
>
-
+
-
+
-
+
-
+
+
-
+
+
+
+
+
-
+
-
+
@@ -626,9 +646,13 @@ import {
getTaskQuestPage,
postAddtaskQuest,
$_materialList,
+ $_submit,
+ $_questDetailIds,
} from '@/api/distribution/createTask';
import { ElMessage } from 'element-plus';
+import { getDictionaryBiz } from '@/api/system/dict';
import { ref } from 'vue';
+import dictVue from '@/views/system/dict.vue';
const SoInfoData = ref({}); //搜索框参数
const searchSo = ref(false); //搜索框
const ElData = ref([]); //表格的值
@@ -649,6 +673,7 @@ const PopupDetails = ref(false); //弹窗详情是否展示
const InventoryPopup = ref(false); //创建判断任务弹窗
const formInventory = ref({}); //盘点任务表单_
const TcPdloading = ref(false); //弹窗盘点数据
+const PdRow = ref(null); //盘点任务选中
const TcFrom = ref({}); //弹窗搜索
const row = ref({}); //选择当前列
const Tcrow = ref(); //弹窗当前行
@@ -670,9 +695,9 @@ const TcStateSwitching = ref(false); //默认表示定制品状态
const TcnumStatu = ref(false); //表示零担,库存品,初始化状态
const readList = ref([]); //多选框
const TcReaJoin = ref([]); //零担库存品状态10,20,30...
-const TcDataaddition = ref(true); //数据新增弹唱
+const TcDataaddition = ref(false); //数据新增弹唱
const Fromnewlyadded = ref({}); //数据新增
-const Statusjudgment=ref(false);//新增按钮
+const Statusjudgment = ref(false); //新增按钮
const radioList = ref([
{ label: 0, txt: '在库', input: 'stockNum', disabled: true },
{ label: 1, txt: '破损', input: 'wornNum', disabled: true },
@@ -697,40 +722,7 @@ const options = [
},
];
// 新增物品分类
-const classification=ref([
-{
- value: '1',
- label: '箱',
- },
- {
- value: '2',
- label: '盒',
- },
- {
- value: '3',
- label: '包',
- },
- {
- value: '4',
- label: '件',
- },
- {
- value: '5',
- label: '个',
- },
- {
- value: '6',
- label: '张',
- },
- {
- value: '7',
- label: '公斤',
- },
- {
- value: '8',
- label: '个',
- },
-])
+const classification = ref([]);
// 菜单表头
const menuData = ref([
{
@@ -1234,6 +1226,20 @@ const ElButtonS = ref([
]);
// 页面初始化请求
function onLoad() {
+ getDictionaryBiz('logpm_unit').then(res => {
+ //异常类型
+ console.log(res, '字典返回值');
+
+ if (res.data.data.length) {
+ res.data.data.forEach(item => {
+ classification.value.push({
+ value: item.dictKey,
+ label: item.dictValue,
+ });
+ });
+ }
+ });
+
loading.value = true; //开启表格加载
let Data = {
current: currentPage.value, //页码
@@ -1263,12 +1269,7 @@ onLoad();
// 搜索框
const InputSo = val => {
- console.log(val,'val===========');
- console.log(val.prop !='categoryName');
- console.log(val.prop !='materialCode');
-
-
- console.log(val);
+ console.log(val, '搜索框接收的值');
let data = {};
data.current = TccurrentPage.value;
data.size = TcpageSize.value;
@@ -1276,78 +1277,114 @@ const InputSo = val => {
//查询产品名称
data.name = val.values;
$_materialList(data).then(res => {
- console.log(res, '查询的返回值');
- if(res.data.data.records.length){
- Tctotal.value = res.data.data.total;
- res.data.data.records.forEach(item => {
- item.Checkbox = true;
+ console.log(res, '查询的返回值');
+ if (res.data.data.records.length) {
+ Tctotal.value = res.data.data.total;
+ res.data.data.records.forEach(item => {
+ item.Checkbox = true;
+ });
+ TcPdloading.value = false;
+ console.log(res, '明细返回值');
+ TcPD.value = res.data.data.records;
+ } else {
+ Statusjudgment.value = true; //显示新增按钮
+ TcPD.value = res.data.data.records;
+ ElMessage({
+ message: '暂未查询到内容',
+ type: 'warning',
+ });
+ }
});
- TcPdloading.value = false;
- console.log(res, '明细返回值');
- TcPD.value = res.data.data.records;
- }else{
- Statusjudgment.value=true;//显示新增按钮
- }
- });
- return
+ return;
}
if (val.prop == 'materialCode') {
//查询物料编码
data.sku = val.values;
$_materialList(data).then(res => {
- console.log(res, '查询的返回值');
- if(res.data.data.records.length){
- Tctotal.value = res.data.data.total;
- res.data.data.records.forEach(item => {
- item.Checkbox = true;
+ console.log(res, '查询的返回值');
+ if (res.data.data.records.length) {
+ Tctotal.value = res.data.data.total;
+ res.data.data.records.forEach(item => {
+ item.Checkbox = true;
+ });
+ TcPdloading.value = false;
+ console.log(res, '明细返回值');
+ TcPD.value = res.data.data.records;
+ } else {
+ Statusjudgment.value = true; //显示新增按钮
+ TcPD.value = res.data.data.records;
+ ElMessage({
+ message: '暂未查询到内容',
+ type: 'warning',
+ });
+ }
});
- TcPdloading.value = false;
- console.log(res, '明细返回值');
- TcPD.value = res.data.data.records;
- }else{
- Statusjudgment.value=true;//显示新增按钮
- }
- });
- return
+ return;
}
- if(val.prop !='categoryName' || val.prop !='materialCode'){
- let dataS = {
- questNum: row.value.questNum,
- questId: row.value.id,
- current: TccurrentPage.value, //页码
- size: TcpageSize.value, //条数
- [val.prop]:val.values
- };
- console.log(dataS, '要提交的数据');
-
- $_getDetailInfo(dataS).then(res => {
- Tctotal.value = res.data.data.total;
- res.data.data.records.forEach(item => {
- item.Checkbox = true;
+ if (val.prop != 'categoryName' || val.prop != 'materialCode') {
+ let dataS = {
+ questNum: row.value.questNum,
+ questId: row.value.id,
+ current: TccurrentPage.value, //页码
+ size: TcpageSize.value, //条数
+ [val.prop]: val.values,
+ };
+ console.log(dataS, '要提交的数据');
+ $_getDetailInfo(dataS).then(res => {
+ Tctotal.value = res.data.data.total;
+ res.data.data.records.forEach(item => {
+ item.Checkbox = true;
+ });
+ TcPdloading.value = false;
+ console.log(res, '明细返回值222');
+ TcPD.value = res.data.data.records;
});
- TcPdloading.value = false;
- console.log(res, '明细返回值');
- TcPD.value = res.data.data.records;
- });
-
-}
-
-
-
-
+ }
};
// 点击新增按钮
-const TcAddData=()=>{
- TcDataaddition.value=true;//新增弹窗显示
-}
-// 新增按钮(搜索不到出现此按钮)
+const TcAddData = () => {
+ TcDataaddition.value = true; //新增弹窗显示
+};
+// 新增任务按钮(搜索不到出现此按钮)
const TcDataadditionsubmit = () => {
- Statusjudgment.value=false;//点击确定之后关闭按钮
+ console.log(Fromnewlyadded.value);
+ const validations = [
+ { property: 'sku', message: 'SKU为空' },
+ { property: 'name', message: '货物名称为空' },
+ { property: 'logpmUnit', message: '货物单位为空' },
+ { property: 'specification', message: '规格为空' },
+ { property: 'packingSpecification', message: '物料编码为空' },
+ { property: 'productCode', message: '产品编码为空' },
+ { property: 'packageNum', message: '包装数量为空' },
+ ];
+
+ for (const validation of validations) {
+ if (!Fromnewlyadded.value[validation.property]) {
+ ElMessage({
+ message: validation.message,
+ type: 'warning',
+ });
+ return;
+ }
+ }
+ TcDataaddition.value = false; //关闭弹窗
+ $_submit({ ...Fromnewlyadded.value }).then(res => {
+ console.log(res, '添加物品返回值');
+ if (res.data.code == 200) {
+ ElMessage({
+ message: res.data.msg,
+ type: 'success',
+ });
+ }
+ });
+ Statusjudgment.value = false; //点击确定之后关闭按钮
};
-// 表格筛选
-const selectChange = () => {
+// 盘点任务单选
+const selectChange = (select, val) => {
console.log('触发了选择');
+ console.log(select, val);
+ PdRow.value = select;
};
// 表格筛选
const selectAll = val => {
@@ -1365,12 +1402,13 @@ const TcselectAll = (selectAll, val) => {
item.Checkbox = !item.Checkbox;
});
}
-
+ console.log(Tcrow.value, '全选复选框');
// 状态修改
};
// 弹窗详情单选
const TcselectChange = (selectAll, val) => {
console.log(val, '当前选中的');
+ console.log(Tcrow.value);
val.Checkbox = !val.Checkbox; //开启修改
Tcrow.value = selectAll;
};
@@ -1379,6 +1417,10 @@ const extension = val => {
row.value = val;
dialogTabData.value = true;
};
+
+// 批量删除盘点任务
+const BatchDelete = () => {};
+
// 延期提交
const InventoryDate = () => {
console.log(TcData.value, '延期');
@@ -1454,7 +1496,7 @@ const searchReset = () => {
};
const TcViewEvent = val => {
- Statusjudgment.value=false;//关闭新增按钮
+ Statusjudgment.value = false; //关闭新增按钮
TcPdloading.value = true;
console.log(val, '要传递的对象');
let data = {
@@ -1587,6 +1629,37 @@ const ModifyingStatus = () => {
TcStateSwitching.value = true; //表示当前是零担,库存品
}
};
+
+// 删除盘点任务包件(只能删除已盘)
+const BatchdeletePackages = () => {
+ const invalidQuestStatusIndex = Tcrow.value.findIndex(item => item.questStatus !== 1);
+ if (invalidQuestStatusIndex !== -1) {
+ // 存在状态不为1的元素
+ ElMessage({
+ message: '只能删除已盘',
+ type: 'warning',
+ });
+ return;
+ }
+
+ const data = {
+ questDetailIds: Tcrow.value.map(item => item.id),
+ questId: Tcrow.value[0]?.questId,
+ questNum: row.value.questNum,
+ };
+ console.log(data, '要删除处理好的数据');
+ $_questDetailIds(data).then(res => {
+ TcViewEvent(row.value);
+ console.log(res, '删除后的返回值');
+ if (res.data.code === 200) {
+ ElMessage({
+ message: res.data.msg,
+ type: 'success',
+ });
+ }
+ });
+};
+
// 信息编辑弹窗关闭的时候重置保存的数据
const closeInformationediting = () => {
Tcrow.value = null;
@@ -1850,9 +1923,6 @@ const InformationEditing = () => {
// 弹窗品类搜索
const TcChenge = (event, val) => {
console.log(event, val);
- console.log({
- [event]: val,
- });
TcPdloading.value = true;
let data = {
questNum: row.value.questNum,
@@ -1906,11 +1976,15 @@ const TcpageList = val => {
// 条数
const SizeChange = val => {
console.log(val, '条数');
+ currentPage.value = val;
+ onLoad();
+};
+// 翻页···························
+const PageSizeChange = val => {
+ console.log(val, '每页50条');
+ pageSize.value = val;
+ onLoad();
};
-// 翻页
-const PageSizeChange=()=>{
- console.log(val,'翻页');
-}
// 对比数据单选按钮
const contrastselectChange = (select, val) => {
console.log(select, val, '对比数据1');
@@ -1973,6 +2047,7 @@ function matchInfoById(idArray, infoArray) {
// 商场名称选择回调
const formInventoryChange = val => {
+ console.log('选择了商场名称')
formInventory.value.id = val;
const matchedInfo = matchInfoById(val, formInventory.value.select);
console.log(matchedInfo, '处理好的参数');
@@ -1994,15 +2069,43 @@ const InventorySubmit = () => {
// 创建提交表单
let SubData = {};
SubData.list = [];
+ if(!formInventory.value.scname.length && !formInventory.value.brandName){//
+ SubData.list=[]
+ // 结束时间
+ SubData.endTime = formInventory.value.time[0];
+ // 开始时间
+ SubData.startTime = formInventory.value.time[1];
+ InventoryPopup.value = false; //关闭创建盘点任务弹窗
+ loading.value=true;//开启表格加载
+ postAddtaskQuest(SubData).then(res => {
+ onLoad(); //体积之后初始化页面
+ if(res.data.code=200){
+ ElMessage({
+ message: res.data.msg,
+ type: 'success',
+ });
+ onLoad(); //体积之后初始化页面
+ }
+ console.log(res, '盘点计划提交成功');
+
+ });
+ return
+ }
+
+
// 处理商场名称和商场ID
const matchedInfo = matchInfoById(formInventory.value.id, formInventory.value.select);
+ console.log(matchedInfo,'matchedInfo');
console.log(matchedInfo, 'matchedInfo提交处理数据');
- matchedInfo.forEach(item => {
+ if(matchedInfo){
+ matchedInfo.forEach(item => {
SubData.list.push({
refId: item.id,
refName: item.clientName,
});
});
+ }
+
// 结束时间
SubData.endTime = formInventory.value.time[0];
// 开始时间
@@ -2127,7 +2230,7 @@ const InventorySubmit = () => {
flex-wrap: wrap;
justify-content: space-between;
}
-.el-input__inner{
+.el-input__inner {
text-align: center;
}
diff --git a/vite.config.js b/vite.config.js
index 175843b7..d2453eba 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -19,7 +19,8 @@ export default ({ mode, command }) => {
// target: 'http://192.168.10.123:8889',
// target: 'http://192.168.10.101:8888',
// 老zyc
- target: 'http://192.168.10.75:8777',
+ // target: 'http://192.168.10.75:8777',
+ target: 'http://192.168.6.137:8777',
// 新zyc
// target: 'http://192.168.10.200:13000',
// target: 'http://192.168.10.94:8888',