Browse Source

新增预约包件入库, 修复干线列表合并bug

dev-xx
qb 11 months ago
parent
commit
b8b009aaf4
  1. 15
      src/api/warehouse/PreStoragePackage.js
  2. 145
      src/option/warehouse/PreStoragePackage.js
  3. 20
      src/views/distribution/artery/VehicleStowageDetails.vue
  4. 3
      src/views/distribution/artery/directGoMarketDetails.vue
  5. 103
      src/views/warehouse/prewarehousing/PreStoragePackage.vue
  6. 96
      src/views/waybill/CreateZeroOrder.vue

15
src/api/warehouse/PreStoragePackage.js

@ -14,3 +14,18 @@ export const getList = params => {
params,
});
};
/**
* 批量入库
* @param {*} current
* @param {*} size
* @param {*} params
* @returns
*/
export const getInOrder = params => {
return request({
url: '/api/logpm-distribution/businessPreOrder/inOrder',
method: 'get',
params,
});
};

145
src/option/warehouse/PreStoragePackage.js

@ -64,7 +64,7 @@ export const columnList = [
sortable: true,
},
{
prop: 'deliveryTrainNumber',
prop: 'distrCarNumber',
label: '配送车次号',
type: 2,
values: '',
@ -73,16 +73,7 @@ export const columnList = [
fixed: false,
sortable: true,
},
{
prop: 'warehouse',
label: '仓库',
type: 2,
values: '',
width: '100',
checkarr: [],
fixed: false,
sortable: true,
},
// {
// prop: 'materialName',
// label: '物品名称',
@ -166,27 +157,46 @@ export const columnList = [
sortable: true,
},
{
prop: 'materialName',
label: '物料名称',
type: 2,
prop: 'operationStatusName',
label: '操作状态',
type: 3,
values: '',
width: '150',
checkarr: [],
checkarr: [
{
label: '补录',
value: '1',
},
{
label: '正常',
value: '0',
},
],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'warehouseEntryTimeEnd',
label: '入库时间',
type: 1,
prop: 'inWarehouseName',
label: '是否入库',
type: 3,
values: '',
width: '150',
checkarr: [],
checkarr: [
{
label: '是',
value: '1',
},
{
label: '否',
value: '0',
},
],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'quantity',
label: '包件数量',
@ -197,103 +207,6 @@ export const columnList = [
fixed: false,
sortable: true,
},
{
prop: 'reservationNum',
label: '计划数量',
type: 1,
values: '',
width: '120',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'loadingNub',
label: '装车数量',
type: 1,
values: '',
width: '120',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'signingNub',
label: '签收数量',
type: 1,
values: '',
width: '120',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'scanStatus',
label: '装车方式',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'driverName',
label: '计划装车人',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'scanUser',
label: '实际装车人',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'loadingTime',
label: '装车时间',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'signingUser',
label: '签收人',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'signingTime',
label: '签收扫描时间',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: '',
label: '操作',

20
src/views/distribution/artery/VehicleStowageDetails.vue

@ -791,10 +791,13 @@ const searchHide = async () => {
};
const handleMerge = (startIndex: number, endIndex: number, data: {}) => {
for (let index = startIndex; index <= endIndex; index++) {
console.log('startIndex :>> ', startIndex);
console.log('endIndex :>> ', endIndex);
for (let index = startIndex; index < endIndex; index++) {
const value = data[index];
if (index === startIndex) value.mergeColumnIndex = endIndex + 1 - startIndex;
if (index === startIndex) value.mergeColumnIndex = endIndex - startIndex;
else {
value.mergeColumnIndex = 0;
for (let key of mergeColumn) {
@ -842,20 +845,21 @@ const inputsc = async (value, row) => {
//
let mergeStartIndex = 0;
//
let comparisonValue = '';
let comparisonValue = _data[0].waybillNo;
_data[0].mergeColumnIndex = 1;
for (let index = 0; index < _data.length; index++) {
const value = _data[index];
console.log('value :>> ', value);
//
if (value.waybillNo !== comparisonValue) {
if (index === 1) mergeStartIndex = 1;
comparisonValue = value.waybillNo;
mergeStartIndex = index;
handleMerge(mergeStartIndex, index, _data);
handleMerge(mergeStartIndex, index + 1, _data);
mergeStartIndex = index + 1;
//
} else if (index === _data.length - 1) handleMerge(mergeStartIndex, index, _data);
} else if (index === _data.length - 1) handleMerge(mergeStartIndex, index + 1, _data);
}
details.renderData = _data;

3
src/views/distribution/artery/directGoMarketDetails.vue

@ -963,6 +963,7 @@ const handleSubmitSiginImg = async () => {
if (details.fileList.length === 0) return ElMessage.warning('请上传签收图片');
try {
details.loadingObj.pageLoading = true;
details.popUpShow.uploadSiginImg = false;
const submitData = {
signOrderId: $route.query.loadId,
@ -986,7 +987,7 @@ const handleSubmitSiginImg = async () => {
const res = await postUploadSignPhoto(submitData);
const { code, data, msg } = res;
const { code, data, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
} catch (error) {

103
src/views/warehouse/prewarehousing/PreStoragePackage.vue

@ -44,7 +44,7 @@
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<!-- 批量入库 -->
<el-button type="primary" icon="Switch" @click="handleAudit">批量入库</el-button>
<el-button type="primary" icon="Switch" @click="handleBatchImcoming">批量入库</el-button>
<!-- 批量查看二维码 -->
<el-button type="primary" icon="Printer" @click="handleBatchShowQrCode"
@ -79,7 +79,12 @@
<el-text @click="() => handleShowQrCode(slotProps.scope)"> 查看二维码 </el-text>
<!-- 入库 -->
<el-text @click="() => handleIncoming(slotProps.scope)"> 入库 </el-text>
<el-text
v-if="Number(slotProps.scope.row.inWarehouse) !== 1"
@click="() => handleIncoming(slotProps.scope)"
>
入库
</el-text>
</template>
</template>
</tablecmt>
@ -137,12 +142,13 @@ import {
handleClearTableQuery,
handleInputQuery,
handleSelectQuery,
handleTranslationDataSeclect,
} from '@/utils/util';
import { columnList } from '@/option/warehouse/PreStoragePackage';
import { useRouter } from 'vue-router';
import { deepClone } from '@/utils/util';
import { showOrderPackgeCode } from '@/api/distribution/distributionStockArticle';
import { getList } from '@/api/warehouse/PreStoragePackage';
import { getList, getInOrder } from '@/api/warehouse/PreStoragePackage';
import { ElMessage, ElMessageBox } from 'element-plus';
//
@ -188,7 +194,7 @@ const details = reactive<any>({
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [{}],
data: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
@ -245,6 +251,8 @@ const onLoad = async (params = {}) => {
details.data = data.records;
details.page.total = data.total;
handleTranslationDataSeclect(details.data, details.columnList);
return res.data;
} catch (error) {
console.log('error :>> ', error);
@ -329,14 +337,6 @@ const currentChange = pageNum => {
onLoad();
};
/** 批量审核 */
const handleAudit = () => {
if (details.selectionList.length === 0) {
ElMessage.warning('请选择要审核的单据');
return;
}
};
/** 导出 */
const handleExport = () => {
ElMessageBox.confirm('是否确认导出?', '提示', {
@ -352,7 +352,28 @@ const handleExport = () => {
};
/** 查看二维码 */
const handleShowQrCode = ({ row }) => {};
const handleShowQrCode = async ({ row }) => {
try {
details.loadingObj.pageLoading = true;
let qr = {
ids: row.id,
};
details.html = '';
const res = await showOrderPackgeCode(qr);
const { code, data } = res.data;
if (code !== 200) return;
details.html = details.getHtmls(data.dataList, data.templateHtml);
details.popUpShow.dialogVisible = true;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 批量查看二维码 */
const handleBatchShowQrCode = async () => {
@ -390,14 +411,60 @@ const handleIncoming = ({ row }) => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
ElMessage({
type: 'success',
message: '入库成功!',
});
let submitData = {
ids: row.id,
};
const res = await getInOrder(submitData);
const { code, data, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
initOnLoad();
details.html = '';
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
/** 批量入库 */
const handleBatchImcoming = () => {
if (details.selectionList.length === 0) return ElMessage.warning('请选择要批量入库的数据');
for (let i = 0; i < details.selectionList.length; i++) {
const item = details.selectionList[i];
if (Number(item.inWarehouse) === 1) return ElMessage.warning('存在已入库的包件不可重复入库');
}
ElMessageBox.confirm('是否确认批量入库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
try {
details.loadingObj.pageLoading = true;
let submitData = {
ids: details.selectionList.map(val => val.id).join(','),
};
const res = await getInOrder(submitData);
const { code, data, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
initOnLoad();
details.html = '';
} catch (error) {
console.log('error :>> ', error);
} finally {

96
src/views/waybill/CreateZeroOrder.vue

@ -2130,7 +2130,7 @@ const handlePickUpPrice = (pickup, template) => {
if (getObjType(fullVehicle) !== 'array') return;
let item = {};
let item = {} as any;
for (let i = 0; i < fullVehicle.length; i++) {
const value = fullVehicle[i];
@ -2682,12 +2682,100 @@ const handleSpecialBrandPrice = (value, trunkLine, template) => {
console.log('value :>> ', value);
};
/** 配送价格赋值 */
const handleAssignmentItemPriceDispatch = (value, dispatch, template) => {
const { pieceCategory, cubeCategory, weightCategory } = dispatch;
//
if (template.trunklineIsByCategory) {
// id
if (!value.goodsId) value.dispatchPrice = 0;
else {
let _item: any = {};
//
if (getObjType(pieceCategory) === 'array') {
for (let j = 0; j < pieceCategory.length; j++) {
const item = pieceCategory[j];
if (item.categoryId !== value.goodsId) continue;
_item = item;
_item.chargeType = 1;
break;
}
}
//
if (getObjType(cubeCategory) === 'array' && !_item.chargeType) {
for (let j = 0; j < cubeCategory.length; j++) {
const item = cubeCategory[j];
if (item.categoryId !== value.goodsId) continue;
_item = item;
_item.chargeType = 2;
break;
}
}
//
if (getObjType(weightCategory) === 'array' && !_item.chargeType) {
for (let j = 0; j < weightCategory.length; j++) {
const item = weightCategory[j];
if (item.categoryId !== value.goodsId) continue;
_item = item;
_item.chargeType = 3;
break;
}
}
if (!_item.chargeType) value.dispatchPrice = 0;
else {
value.chargeType = _item.chargeType;
value.dispatchPrice = _item.dispatchPrice;
}
}
} else {
//
switch (value.chargeType) {
//
case 1:
value.dispatchPrice =
getObjType(pieceCategory) === 'array' && pieceCategory.length > 0
? pieceCategory[0].dispatchPrice || 0
: 0;
break;
//
case 2:
value.dispatchPrice =
getObjType(cubeCategory) === 'array' && cubeCategory.length > 0
? cubeCategory[0].dispatchPrice || 0
: 0;
break;
//
case 3:
value.dispatchPrice =
getObjType(weightCategory) === 'array' && weightCategory.length > 0
? weightCategory[0].dispatchPrice || 0
: 0;
break;
default:
break;
}
}
};
/**
* isOnload 是否为初始化价格赋值, 初始化不赋值干线单价以及计算价格
*/
const handleAssignmentItemPrice = (value, isOnload = false) => {
//
const { pickup, template, trunkLine } = details.priceTemplate;
const { pickup, template, trunkLine, dispatch } = details.priceTemplate;
// 线
if (!isOnload) {
@ -2732,6 +2820,10 @@ const handleAssignmentItemPrice = (value, isOnload = false) => {
}
} else value.pickupPrice = 0;
//
if (dispatch && template) handleAssignmentItemPriceDispatch(value, dispatch, template);
else value.dispatchPrice = 0;
//
if (!isOnload) handleComputed(value);
};

Loading…
Cancel
Save