Browse Source

提货新增添加运单

dev-xx
qb 1 year ago
parent
commit
2a7df65109
  1. 11
      src/api/distribution/arteryDistrilbutionBillLadingList.js
  2. 70
      src/option/distribution/arteryDistrilbutionBillLadingList.js
  3. 2
      src/views/distribution/deliverylist/distributionDeliveryListmar.vue
  4. 11
      src/views/distribution/inventory/addArteryDistrilbutionBillLadingList.vue
  5. 291
      src/views/distribution/inventory/arteryDistrilbutionBillLadingList.vue

11
src/api/distribution/arteryDistrilbutionBillLadingList.js

@ -143,4 +143,13 @@ export const postFindWaybillListNotBillladingId = data => {
});
};
// /logpm-trunkline/billlading/findBillladingClientByName
/**
* 查询运单
*/
export const postFindWaybillBillladingList = data => {
return request({
url: '/api/logpm-warehouse/warehouseWaybill/findWaybillBillladingList',
method: 'post',
data,
});
};

70
src/option/distribution/arteryDistrilbutionBillLadingList.js

@ -20,7 +20,7 @@ export const columnList = [
{
prop: 'billladingCode',
label: '提货批次',
type: 6,
type: 13,
values: '',
width: '250',
checkarr: [],
@ -31,7 +31,7 @@ export const columnList = [
{
prop: 'carNumber',
label: '车牌号',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],
@ -41,7 +41,7 @@ export const columnList = [
{
prop: 'driverName',
label: '司机名称',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],
@ -51,7 +51,7 @@ export const columnList = [
{
prop: 'driverPhone',
label: '司机电话',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],
@ -61,7 +61,7 @@ export const columnList = [
{
prop: 'warehouseName',
label: '仓库名称',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],
@ -119,22 +119,56 @@ export const columnList = [
sortable: true,
},
{
prop: 'billladingStatus',
prop: 'billladingStatusName',
label: '状态',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'chargeType',
type: 3,
values: '',
width: '130',
checkarr: [
{
label: '未开始',
value: 1,
},
{
label: '提货中',
value: 2,
},
{
label: '已完成',
value: 3,
},
{
label: '已结算',
value: 4,
},
{
label: '已取消',
value: 5,
},
],
fixed: false,
sortable: true,
},
{
prop: 'chargeTypeName',
label: '计费模式',
type: 1,
type: 3,
values: '',
width: '130',
checkarr: [],
checkarr: [
{
label: '按件计费',
value: 1,
},
{
label: '按重量计费',
value: 2,
},
{
label: '按体积计费',
value: 3,
},
],
fixed: false,
sortable: true,
},
@ -211,7 +245,7 @@ export const columnList = [
{
prop: 'createUserName',
label: '创建人',
type: 1,
type: 2,
values: '',
width: '130',
checkarr: [],

2
src/views/distribution/deliverylist/distributionDeliveryListmar.vue

@ -164,7 +164,7 @@
</div>
<!-- 打印模块 -->
<el-dialog title="二维码" :visible.sync="isShow" width="780px" v-model="isShow">
<el-dialog title="二维码" :visible.sync="isShow" width="70%" v-model="isShow">
<div>
<div v-html="html"></div>

11
src/views/distribution/inventory/addArteryDistrilbutionBillLadingList.vue

@ -43,6 +43,7 @@
remote
reserve-keyword
placeholder="节点"
ref="selectNodeRef"
@change="val => destinationWarehouseNameChange(val, index)"
:remote-method="remoteMethod"
:loading="details.loadingObj.nodeLoading"
@ -340,7 +341,7 @@
</el-button>
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="handleRefresh(2)" circle></el-button>
<!-- <el-button icon="el-icon-refresh" @click="handleRefresh(2)" circle></el-button> -->
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
@ -442,6 +443,9 @@ const ruleFormRef = ref<FormInstance>();
const oldFormNode = ref<FormInstance>();
const newFormNode = ref<FormInstance>();
//
const selectNodeRef = ref();
const details = reactive({
columnNewList,
newColumnNewList: deepClone(columnNewList),
@ -1028,8 +1032,11 @@ const handleRemoveWaybill = () => {
};
/** 新增节点 */
const handleAddNode = index => {
const handleAddNode = async index => {
nodeInfoData.splice(index, 0, { nodeName: '' });
console.log('selectNodeRef :>> ', selectNodeRef);
await nextTick();
selectNodeRef.value[index + 1].focus();
};
/** 删除节点 */

291
src/views/distribution/inventory/arteryDistrilbutionBillLadingList.vue

@ -1,5 +1,5 @@
<template>
<basic-container>
<basic-container v-loading="loadingObj.pageLoading">
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="!search">
@ -125,83 +125,11 @@
</div>
</el-row>
<!-- 新增节点 -->
<el-dialog
title="新增节点"
v-model="popUpShow.addNewNodeVisited"
width="50%"
:before-close="beforeClose"
append-to-body
>
<el-form
:disabled="view"
ref="form"
:model="addLineInfo.addLineForm"
label-width="80px"
style="zoom: 0.9"
>
<!-- 表单字段 -->
<el-form-item label="提货客户" prop="pickUpTime">
<el-select
v-model="form.customerCode"
filterable
remote
reserve-keyword
remote-show-suffix
:remote-method="remoteCodeMethod"
:loading="loading"
@change="getMenDian($event, 2)"
placeholder="请输入内容"
:teleported="false"
placement="bottom-end"
class="popUpselect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.code"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="联系人" prop="pickUpTime">
<el-input v-model="form.pickUpTime" type="text" placeholder="联系人" />
</el-form-item>
<el-form-item label="联系方式" prop="pickUpTime">
<el-input v-model="form.pickUpTime" type="text" placeholder="联系方式" />
</el-form-item>
<!-- <el-form-item label="提货地址" prop="pickUpTime">
<el-input v-model="form.pickUpTime" type="text" placeholder="提货地址" />
</el-form-item> -->
<el-form-item label="提货地址" prop="pickUpTime">
<avue-input-map
:params="addNewNodeInfo.params"
placeholder="请选择地图"
v-model="addNewNodeInfo.map"
></avue-input-map>
</el-form-item>
<el-form-item label="备注" prop="pickUpTime">
<el-input v-model="form.pickUpTime" type="textarea" placeholde="备注" />
</el-form-item>
</el-form>
<!-- 表单按钮 -->
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"
> </el-button
>
<el-button icon="el-icon-circle-close" @click="popUpShow.addNewNodeVisited = false"
> </el-button
>
</span>
</template>
</el-dialog>
<!-- 添加提货数据 -->
<el-dialog
:title="title"
v-model="popUpShow.addDistrilbutionVisited"
width="50%"
width="780px"
:before-close="beforeClose"
append-to-body
>
@ -210,50 +138,65 @@
<el-form-item label="运单号" prop="clientId">
<!-- <el-input v-model="form.customerName" placeholder="请输入客户名称"/>-->
<el-select
v-model="form.clientId"
class="w100"
v-model="form.waybillNo"
filterable
remote
reserve-keyword
remote-show-suffix
:remote-method="remoteMethod"
@change="handleChooseWaybillNo"
:loading="loading"
clearable
placeholder="请输入运单号"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.waybillNo"
:label="item.waybillNo"
:value="item.waybillNo"
/>
</el-select>
</el-form-item>
<el-form-item label="开单日期" prop="consignee">
<el-input v-model="form.consignee" placeholder="请输入提货人" />
<el-form-item label="开单日期" prop="createTime">
<el-date-picker
class="w100 h100"
v-model="form.createTime"
type="date"
placeholder="请选择开单日期"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item label="货物名称" prop="pickUpPlate">
<el-input v-model="form.pickUpPlate" placeholder="请输入货物名称" />
<el-form-item label="货物名称" prop="goodsName">
<el-input v-model="form.goodsName" placeholder="请输入货物名称" />
</el-form-item>
<el-form-item label="提货件数" prop="deliveryDocument">
<el-input-number v-model="form.deliveryDocument" :min="1" :max="10" />
<el-form-item label="提货件数" prop="num">
<el-input-number
v-model="form.num"
class="w100"
:min="0"
:max="form.maxNum || form.maxNum === 0 || Infinity"
:value-on-clear="0"
controls-position="right"
/>
</el-form-item>
<el-form-item label="到站" prop="deliveryDocument">
<el-input v-model="form.deliveryDocument" placeholder="请输入提货证件" />
<el-form-item label="到站" prop="destination">
<el-input v-model="form.destination" placeholder="请输入提货证件" />
</el-form-item>
<el-form-item label="发货人" prop="pickUpTime">
<el-input v-model="form.pickUpTime" placeholder="请输入发货人" />
<el-form-item label="发货人" prop="shipperName">
<el-input v-model="form.shipperName" placeholder="请输入发货人" />
</el-form-item>
<el-form-item label="发货手机" prop="consignee">
<el-input v-model="form.consignee" placeholder="请输入发货手机" />
<el-form-item label="发货手机" prop="shipperMobile">
<el-input v-model="form.shipperMobile" placeholder="请输入发货手机" />
</el-form-item>
<el-form-item label="收货电话" prop="pickUpPlate">
<el-input v-model="form.pickUpPlate" placeholder="请输入收货电话" />
<el-form-item label="收货电话" prop="consigneeMobile">
<el-input v-model="form.consigneeMobile" placeholder="请输入收货电话" />
</el-form-item>
<el-form-item label="支付方式" prop="deliveryDocument">
<el-input v-model="form.deliveryDocument" placeholder="请输入支付方式" />
<el-form-item label="支付方式" prop="payType">
<el-input v-model="form.payType" placeholder="请输入支付方式" />
</el-form-item>
<el-form-item label="备注" prop="deliveryDocument">
<el-input v-model="form.deliveryDocument" type="textarea" placeholder="请输入备注" />
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-form>
<!-- 表单按钮 -->
@ -327,6 +270,8 @@ import {
postPageList,
postUpdateBillladingStatus,
postBillladingPackageDetail,
postFindWaybillBillladingList,
postAddWaybillToBillladingId,
} from '@/api/distribution/arteryDistrilbutionBillLadingList';
//
import {
@ -337,7 +282,7 @@ import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
import { getToken } from '@/utils/auth';
import dayjs from 'dayjs';
import { downloadXls, setNodeHeight, debounce } from '@/utils/util';
import { downloadXls, setNodeHeight, debounce, handleClearTableQuery } from '@/utils/util';
export default {
data() {
@ -359,8 +304,6 @@ export default {
distrilbutionDetailVisited: false,
/** 新增线路是否显示 */
addDistrilbutionLineVisited: false,
/** 新增新节点是否显示 */
addNewNodeVisited: false,
},
//
search: true,
@ -369,10 +312,10 @@ export default {
/** 加载中 */
loadingObj: {
loading: false,
oldListLoading: false,
newlistLoading: false,
/** 详情loading */
detailsLoding: false,
/** 页面loading */
pageLoading: false,
},
/** 详情查询信息 */
detailQuery: {},
@ -396,42 +339,15 @@ export default {
total: 40,
},
//
form: {},
form: {} as any,
//
selectionList: [],
//
data: [],
/** 创建线路信息 */
addLineInfo: {
/** 创建线路信息表单 */
addLineForm: {},
/** 线路列表 */
lineList: [{}],
/** 起点信息 */
startInfo: {},
/** 终点信息 */
endInfo: {},
},
/** 新增新节点 */
addNewNodeInfo: {
/** 新增新节点信息 */
addNewNodeForm: {},
/** 地图配置 */
//
params: {
zoom: 10,
// zoomEnable: false,
// dragEnable: false,
},
map: [],
/** 节点列表 */
nodeList: [{}],
/** 节点信息 */
nodeInfo: {},
},
/** 字典 */
clientType: [],
options: [],
debounce,
/** 时间 */
shortcuts: [
{
@ -476,13 +392,39 @@ export default {
if (code !== 200) return;
this.data = data.records;
let _billladingStatusOption = [];
let _chargeTypeOption = [];
for (let i = 0; i < this.columnList.length; i++) {
const value = this.columnList[i];
if (value.prop === 'billladingStatusName') _billladingStatusOption = value.checkarr;
else if (value.prop === 'chargeTypeName') _chargeTypeOption = value.checkarr;
}
for (let i = 0; i < this.data.length; i++) {
const value = this.data[i];
value.billladingStatusName = (
_billladingStatusOption.find(item => item.value === Number(value.billladingStatus)) ||
{}
).label;
value.chargeTypeName = (
_chargeTypeOption.find(item => item.value === Number(value.chargeType)) || {}
).label;
}
console.log('this.data :>> ', this.data);
this.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loading = false;
}
}),
}, 10),
/** 被选中行 */
chooseWaybillInfo: {},
};
},
mounted() {
@ -544,12 +486,11 @@ export default {
selectsc(index, row) {
console.log('index :>> ', index);
console.log('row :>> ', row);
this.query[row.prop] = index;
if (!index) delete this.query[row.prop];
if (row.prop === 'certificateTypeName') {
this.query['certificateType'] = index;
if (!index) delete this.query['certificateType'];
}
const _key = row.prop.replace('Name', '');
this.query[_key] = index;
if (!index) delete this.query[_key];
this.onLoad(this.page);
},
timesc(index, row) {
@ -566,16 +507,18 @@ export default {
inputsc(index, row) {
console.log(index, row);
this.query[row.prop] = index;
if (!index) delete this.query[row.prop];
this.onLoad(this.page);
},
/** 客户查询 */
async remoteMethod(query) {
if (query) {
// this.loading = true;
this.options = [];
} else {
this.options = [];
}
if (!query) return;
const res = await postFindWaybillBillladingList({ waybillNo: query });
const { code, data } = res.data;
if (code !== 200) return (this.options = []);
this.options = data;
},
init() {
this.height = this.setPx(document.body.clientHeight - 160);
@ -616,7 +559,30 @@ export default {
this.onLoad(this.page);
},
/** 表单提交 */
async handleSubmit() {},
async handleSubmit() {
if (!this.form.waybillNo) return this.$message.error('请选择运单');
if (!this.form.num) return this.$message.error('请输入大于0的数量');
try {
this.loadingObj.pageLoading = true;
this.popUpShow.addDistrilbutionVisited = false;
const submitData = {
id: this.chooseWaybillInfo.id,
waybillNo: this.form.waybillNo,
enterNum: this.form.num,
};
const res = await postAddWaybillToBillladingId(submitData);
const { code, msg } = res.data;
if (code === 200) return this.$message.success(msg);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.pageLoading = false;
}
},
/** 新增 */
handleAdd() {
this.$router.push({
@ -697,7 +663,9 @@ export default {
/** 开启添加提货数据弹窗 */
handleAddDistrilbution() {
if (this.selectionList.length === 0) return this.$message.error('最少选择一条数据');
if (this.selectionList.length > 1) return this.$message.error('暂时只支持单条数据操作');
this.title = '添加提货数据';
this.chooseWaybillInfo = this.selectionList[0];
this.popUpShow.addDistrilbutionVisited = true;
},
/** 提货完成 */
@ -916,6 +884,31 @@ export default {
async remoteCodeMethod(query) {
console.log('query :>> ', query);
},
/** 选择运单 */
handleChooseWaybillNo(value) {
console.log('value :>> ', value);
if (!value) this.options = [];
let _item: any = {};
for (let i = 0; i < this.options.length; i++) {
const item = this.options[i];
if (item.waybillNo === value) _item = item;
}
if (_item.totalCount - _item.stockCount === 0) {
this.$message.warning('该运单已全部入库!!!');
this.form = {};
return;
}
this.form.maxNum = _item.totalCount - _item.stockCount;
this.form.destination = _item.destinationWarehouseName || '';
this.form.goodsName = _item.goodsName || '';
this.form.shipperName = _item.shipperName || '';
this.form.shipperMobile = _item.shipperMobile || '';
this.form.consigneeMobile = _item.consigneeMobile || '';
this.form.num = 0;
},
},
activated() {
if (this.$store.state.isRefresh.refreshObj.addArteryDistrilbutionBillLadingList) {
@ -1062,4 +1055,14 @@ export default {
:deep(.avue-input-map) {
width: 100%;
}
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-input-number) {
height: 100% !important;
width: 100% !important;
}
</style>

Loading…
Cancel
Save