新地址
This commit is contained in:
174
src/views/order/historyDelivery/bill.vue
Normal file
174
src/views/order/historyDelivery/bill.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div class="delivery-form">
|
||||
<!-- 表格容器 -->
|
||||
<table border="1" cellpadding="5" cellspacing="0" style="width: 90%; margin: 20px auto; border-collapse: collapse; font-size: 14px;">
|
||||
<!-- 标题行 -->
|
||||
<tr>
|
||||
<td colspan="6" style="text-align: center; font-weight: bold; font-size: 18px;">
|
||||
国网唐山供电公司贾庵子仓库货物配送单
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 配送项目名称 & 项目编号 -->
|
||||
<tr>
|
||||
<td rowspan="2" style="width: 150px;">配送项目名称</td>
|
||||
<td colspan="3">冀北唐山路南区10kV广鑫环网柜等6座环网柜配电自动化改造工程</td>
|
||||
<td rowspan="2">项目编号</td>
|
||||
<td rowspan="2">I801032401LD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
|
||||
<!-- 配送地址 -->
|
||||
<tr>
|
||||
<td>配送地址</td>
|
||||
<td colspan="3">唐山市路南区女织寨赵田庄村民源电气</td>
|
||||
<td>配送日期</td>
|
||||
<td>2025年12月2日</td>
|
||||
</tr>
|
||||
|
||||
<!-- 配送车号 -->
|
||||
<tr>
|
||||
<td>配送车号</td>
|
||||
<td colspan="3">冀B1947L</td>
|
||||
<td>司机签名</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收单位 -->
|
||||
<tr>
|
||||
<td>接收单位</td>
|
||||
<td colspan="3">路南供电中心</td>
|
||||
<td>配送吨数</td>
|
||||
<td>孟利红</td>
|
||||
</tr>
|
||||
|
||||
<!-- 发货人联系方式 -->
|
||||
<tr>
|
||||
<td colspan="3">发货人联系方式姓名:林生/15531558587</td>
|
||||
<td colspan="2">制单</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收人联系 -->
|
||||
<tr>
|
||||
<td colspan="3">接收人联系方式姓名:王小强/18733306661</td>
|
||||
<td colspan="2">出库复核</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<!-- 物资明细表 -->
|
||||
<tr>
|
||||
<td>序号</td>
|
||||
<td>物料编码</td>
|
||||
<td>物资名称</td>
|
||||
<td>数量</td>
|
||||
<td>单位</td>
|
||||
<td>订单号</td>
|
||||
<td>供应商名称</td>
|
||||
<td>备注</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行 1 -->
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>500138342</td>
|
||||
<td>二次融合成套环网箱,AC10kV,630A,固体,二进四出</td>
|
||||
<td>1</td>
|
||||
<td>套</td>
|
||||
<td>101378434</td>
|
||||
<td>宁波奥克斯智能科技股份有限公司</td>
|
||||
<td>ID:169736945</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行 2 -->
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>500138342</td>
|
||||
<td>二次融合成套环网箱,AC10kV,630A,固体,二进四出</td>
|
||||
<td>1</td>
|
||||
<td>套</td>
|
||||
<td>101378434</td>
|
||||
<td>宁波奥克斯智能科技股份有限公司</td>
|
||||
<td>ID:169736952</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收物资状态 -->
|
||||
<tr>
|
||||
<td>接收物资状态</td>
|
||||
<td colspan="7">
|
||||
<label><input type="radio" name="status" checked /> 数量齐全、状态完好</label>
|
||||
<label><input type="radio" name="status" /> 存在问题:</label>
|
||||
<input type="text" style="width: 100%;" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收人确认 -->
|
||||
<tr>
|
||||
<td>接收人确认</td>
|
||||
<td colspan="7">
|
||||
签字:<br /><br />
|
||||
日期:<br />
|
||||
<input type="text" placeholder="年" style="width: 50px;" /> 年
|
||||
<input type="text" placeholder="月" style="width: 50px;" /> 月
|
||||
<input type="text" placeholder="日" style="width: 50px;" /> 日
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 可以从父组件传入数据,如:props
|
||||
// import { ref } from 'vue'
|
||||
// const props = defineProps({
|
||||
// deliveryData: Object
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.delivery-form {
|
||||
font-family: "SimSun", "宋体", sans-serif;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td:first-child {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
/* 表格标题居中 */
|
||||
table tr:first-child td {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* 修正列宽和换行 */
|
||||
td:nth-child(3) {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
/* 调整输入框样式 */
|
||||
input[type="text"] {
|
||||
border: 1px solid #ccc;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
711
src/views/order/historyDelivery/index.vue
Normal file
711
src/views/order/historyDelivery/index.vue
Normal file
@@ -0,0 +1,711 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目的地" prop="destName">
|
||||
<el-input v-model="queryParams.destName" placeholder="请输入目的地" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="配送日期" prop="deliveryDate">
|
||||
<el-date-picker clearable v-model="queryParams.deliveryDate" type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="请选择配送日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="配送车牌" prop="vehiclePlate">
|
||||
<el-input v-model="queryParams.vehiclePlate" placeholder="请输入配送车牌" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="接收单位" prop="receiverOrgName">
|
||||
<el-input v-model="queryParams.receiverOrgName" placeholder="请输入接收单位" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['document:order:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="配送单号" align="center" prop="orderNo" width="200" />
|
||||
<el-table-column label="出库单据号" align="center" prop="billNoCk" width="150" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.billNoCk">{{ scope.row.billNoCk }}</span>
|
||||
<el-tag type="danger" v-else>手动创建</el-tag>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="起始地点名称" align="center" prop="originName" />
|
||||
<el-table-column label="目的地点名称" align="center" prop="destName" />
|
||||
<el-table-column label="配送日期" align="center" prop="deliveryDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送车牌" align="center" prop="plateNo" />
|
||||
<!-- <el-table-column label="配送费" align="center" prop="" /> -->
|
||||
<el-table-column label="发货人姓名" align="center" prop="shipperName" />
|
||||
|
||||
<el-table-column label="接收人姓名" align="center" prop="receiverName" />
|
||||
<el-table-column label="明细数量" align="center" prop="itemCount">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.items.length }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="250">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handlePic(scope.row)">现场照片</el-button>
|
||||
<el-button link type="primary" @click="handleBill(scope.row)">配送单</el-button>
|
||||
<el-button link type="primary" @click="handleHistory(scope.row)">历史轨迹</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改配送单据主对话框 -->
|
||||
<el-dialog title="历史轨迹" v-model="open" :fullscreen="true" append-to-body>
|
||||
|
||||
<div style="position: relative">
|
||||
<div style="position: absolute; right: 10px; top: 10px; z-index: 1">
|
||||
<el-button @click="silderInput">开始回放</el-button>
|
||||
<el-button @click="pauseAnimation">暂停回放</el-button>
|
||||
<el-button @click="resumeAnimation">继续回放</el-button>
|
||||
<!-- <el-slider v-model="sliderVal" :step="1" @input="sliderChange" @change="silderInput" :max="lineArr.length - 1"
|
||||
:min="0"></el-slider> -->
|
||||
</div>
|
||||
<div style="position: absolute; left: 50px; bottom: 30px;z-index: 1; width: 95%; height: 20px; "></div>
|
||||
<div id="amapcontainer" style="width: 100%; height: 770px"></div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="物料明细" v-model="openDetail" append-to-body width="80%">
|
||||
<el-table v-loading="detailLoading" :data="wlList">
|
||||
<el-table-column label="项目号" align="center" prop="xmNo" width="150" />
|
||||
<el-table-column label="项目描述" align="center" prop="xmMs" width="250" />
|
||||
<el-table-column label="物料号" align="center" prop="wlNo" width="100" />
|
||||
<el-table-column label="物料描述" align="center" prop="wlMs" width="250" />
|
||||
<el-table-column label="供应商名称" align="center" prop="gysMc" width="200" />
|
||||
<el-table-column label="合同单价" align="center" prop="htDj" />
|
||||
<el-table-column label="订单编号" align="center" prop="sapNo" width="150" />
|
||||
<el-table-column label="计量单位" align="center" prop="dw" />
|
||||
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120" />
|
||||
<el-table-column label="库位码" align="center" prop="pcode" width="120" />
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" />
|
||||
<el-table-column label="身份码" align="center" prop="entityId" width="200" />
|
||||
<el-table-column label="物资类型" align="center" prop="wlTypeName" />
|
||||
<el-table-column label="所属仓库" align="center" prop="cangkuName" width="150" />
|
||||
|
||||
|
||||
<el-table-column label="库龄" align="center" prop="stockAge" />
|
||||
<el-table-column label="理货员" align="center" prop="lihuoYName" />
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" width="200" />
|
||||
|
||||
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<el-dialog title="配送单" v-model="openBill" append-to-body width="80%">
|
||||
<div class="delivery-form">
|
||||
<!-- 表格容器 -->
|
||||
<table border="1" cellpadding="5" cellspacing="0"
|
||||
style="width: 90%; margin: 20px auto; border-collapse: collapse; font-size: 14px;">
|
||||
<!-- 标题行 -->
|
||||
<tr>
|
||||
<td colspan="8" style="text-align: center; font-weight: bold; font-size: 18px;">
|
||||
国网唐山供电公司贾庵子仓库货物配送单
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 配送项目名称 & 项目编号 -->
|
||||
<tr>
|
||||
<td colspan="2">配送项目名称</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].xmMs : '' }}</td>
|
||||
<td style="width: 100px;">项目编号</td>
|
||||
<td colspan="2">{{ billData.length > 0 ? billData[0].xmNo : '' }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- 配送地址 -->
|
||||
<tr>
|
||||
<td colspan="2">配送地址</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].destName : '' }}</td>
|
||||
<td style="width: 100px;">配送日期</td>
|
||||
<td colspan="2">{{ billData.length > 0 ? billData[0].deliveryDate : '' }}</td>
|
||||
</tr>
|
||||
|
||||
<!-- 配送车号 -->
|
||||
<tr>
|
||||
<td colspan="2">配送车号</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].plateNo : '' }}</td>
|
||||
<td style="width: 100px;">司机签名</td>
|
||||
<td colspan="2">
|
||||
<el-image style="width: 50px; height: 20px"
|
||||
:src="urlFun(billData.length > 0 ? billData[0].attachments : [], 'SIGN_DRIVER')"
|
||||
:preview-src-list="urlFun1(billData.length > 0 ? billData[0].attachments : [], 'SIGN_DRIVER')"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收单位 -->
|
||||
<tr>
|
||||
<td colspan="2">接收单位</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].receiverOrgName : '' }}</td>
|
||||
<td style="width: 100px;">配送吨数</td>
|
||||
<td colspan="2">{{ billData.length > 0 ? billData[0].deliveryTon : '' }}</td>
|
||||
</tr>
|
||||
|
||||
<!-- 发货人联系方式 -->
|
||||
<tr>
|
||||
<td colspan="2">发货人联系方式姓名</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].shipperName : '' }}/{{ billData.length > 0 ?
|
||||
billData[0].shipperPhone : '' }}</td>
|
||||
<td style="width: 100px;">制单</td>
|
||||
<td colspan="2">{{ billData.length > 0 ? billData[0].makerUserName : '' }}</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收人联系 -->
|
||||
<tr>
|
||||
<td colspan="2">接收人联系方式姓名</td>
|
||||
<td colspan="3">{{ billData.length > 0 ? billData[0].receiverName : '' }}/{{ billData.length > 0 ?
|
||||
billData[0].receiverPhone : '' }}</td>
|
||||
<td style="width: 100px;">出库复核</td>
|
||||
<td colspan="2">
|
||||
<el-image style="width: 50px; height: 20px"
|
||||
:src="urlFun(billData.length > 0 ? billData[0].attachments : [], 'SIGN_COURIER')"
|
||||
:preview-src-list="urlFun1(billData.length > 0 ? billData[0].attachments : [], 'SIGN_COURIER')"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 物资明细表 -->
|
||||
<tr>
|
||||
<td style="width: 50px;">序号</td>
|
||||
<td>物料编码</td>
|
||||
<td class="wzmc">物资名称</td>
|
||||
<td>数量</td>
|
||||
<td>单位</td>
|
||||
<td style="width: 100px;">订单号</td>
|
||||
<td>供应商名称</td>
|
||||
<td>备注</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行 1 -->
|
||||
<tr v-for="(item, index) in billData" :key="index">
|
||||
<td style="width: 50px;">{{ index + 1 }}</td>
|
||||
<td>{{ item.wlNo }}</td>
|
||||
<td class="wzmc">{{ item.wlMs }}</td>
|
||||
<td>{{ item.realQty }}</td>
|
||||
<td>{{ item.dw }}</td>
|
||||
<td style="width: 150px;">{{ item.sapNo }}</td>
|
||||
<td>{{ item.gysMc }}</td>
|
||||
<td>{{ item.remark }}</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收物资状态 -->
|
||||
<tr>
|
||||
<td colspan="2">接收物资状态</td>
|
||||
<td colspan="6">
|
||||
<label><input type="radio" name="status"
|
||||
:checked="billData.length > 0 ? (billData[0].receiveStatus == 1 ? 'true' : '') : ''" />
|
||||
数量齐全、状态完好</label>
|
||||
<label><input type="radio" name="status"
|
||||
:checked="billData.length > 0 ? (billData[0].receiveStatus == 2 ? 'checked' : '') : ''" />
|
||||
存在问题:</label>
|
||||
<input type="text" style="width: 70%;"
|
||||
:value="billData.length > 0 ? billData[0].receiveProblem : ''" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 接收人确认 -->
|
||||
<!-- :preview-src-list="srcList" -->
|
||||
<tr>
|
||||
<td colspan="2">接收人确认</td>
|
||||
<td colspan="6">
|
||||
签字:<el-image style="width: 50px; height: 20px"
|
||||
:src="urlFun(billData.length > 0 ? billData[0].attachments : [], 'SIGN_RECEIVER')"
|
||||
:preview-src-list="urlFun1(billData.length > 0 ? billData[0].attachments : [], 'SIGN_RECEIVER')"
|
||||
|
||||
/>
|
||||
<br /><br />
|
||||
日期:
|
||||
<input type="text" readonly style="width: 50px;" :value="deliveryDate.year" /> 年
|
||||
<input type="text" readonly style="width: 50px;" :value="deliveryDate.month" /> 月
|
||||
<input type="text" readonly placeholder="日" style="width: 50px;"
|
||||
:value="deliveryDate.day" /> 日
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="现场照片" v-model="openPic" append-to-body>
|
||||
<div class="demo-image">
|
||||
<div v-for="(fit, index) in picList" :key="index" class="block">
|
||||
<span class="demonstration">{{ bizTypeCn(fit) }}</span>
|
||||
<el-image style="width: 100px; height: 100px" :src="fit.url" :preview-src-list="srcList" />
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Order">
|
||||
import { listOrder, detailOrder, getHistory } from "@/api/waitDelivery/waitDelivery"
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { ref } from "vue";
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const orderList = ref([])
|
||||
const open = ref(false)
|
||||
const openDetail = ref(false)
|
||||
const openBill = ref(false)
|
||||
const openPic = ref(false)
|
||||
const loading = ref(true)
|
||||
const detailLoading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
const wlList = ref([])
|
||||
|
||||
const data = reactive({
|
||||
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderStatus: 3,
|
||||
destName: null, // 目的地名称
|
||||
deliveryDate: null, // 配送日期
|
||||
plateNo: null, // 车牌号
|
||||
receiverOrgName: null // 接收单位
|
||||
},
|
||||
|
||||
})
|
||||
//配送单
|
||||
const billData = ref([])
|
||||
const deliveryDate = ref({})
|
||||
const srcList = ref([])
|
||||
const picList = ref([])
|
||||
const map = ref(null) // 高德地图实例
|
||||
const int = ref(null)
|
||||
const lineArr = ref([]) // 轨迹
|
||||
const marker = ref(null)
|
||||
const polyline = ref(null)
|
||||
const passedPolyline = ref(null)
|
||||
const percentage = ref(50) // 进度条进度
|
||||
const sliderVal = ref(0)
|
||||
const progressTime = ref(0)
|
||||
const markerSpeed = ref(100) // 初始化速度
|
||||
const afterData = ref([])//后面的数据
|
||||
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
/** 查询配送单据主列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listOrder(queryParams.value).then(response => {
|
||||
orderList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
|
||||
proxy.resetForm("orderRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加配送单据主"
|
||||
}
|
||||
|
||||
//明细
|
||||
// function handleDetail(row) {
|
||||
// openDetail.value = true
|
||||
// // detailLoading.value = true
|
||||
// detailOrder({orderNo:row.orderNo}).then(response=>{
|
||||
// // detailLoading.value = false
|
||||
// wlList.value = response.data
|
||||
|
||||
// })
|
||||
|
||||
// }
|
||||
//现场照片
|
||||
function handlePic(row) {
|
||||
openPic.value = true
|
||||
detailOrder({ orderNo: row.orderNo }).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
picList.value = response.data[0].attachments.filter(item => item.bizType == 'PHOTO_SITE' || item.bizType == 'PHOTO_BILL')
|
||||
srcList.value = picList.value.map(item => item.url)
|
||||
}
|
||||
})
|
||||
}
|
||||
function bizTypeCn(row) {
|
||||
if (row.bizType == 'PHOTO_SITE' && row.scene == 'ORIGIN') {
|
||||
return '起点照片'
|
||||
} else if (row.bizType == 'PHOTO_SITE' && row.scene == 'DEST') {
|
||||
return '终点照片'
|
||||
} else if (row.bizType == 'PHOTO_BILL') {
|
||||
return '配送单照片'
|
||||
}
|
||||
}
|
||||
|
||||
//配送单
|
||||
function handleBill(row) {
|
||||
openBill.value = true
|
||||
|
||||
detailOrder({ orderNo: row.orderNo }).then(response => {
|
||||
console.log(2222222)
|
||||
console.log(response)
|
||||
// return
|
||||
// detailLoading.value = false
|
||||
// wlList.value = response.data
|
||||
billData.value = response.data
|
||||
deliveryDate.value = {
|
||||
year: response.data[0].deliveryDate.substring(0, 4),
|
||||
month: response.data[0].deliveryDate.substring(5, 7),
|
||||
day: response.data[0].deliveryDate.substring(8, 10),
|
||||
}
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// billData.value.push(response.data[0])
|
||||
// srcList.value = billData.value[0].attachments.map(item => item.url)
|
||||
// console.log(billData.value)
|
||||
})
|
||||
}
|
||||
function urlFun(attachments, bizType) {
|
||||
// console.log(33333)
|
||||
const onedata = attachments.find((x) => x.bizType == bizType)
|
||||
// srcList.value = onedata ? [onedata.url] : []
|
||||
return onedata ? onedata.url : ''
|
||||
|
||||
// console.log(onedata)
|
||||
}
|
||||
function urlFun1(attachments, bizType) {
|
||||
// console.log(44444)
|
||||
const onedata = attachments.find((x) => x.bizType == bizType)
|
||||
return onedata ? [onedata.url] : []
|
||||
|
||||
// console.log(onedata)
|
||||
}
|
||||
|
||||
|
||||
// 点击历史轨迹按钮,打开弹框
|
||||
async function handleHistory(row) {
|
||||
|
||||
|
||||
const response = await getHistory({ orderNo: row.orderNo, plateNo: row.plateNo })
|
||||
if (response.data.length > 0) {
|
||||
open.value = true
|
||||
// let lonLat = []
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
lineArr.value.push([response.data[i].lng, response.data[i].lat])
|
||||
|
||||
}
|
||||
|
||||
// 轨迹经纬度去重,否定有问题;
|
||||
const uniqueCoordinates = lineArr.value.filter((item, index, self) => {
|
||||
return self.findIndex(t => t[0] === item[0] && t[1] === item[1]) === index;
|
||||
});
|
||||
lineArr.value = uniqueCoordinates;
|
||||
initAMap();
|
||||
}else{
|
||||
proxy.$modal.msgWarning("暂无轨迹");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function initAMap() {
|
||||
AMapLoader.load({
|
||||
key: "27719d64d6131bd1b93a15c49cab39c3", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: [
|
||||
"AMap.Scale",
|
||||
"AMap.ToolBar",
|
||||
"AMap.ControlBar",
|
||||
"AMap.Geocoder",
|
||||
"AMap.Marker",
|
||||
"AMap.CitySearch",
|
||||
"AMap.Geolocation",
|
||||
"AMap.AutoComplete",
|
||||
"AMap.InfoWindow",
|
||||
"AMap.moveAnimation"
|
||||
], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
}).then((AMap) => {
|
||||
// 获取到作为地图容器的DOM元素,创建地图实例
|
||||
map.value = new AMap.Map("amapcontainer", {
|
||||
//设置地图容器id
|
||||
resizeEnable: true,
|
||||
viewMode: "3D", // 使用3D视图
|
||||
zoomEnable: true, // 地图是否可缩放,默认值为true
|
||||
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
|
||||
doubleClickZoom: true, // 地图是否可通过双击鼠标放大地图,默认为true
|
||||
zoom: 17, //初始化地图级别
|
||||
center: [118.201897, 39.70742], // 初始化中心点坐标 北京
|
||||
// mapStyle: "amap://styles/darkblue", // 设置颜色底层
|
||||
});
|
||||
marker.value = new AMap.Marker({
|
||||
position: [118.201897, 39.70742],
|
||||
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
|
||||
offset: new AMap.Pixel(-13, -26),
|
||||
});
|
||||
map.value.add(marker.value);
|
||||
|
||||
// 所有路线轨迹(初始轨迹);
|
||||
polyline.value = new AMap.Polyline({
|
||||
path: lineArr.value,
|
||||
showDir: true,
|
||||
strokeColor: "#28F", //线颜色
|
||||
// strokeOpacity: 1, //线透明度
|
||||
strokeWeight: 6, //线宽
|
||||
// strokeStyle: "solid" //线样式
|
||||
});
|
||||
map.value.add(polyline.value);
|
||||
// 走过的路径
|
||||
passedPolyline.value = new AMap.Polyline({
|
||||
strokeColor: "#AF5", //线颜色
|
||||
strokeWeight: 6, //线宽
|
||||
});
|
||||
map.value.add(passedPolyline.value);
|
||||
map.value.setFitView(); // 根据覆盖物自适应展示地图
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
// 松开手触发
|
||||
function silderInput() {
|
||||
let array = [];
|
||||
if (afterData.value.length === 0) {
|
||||
array = lineArr.value;
|
||||
} else {
|
||||
array = afterData.value
|
||||
}
|
||||
// var that = this;
|
||||
AMap.plugin("AMap.MoveAnimation", () => {
|
||||
progressTime.value = formatSeconds(0);
|
||||
// markerSpeed.value = markerSpeed.value * speedCount.value;//markerSpeed的值是100;
|
||||
marker.value.moveAlong(array, {
|
||||
duration: 500, //可根据实际采集时间间隔设置速度
|
||||
// JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置
|
||||
autoRotation: true,
|
||||
});
|
||||
marker.value.on("moving", (e) => {
|
||||
// lat:34.998553
|
||||
// lng:108.478947
|
||||
let lngs = e.passedPath[e.passedPath.length - 1].lng; // 经度 当前所在的位置信息;
|
||||
let lats = e.passedPath[e.passedPath.length - 1].lat; // 纬度
|
||||
let info = [];
|
||||
info.push('<div style="margin-top: -10px;">');
|
||||
info.push("经度 :" + lngs);
|
||||
info.push("纬度 :" + lats);
|
||||
let infoWindow = new AMap.InfoWindow({
|
||||
content: info.join("<br/>"),
|
||||
offset: new AMap.Pixel(3, -20),
|
||||
});
|
||||
infoWindow.open(map.value, e.target.getPosition());
|
||||
var index = lineArr.value.findIndex(([lng, lat]) => lng === lngs && lat === lats);
|
||||
if (index > 0) {
|
||||
sliderVal.value = index;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function sliderChange(val) {
|
||||
let beforeData = lineArr.value.slice(0, val + 1);//包含val;
|
||||
afterData.value = lineArr.value.slice(val + 1);//不包含val;因为不包含所以不能设置setPostion;
|
||||
let info = [];
|
||||
info.push('<div style="margin-top: -10px;">');
|
||||
info.push("经度 :" + lineArr.value[val][0]);
|
||||
info.push("纬度 :" + lineArr.value[val][1]);
|
||||
let infoWindow = new AMap.InfoWindow({
|
||||
content: info.join("<br/>"),
|
||||
offset: new AMap.Pixel(3, -20),
|
||||
});
|
||||
infoWindow.open(map.value, new AMap.LngLat(lineArr.value[val][0], lineArr.value[val][1]));
|
||||
if (val > 0) {//解决车闪烁问题;
|
||||
marker.value.setPosition(new AMap.LngLat(lineArr.value[val][0], lineArr.value[val][1]));
|
||||
}
|
||||
if (beforeData.length > 0) {
|
||||
passedPolyline.value.setPath(beforeData);//设置走过的路径;
|
||||
}
|
||||
}
|
||||
function monitorInterval() {
|
||||
int.value = setInterval(() => {
|
||||
sliderVal.value += 1 * speedCount.value;
|
||||
}, (TIME_VARIABLE / 100) * 100);
|
||||
}
|
||||
function pauseAnimation() {
|
||||
clearInterval(int.value);
|
||||
marker.value.pauseMove();
|
||||
}
|
||||
function resumeAnimation() {
|
||||
marker.value.resumeMove();
|
||||
}
|
||||
function formatSeconds(value) {
|
||||
var secondTime = parseInt(value); // 秒
|
||||
var minuteTime = 0; // 分
|
||||
var hourTime = 0; // 小时
|
||||
if (secondTime > 60) {
|
||||
minuteTime = parseInt(secondTime / 60);
|
||||
secondTime = parseInt(secondTime % 60);
|
||||
if (minuteTime > 60) {
|
||||
hourTime = parseInt(minuteTime / 60);
|
||||
minuteTime = parseInt(minuteTime % 60);
|
||||
}
|
||||
}
|
||||
var result =
|
||||
parseInt(secondTime) < 10
|
||||
? "0" + parseInt(secondTime)
|
||||
: "" + parseInt(secondTime);
|
||||
result =
|
||||
parseInt(minuteTime) < 10
|
||||
? "0" + parseInt(minuteTime) + ":" + result
|
||||
: "" + parseInt(minuteTime) + ":" + result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('document/order/export', {
|
||||
...queryParams.value
|
||||
}, `order_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
// handleBill({orderNo:'DO20251203155940338'})
|
||||
// handlePic({orderNo:'DO20251203155940338'})
|
||||
</script>
|
||||
<style scoped>
|
||||
.delivery-form {
|
||||
font-family: "SimSun", "宋体", sans-serif;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
max-height: 700px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td:first-child {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
/* 表格标题居中 */
|
||||
table tr:first-child td {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* 修正列宽和换行 */
|
||||
/* td:nth-child(3) {
|
||||
width: 250px;
|
||||
} */
|
||||
|
||||
/* 调整输入框样式 */
|
||||
input[type="text"] {
|
||||
border: none;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wzmc {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.demo-image .block {
|
||||
padding: 30px 0;
|
||||
text-align: center;
|
||||
border-right: solid 1px var(--el-border-color);
|
||||
display: inline-block;
|
||||
width: 20%;
|
||||
min-width: 100px;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.demo-image .block:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.demo-image .demonstration {
|
||||
display: block;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
207
src/views/order/historyDelivery/index_1.vue
Normal file
207
src/views/order/historyDelivery/index_1.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div style="position: relative">
|
||||
<div style="position: absolute; right: 10px; top: 10px; z-index: 1">
|
||||
<el-button @click="silderInput">开始回放</el-button>
|
||||
<el-button @click="pauseAnimation">暂停回放</el-button>
|
||||
<el-button @click="resumeAnimation">继续回放</el-button>
|
||||
<el-slider v-model="sliderVal" :step="1" @input="sliderChange" @change="silderInput" :max="lineArr.length - 1"
|
||||
:min="0"></el-slider>
|
||||
</div>
|
||||
<div style="position: absolute; left: 50px; bottom: 30px;z-index: 1; width: 95%; height: 20px; "></div>
|
||||
<div id="amapcontainer" style="width: 100%; height: 880px"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
export default {
|
||||
name: "map-view",
|
||||
mounted() {
|
||||
// 轨迹经纬度去重,否定有问题;
|
||||
const uniqueCoordinates = this.lineArr.filter((item, index, self) => {
|
||||
return self.findIndex(t => t[0] === item[0] && t[1] === item[1]) === index;
|
||||
});
|
||||
this.lineArr = uniqueCoordinates;
|
||||
this.initAMap();
|
||||
},
|
||||
unmounted() {
|
||||
this.map?.destroy();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
map: null, // 高德地图实例
|
||||
int: null,
|
||||
lineArr: [
|
||||
[116.478935,39.997761],[116.478939,39.997825],[116.478912,39.998549],[116.478912,39.998549],[116.478998,39.998555],[116.478998,39.998555],[116.479282,39.99856],[116.479658,39.998528],[116.480151,39.998453],[116.480784,39.998302],[116.480784,39.998302],[116.481149,39.998184],[116.481573,39.997997],[116.481863,39.997846],[116.482072,39.997718],[116.482362,39.997718],[116.483633,39.998935],[116.48367,39.998968],[116.484648,39.999861]
|
||||
], // 轨迹
|
||||
marker: null,
|
||||
polyline: null,
|
||||
percentage: 50, // 进度条进度
|
||||
sliderVal: 0,
|
||||
progressTime: 0,
|
||||
markerSpeed: 100, // 初始化速度
|
||||
afterData: [],//后面的数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 地图初始化
|
||||
initAMap() {
|
||||
AMapLoader.load({
|
||||
key: "5617ac0ab71c7044bf96edb81b4efc9a", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: [
|
||||
"AMap.Scale",
|
||||
"AMap.ToolBar",
|
||||
"AMap.ControlBar",
|
||||
"AMap.Geocoder",
|
||||
"AMap.Marker",
|
||||
"AMap.CitySearch",
|
||||
"AMap.Geolocation",
|
||||
"AMap.AutoComplete",
|
||||
"AMap.InfoWindow",
|
||||
"AMap.moveAnimation"
|
||||
], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
}).then((AMap) => {
|
||||
// 获取到作为地图容器的DOM元素,创建地图实例
|
||||
this.map = new AMap.Map("amapcontainer", {
|
||||
//设置地图容器id
|
||||
resizeEnable: true,
|
||||
viewMode: "3D", // 使用3D视图
|
||||
zoomEnable: true, // 地图是否可缩放,默认值为true
|
||||
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
|
||||
doubleClickZoom: true, // 地图是否可通过双击鼠标放大地图,默认为true
|
||||
zoom: 17, //初始化地图级别
|
||||
center: [116.397428, 39.90923], // 初始化中心点坐标 北京
|
||||
// mapStyle: "amap://styles/darkblue", // 设置颜色底层
|
||||
});
|
||||
this.marker = new AMap.Marker({
|
||||
position: [116.478935,39.997761],
|
||||
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
|
||||
offset: new AMap.Pixel(-13, -26),
|
||||
});
|
||||
this.map.add(this.marker);
|
||||
|
||||
// 所有路线轨迹(初始轨迹);
|
||||
this.polyline = new AMap.Polyline({
|
||||
path: this.lineArr,
|
||||
showDir: true,
|
||||
strokeColor: "#28F", //线颜色
|
||||
// strokeOpacity: 1, //线透明度
|
||||
strokeWeight: 6, //线宽
|
||||
// strokeStyle: "solid" //线样式
|
||||
});
|
||||
this.map.add(this.polyline);
|
||||
// 走过的路径
|
||||
this.passedPolyline = new AMap.Polyline({
|
||||
strokeColor: "#AF5", //线颜色
|
||||
strokeWeight: 6, //线宽
|
||||
});
|
||||
this.map.add(this.passedPolyline);
|
||||
this.map.setFitView(); // 根据覆盖物自适应展示地图
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
// 松开手触发
|
||||
silderInput() {
|
||||
let array = [];
|
||||
if (this.afterData.length === 0) {
|
||||
array = this.lineArr;
|
||||
} else {
|
||||
array = this.afterData
|
||||
}
|
||||
var that = this;
|
||||
AMap.plugin("AMap.MoveAnimation", () => {
|
||||
that.progressTime = that.formatSeconds(0);
|
||||
that.markerSpeed = that.markerSpeed * that.speedCount;//markerSpeed的值是100;
|
||||
this.marker.moveAlong(array, {
|
||||
duration: 500, //可根据实际采集时间间隔设置速度
|
||||
// JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置
|
||||
autoRotation: true,
|
||||
});
|
||||
this.marker.on("moving", (e) => {
|
||||
// lat:34.998553
|
||||
// lng:108.478947
|
||||
let lngs = e.passedPath[e.passedPath.length - 1].lng; // 经度 当前所在的位置信息;
|
||||
let lats = e.passedPath[e.passedPath.length - 1].lat; // 纬度
|
||||
let info = [];
|
||||
info.push('<div style="margin-top: -10px;">');
|
||||
info.push("经度 :" + lngs);
|
||||
info.push("纬度 :" + lats);
|
||||
let infoWindow = new AMap.InfoWindow({
|
||||
content: info.join("<br/>"),
|
||||
offset: new AMap.Pixel(3, -20),
|
||||
});
|
||||
infoWindow.open(this.map, e.target.getPosition());
|
||||
var index = this.lineArr.findIndex(([lng, lat]) => lng === lngs && lat === lats);
|
||||
if (index > 0) {
|
||||
this.sliderVal = index;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
sliderChange(val) {
|
||||
let beforeData = this.lineArr.slice(0, val + 1);//包含val;
|
||||
this.afterData = this.lineArr.slice(val + 1);//不包含val;因为不包含所以不能设置setPostion;
|
||||
let info = [];
|
||||
info.push('<div style="margin-top: -10px;">');
|
||||
info.push("经度 :" + this.lineArr[val][0]);
|
||||
info.push("纬度 :" + this.lineArr[val][1]);
|
||||
let infoWindow = new AMap.InfoWindow({
|
||||
content: info.join("<br/>"),
|
||||
offset: new AMap.Pixel(3, -20),
|
||||
});
|
||||
infoWindow.open(this.map, new AMap.LngLat(this.lineArr[val][0], this.lineArr[val][1]));
|
||||
if (val > 0) {//解决车闪烁问题;
|
||||
this.marker.setPosition(new AMap.LngLat(this.lineArr[val][0], this.lineArr[val][1]));
|
||||
}
|
||||
if (beforeData.length > 0) {
|
||||
this.passedPolyline.setPath(beforeData);//设置走过的路径;
|
||||
}
|
||||
},
|
||||
monitorInterval() {
|
||||
this.int = setInterval(() => {
|
||||
this.sliderVal += 1 * this.speedCount;
|
||||
}, (TIME_VARIABLE / 100) * 100);
|
||||
},
|
||||
// 暂停回放
|
||||
pauseAnimation() {
|
||||
clearInterval(this.int);
|
||||
this.marker.pauseMove();
|
||||
},
|
||||
// 继续回放
|
||||
resumeAnimation() {
|
||||
this.marker.resumeMove();
|
||||
},
|
||||
formatSeconds(value) {
|
||||
var secondTime = parseInt(value); // 秒
|
||||
var minuteTime = 0; // 分
|
||||
var hourTime = 0; // 小时
|
||||
if (secondTime > 60) {
|
||||
minuteTime = parseInt(secondTime / 60);
|
||||
secondTime = parseInt(secondTime % 60);
|
||||
if (minuteTime > 60) {
|
||||
hourTime = parseInt(minuteTime / 60);
|
||||
minuteTime = parseInt(minuteTime % 60);
|
||||
}
|
||||
}
|
||||
var result =
|
||||
parseInt(secondTime) < 10
|
||||
? "0" + parseInt(secondTime)
|
||||
: "" + parseInt(secondTime);
|
||||
result =
|
||||
parseInt(minuteTime) < 10
|
||||
? "0" + parseInt(minuteTime) + ":" + result
|
||||
: "" + parseInt(minuteTime) + ":" + result;
|
||||
return result;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
679
src/views/order/outWarehouse/index.vue
Normal file
679
src/views/order/outWarehouse/index.vue
Normal file
@@ -0,0 +1,679 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-splitter>
|
||||
<el-splitter-panel size="40%">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" label-width="90">
|
||||
<el-row >
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item label="单据号" prop="billNoCk">
|
||||
<el-input
|
||||
v-model="queryParams.billNoCk"
|
||||
placeholder="请输入单据号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14" >
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!-- @selection-change="printSelectionChange" -->
|
||||
<el-table v-loading="loading" highlight-current-row :data="billList" @row-dblclick="billClick" >
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="单据号" align="center" prop="billNoCk" width="150" />
|
||||
<el-table-column label="库存状态" align="center" >
|
||||
<template #default="scope">
|
||||
<span>{{ isChukuFun(scope.row.isChuku) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="理货员" align="center" prop="ckLihuoY" />
|
||||
<!-- <el-table-column label="入库类型" align="center" prop="rkTypeName" width="100"/> -->
|
||||
<el-table-column label="出库时间" align="center" prop="lyTime" width="170">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.lyTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="delieryReceipt(scope.row.billNo)">生成配送单</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="所属仓库" align="center" prop="cangkuName" /> -->
|
||||
</el-table>
|
||||
<!-- 分页暂时注释掉 -->
|
||||
<!-- <pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/> -->
|
||||
<!-- <el-pagination background layout="prev, pager, next" :total="total" v-model:page="queryParams.pageNum" @pagination="getList"/> -->
|
||||
</el-splitter-panel>
|
||||
<el-splitter-panel :min="200">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="mini"
|
||||
@click="delieryReceipt()"
|
||||
:disabled="multiple"
|
||||
>生成配送单</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table v-loading="detailLoading" show-overflow-tooltip :data="stockList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="库存状态" align="center" >
|
||||
<template #default="scope">
|
||||
<span>{{ isChukuFun(scope.row.isChuku) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目号" align="center" prop="xmNo" width="150"/>
|
||||
<el-table-column label="项目描述" align="center" prop="xmMs" width="250"/>
|
||||
<el-table-column label="物料号" align="center" prop="wlNo" width="100"/>
|
||||
<el-table-column label="物料描述" align="center" prop="wlMs" width="250"/>
|
||||
<el-table-column label="供应商名称" align="center" prop="gysMc" width="200"/>
|
||||
<el-table-column label="合同单价" align="center" prop="htDj" />
|
||||
<el-table-column label="订单编号" align="center" prop="sapNo" width="150"/>
|
||||
<el-table-column label="计量单位" align="center" prop="dw" />
|
||||
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120"/>
|
||||
<el-table-column label="库位码" align="center" prop="pcode" width="120"/>
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" />
|
||||
<el-table-column label="身份码" align="center" prop="entityId" width="200"/>
|
||||
<el-table-column label="入库类型" align="center" prop="rkTypeName" width="150"/>
|
||||
<el-table-column label="物资类型" align="center" prop="wlTypeName" width="120"/>
|
||||
<el-table-column label="所属仓库" align="center" prop="cangkuName" width="150"/>
|
||||
<el-table-column label="入库时间" align="center" prop="rkTime" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.rkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="还料时间" align="center" prop="returnTime" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="出库时间" align="center" prop="lyTime" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.lyTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="库龄" align="center" prop="stockAge" /> -->
|
||||
<el-table-column label="理货员" align="center" prop="lihuoYName" />
|
||||
<!-- <el-table-column label="现场图片" align="center" v-if="isExamine==1">
|
||||
<template #default="scope">
|
||||
<el-image :src="scope.row.scenePhotoUrl" style="width:50px;height: 50px;"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="srcList"
|
||||
show-progress
|
||||
:initial-index="4"
|
||||
:preview-teleported="true"
|
||||
@click="preview(scope.row.scenePhotoUrl)"/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" width="200"/>
|
||||
<!-- fixed="right" -->
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-splitter-panel>
|
||||
</el-splitter>
|
||||
<el-dialog title="生成配送单" v-model="dialogPicDetailVisible">
|
||||
<div class="container">
|
||||
<div class="billBox"><span>出库单号:</span><span>{{ detailQueryParams.billNoCk }}</span></div>
|
||||
<el-form :model="delieryData" ref="form" :rules="rules" label-width="100">
|
||||
<el-divider content-position="left">配送信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="起点" prop="originName">
|
||||
<el-input
|
||||
v-model="delieryData.originName"
|
||||
placeholder="请输入起点"
|
||||
clearable
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终点" prop="destName">
|
||||
<el-input
|
||||
v-model="delieryData.destName"
|
||||
placeholder="请输入终点"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配送人" prop="shipperName">
|
||||
<el-select v-model="delieryData.shipperName" placeholder="请选择配送人" clearable >
|
||||
<el-option v-for="dict in personList" :key="dict.userId" :label="dict.userName" :value="dict.userName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配送人电话" prop="shipperPhone">
|
||||
<el-input
|
||||
v-model="delieryData.shipperPhone"
|
||||
placeholder="请输入配送人电话"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收货人" prop="receiverName">
|
||||
<el-input
|
||||
v-model="delieryData.receiverName"
|
||||
placeholder="请输入收货人"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收货人电话" prop="receiverPhone">
|
||||
<el-input
|
||||
v-model="delieryData.receiverPhone"
|
||||
placeholder="请输入收货人电话"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="接收单位" prop="receiverOrgName">
|
||||
<el-input
|
||||
v-model="delieryData.receiverOrgName"
|
||||
placeholder="请输入接收单位"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配送日期" prop="deliveryDate">
|
||||
|
||||
<el-date-picker
|
||||
v-model="delieryData.deliveryDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider content-position="left">货物信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重量" prop="deliveryTon">
|
||||
<el-input
|
||||
v-model="delieryData.deliveryTon"
|
||||
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体积" prop="goodsSize">
|
||||
<el-input
|
||||
v-model="delieryData.goodsSize"
|
||||
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公里数" prop="totalKm">
|
||||
<el-input
|
||||
v-model="delieryData.totalKm"
|
||||
placeholder="请输入公里数"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button type="primary" @click="calculateFun(null)">计算</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider content-position="left">计算信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="推荐车型" prop="vehicleTypeId">
|
||||
<el-select v-model="delieryData.vehicleTypeId" placeholder="请选择推荐车型" clearable @change="changeCarType">
|
||||
<el-option v-for="dict in carTypeList" :key="dict.id" :label="dict.typeName" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="建议费用" prop="suggestFee">
|
||||
<el-input
|
||||
v-model="delieryData.suggestFee"
|
||||
placeholder=""
|
||||
clearable
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="outWarehouse">
|
||||
// wisdomDelStock
|
||||
import {listBill,listStock,calculate,addDelivery} from "@/api/outWarehouse/outWarehouse";
|
||||
import { listType } from "@/api/document/type"
|
||||
// import { getToken } from "@/utils/auth";
|
||||
// import {warehousingDict} from "@/api/information/warehousingtype"; //入库类型
|
||||
// import {materialtypeDict} from "@/api/information/materialtype"; //物资类型
|
||||
// import {warehouseDict} from "@/api/information/warehouseinfo"; //所属仓库
|
||||
import {listUser} from "@/api/system/user"; //理货员
|
||||
// import {getKwList} from "@/api/information/pcdedetail"; //库位下拉数据
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
// import { onMounted, onUnmounted } from "vue";
|
||||
// import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
|
||||
// let map = null;
|
||||
|
||||
// onMounted(() => {
|
||||
// AMapLoader.load({
|
||||
// key: "5617ac0ab71c7044bf96edb81b4efc9a", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
// version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
// plugins: [], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
// })
|
||||
// .then((AMap) => {
|
||||
// map = new AMap.Map("container", {
|
||||
// // 设置地图容器id
|
||||
// viewMode: "3D", // 是否为3D地图模式
|
||||
// zoom: 11, // 初始化地图级别
|
||||
// center: [116.397428, 39.90923], // 初始化地图中心点位置
|
||||
// });
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// console.log(e);
|
||||
// });
|
||||
// });
|
||||
|
||||
// onUnmounted(() => {
|
||||
// map?.destroy();
|
||||
// });
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const billList = ref([]); //单据列表
|
||||
const stockList = ref([]); //明细列表
|
||||
|
||||
const loading = ref(true);
|
||||
const detailLoading = ref(false); //加载列表详情
|
||||
const showSearch = ref(true);
|
||||
|
||||
const total = ref(0); //单据
|
||||
const detailTotal = ref(0); //明细
|
||||
|
||||
const printList = ref([]) //要打印的数据列表
|
||||
|
||||
|
||||
|
||||
const rkTime = ref([])
|
||||
const isExamine = ref(0) //是否需要开启审核 1开启;0不开启
|
||||
|
||||
|
||||
const srcList = ref([])
|
||||
const personList = ref([]); //理货员下拉数据
|
||||
const carTypeList = ref([]) //推荐车型下拉数据
|
||||
// const itemList = ref([])
|
||||
// const fileList = ref([])
|
||||
|
||||
const dialogPicDetailVisible = ref(false)
|
||||
const multiple = ref(true)
|
||||
|
||||
|
||||
const data = reactive({
|
||||
fileList:[],
|
||||
form: {},
|
||||
//配送单提交的数据
|
||||
delieryData:{
|
||||
deliveryTon:0, //重量
|
||||
goodsSize:0, //体积
|
||||
items:[]
|
||||
},
|
||||
|
||||
queryParams: {
|
||||
// keyword:"",
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
|
||||
},
|
||||
detailQueryParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 200,
|
||||
id:null,
|
||||
billNoCk:""
|
||||
},
|
||||
rules: {
|
||||
originName: [{ required: true, message: "起点不能为空", trigger: "change" }],
|
||||
destName: [{ required: true, message: "终点不能为空", trigger: "change" }],
|
||||
shipperName: [{ required: true, message: "配送人不能为空", trigger: "change" }],
|
||||
receiverName: [{ required: true, message: "收货人不能为空", trigger: "change" }],
|
||||
receiverPhone: [{ required: true, message: "收货人电话不能为空", trigger: "change" }],
|
||||
deliveryTon: [{ required: true, message: "重量不能为空", trigger: "change" }],
|
||||
goodsSize: [{ required: true, message: "体积不能为空", trigger: "change" }],
|
||||
totalKm: [{ required: true, message: "公里数不能为空", trigger: "change" }],
|
||||
vehicleTypeId: [{ required: true, message: "推荐车型不能为空", trigger: "change" }],
|
||||
suggestFee: [{ required: true, message: "建议费用不能为空", trigger: "change" }],
|
||||
deliveryDate:[{ required: true, message: "配送日期不能为空", trigger: "change" }]
|
||||
},
|
||||
switchRules:{
|
||||
toCangku:[{ required: true, message: "目标仓库不能为空", trigger: "change" }],
|
||||
toPcode:[{ required: true, message: "目标存放位置不能为空", trigger: "change" }],
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const { queryParams,detailQueryParams,delieryData,rules } = toRefs(data);
|
||||
//生成配送单弹框
|
||||
function delieryReceipt(){
|
||||
|
||||
dialogPicDetailVisible.value = true
|
||||
//理货员下拉数据
|
||||
listUser().then(response=>{
|
||||
personList.value = response.rows
|
||||
})
|
||||
//车型下拉数据
|
||||
listType({pageNum:1,pageSize:1000}).then(response => {
|
||||
carTypeList.value = response.rows
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//双击单据,查询明细
|
||||
function billClick(row){
|
||||
//console.log(row)
|
||||
// return
|
||||
|
||||
if(row.billNoCk){
|
||||
detailLoading.value = true;
|
||||
// detailQueryParams.value.id = row.id
|
||||
// detailQueryParams.value.billNoCk = row.billNoCk
|
||||
// detailList()
|
||||
let detailList = row.detailList
|
||||
for(let i=0;i<detailList.length;i++){
|
||||
detailList[i].deliveryTon = (Number(detailList[i].weightKg) * Number(detailList[i].realQty)).toFixed(3);
|
||||
detailList[i].goodsSize = (Number(detailList[i].volumeM3) * Number(detailList[i].realQty)).toFixed(3);
|
||||
}
|
||||
stockList.value = detailList
|
||||
// detailTotal.value = response.total;
|
||||
detailLoading.value = false;
|
||||
}
|
||||
|
||||
}
|
||||
//查询明细列表数据方法(不查了,改成从数据里直接取了)
|
||||
function detailList(){
|
||||
listStock(detailQueryParams.value).then(response => {
|
||||
// console.log(response)
|
||||
// return
|
||||
for(let i=0;i<response.rows.length;i++){
|
||||
response.rows[i].deliveryTon = (Number(response.rows[i].weightKg) * Number(response.rows[i].realQty)).toFixed(3);
|
||||
response.rows[i].goodsSize = (Number(response.rows[i].volumeM3) * Number(response.rows[i].realQty)).toFixed(3);
|
||||
}
|
||||
stockList.value = response.rows
|
||||
detailTotal.value = response.total;
|
||||
detailLoading.value = false;
|
||||
});
|
||||
}
|
||||
function isChukuFun(isChuku){
|
||||
// scope.row.isChuku==0?"已入库":(scope.row.isChuku==1?"已出库":"审批中")
|
||||
return "已出库"
|
||||
}
|
||||
|
||||
|
||||
|
||||
function preview(url){
|
||||
srcList.value = [url]
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 查询库存单据主列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
// console.log(333333)
|
||||
listBill(queryParams.value).then(response => {
|
||||
// console.log(response)
|
||||
billList.value = response.data;
|
||||
// total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
|
||||
if(rkTime.value && rkTime.value.length>0){
|
||||
queryParams.value.startTime = rkTime.value[0]
|
||||
queryParams.value.endTime = rkTime.value[1]
|
||||
}else{
|
||||
queryParams.value.startTime = ""
|
||||
queryParams.value.endTime = ""
|
||||
}
|
||||
queryParams.value.pageNum = 1;
|
||||
if(printList.value.length>0){
|
||||
queryParams.value.ids = printList.value.map( item => item.id )
|
||||
}
|
||||
// console.log(queryParams.value)
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
rkTime.value = []
|
||||
// queryParams.value.startTime = ""
|
||||
// queryParams.value.endTime = ""
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
|
||||
|
||||
// console.log(selection)
|
||||
delieryData.value.deliveryTon = 0
|
||||
delieryData.value.goodsSize = 0
|
||||
if(selection.length>0){
|
||||
for(let i=0;i<selection.length;i++){
|
||||
delieryData.value.deliveryTon += Number(selection[i].deliveryTon)
|
||||
delieryData.value.goodsSize += Number(selection[i].goodsSize)
|
||||
selection[i].rkInfoId = selection[i].id
|
||||
|
||||
}
|
||||
delieryData.value.items = selection
|
||||
// selection.forEach(element => {
|
||||
// delieryData.value.deliveryTon += Number(element.deliveryTon)
|
||||
// delieryData.value.goodsSize += Number(element.goodsSize)
|
||||
|
||||
// });
|
||||
}else{
|
||||
delieryData.value.deliveryTon = 0
|
||||
delieryData.value.goodsSize = 0
|
||||
delieryData.value.items = []
|
||||
}
|
||||
delieryData.value.deliveryTon = delieryData.value.deliveryTon.toFixed(3) / 1000
|
||||
delieryData.value.goodsSize = delieryData.value.goodsSize.toFixed(3)
|
||||
|
||||
// this.ids = selection.map(item => item.id)
|
||||
// single.value = selection.length!==1
|
||||
multiple.value = !selection.length
|
||||
|
||||
}
|
||||
//根据重量、体积、公里数计算车型、费用
|
||||
function calculateFun(vehicleTypeId){
|
||||
if(!delieryData.value.deliveryTon || !delieryData.value.goodsSize || !delieryData.value.totalKm){
|
||||
proxy.$modal.msgWarning("请输入公里数、重量、体积");
|
||||
return
|
||||
}
|
||||
let info = {
|
||||
weightTon:0,
|
||||
volumeM3:0,
|
||||
distanceKm:0,
|
||||
vehicleTypeId:vehicleTypeId
|
||||
}
|
||||
info.weightTon = delieryData.value.deliveryTon
|
||||
info.volumeM3 = delieryData.value.goodsSize
|
||||
info.distanceKm = delieryData.value.totalKm
|
||||
if(vehicleTypeId){
|
||||
info.vehicleTypeId = vehicleTypeId
|
||||
}
|
||||
calculate(info).then(response=>{
|
||||
// 检查后端是否返回了错误信息
|
||||
if(response.data.errorMessage) {
|
||||
// 如果有错误信息,显示给用户,并清空相关字段
|
||||
proxy.$modal.msgError(response.data.errorMessage);
|
||||
if(!vehicleTypeId){
|
||||
delieryData.value.vehicleTypeId = null;
|
||||
}
|
||||
delieryData.value.suggestFee = null;
|
||||
delieryData.value.vehicleTypeName = null;
|
||||
} else {
|
||||
// 没有错误信息,正常处理返回的车型信息
|
||||
if(!vehicleTypeId){
|
||||
delieryData.value.vehicleTypeId = response.data.vehicleTypeId;
|
||||
}
|
||||
delieryData.value.suggestFee = response.data.suggestFee;
|
||||
delieryData.value.vehicleTypeName = response.data.vehicleTypeName;
|
||||
}
|
||||
// console.log(response)
|
||||
})
|
||||
}
|
||||
//切换车型
|
||||
function changeCarType(id){
|
||||
if(!delieryData.value.totalKm || !delieryData.value.deliveryTon || !delieryData.value.goodsSize){
|
||||
proxy.$modal.msgWarning("请输入公里数、重量、体积");
|
||||
return
|
||||
}
|
||||
calculateFun(id)
|
||||
}
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
dialogPicDetailVisible.value = false
|
||||
reset()
|
||||
}
|
||||
function reset() {
|
||||
delieryData.value = {
|
||||
originName: null,
|
||||
destName: null,
|
||||
shipperName: null,
|
||||
shipperPhone: null,
|
||||
receiverName: null,
|
||||
receiverPhone: null,
|
||||
receiverOrgName: null,
|
||||
deliveryDate: null,
|
||||
deliveryTon: null,
|
||||
goodsSize: null,
|
||||
totalKm: null,
|
||||
vehicleTypeId: null,
|
||||
suggestFee: null,
|
||||
vehicleTypeName: null
|
||||
}
|
||||
// this.resetForm("form")
|
||||
proxy.resetForm("queryRef");
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["form"].validate(valid => {
|
||||
// console.log(delieryData.value)
|
||||
// return
|
||||
if (valid) {
|
||||
addDelivery(delieryData.value).then(response => {
|
||||
proxy.$modal.msgSuccess("操作成功")
|
||||
dialogPicDetailVisible.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//数据列表
|
||||
getList();
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-table .warning-row {
|
||||
--el-table-tr-bg-color: var(--el-color-warning-light-9);
|
||||
}
|
||||
.el-table .success-row {
|
||||
--el-table-tr-bg-color: var(--el-color-success-light-9);
|
||||
}
|
||||
.titleBox{
|
||||
text-align: center;
|
||||
}
|
||||
.topBox{
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
}
|
||||
.bottomBox{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.oneLineBox{
|
||||
display: flex;
|
||||
}
|
||||
.everyBox{
|
||||
width: 30%;
|
||||
}
|
||||
.examine{
|
||||
margin-top: 20px;
|
||||
height: 100px;
|
||||
background-color: #ededed;
|
||||
padding: 20px 0 0 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.billBox{
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
730
src/views/order/waitDelivery/index.vue
Normal file
730
src/views/order/waitDelivery/index.vue
Normal file
@@ -0,0 +1,730 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" label-width="80px">
|
||||
<el-row >
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目的地" prop="destName">
|
||||
<el-input
|
||||
v-model="queryParams.destName"
|
||||
placeholder="请输入目的地"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="配送日期" prop="deliveryDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.deliveryDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择配送日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="配送车牌" prop="vehiclePlate">
|
||||
<el-input
|
||||
v-model="queryParams.vehiclePlate"
|
||||
placeholder="请输入配送车牌"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="接收单位" prop="receiverOrgName">
|
||||
<el-input
|
||||
v-model="queryParams.receiverOrgName"
|
||||
placeholder="请输入接收单位"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="配送状态" >
|
||||
<el-select v-model="queryParams.orderStatus" placeholder="请选择配送状态" clearable style="width: 100%;" >
|
||||
<el-option label="待配送" value="1" />
|
||||
<el-option label="配送中" value="2" />
|
||||
<el-option label="已完成" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['document:order:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAddBill"
|
||||
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="配送单号" align="center" prop="orderNo" width="200"/>
|
||||
<el-table-column label="出库单据号" align="center" prop="billNoCk" width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.billNoCk">{{ scope.row.billNoCk }}</span>
|
||||
<el-tag type="danger" v-else>手动创建</el-tag>
|
||||
</template>
|
||||
<!-- <template #default="scope">
|
||||
<span>{{ scope.row.billNoCk || '手动创建' }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="起始地点名称" align="center" prop="originName" width="120"/>
|
||||
<el-table-column label="目的地点名称" align="center" prop="destName" width="150"/>
|
||||
<el-table-column label="配送日期" align="center" prop="deliveryDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送车牌" align="center" prop="plateNo" />
|
||||
<el-table-column label="发货人姓名" align="center" prop="shipperName" />
|
||||
<el-table-column label="接收人姓名" align="center" prop="receiverName" />
|
||||
<el-table-column label="接收单位" align="center" prop="receiverOrgName" width="150" />
|
||||
<el-table-column label="明细数量" align="center" prop="itemCount">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.items.length }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="orderStatus" >
|
||||
<template #default="scope">
|
||||
<span>{{ statusFun(scope.row.orderStatus) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleDetail(scope.row)" >明细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改配送单据主对话框 -->
|
||||
<el-dialog title="物料明细" v-model="open" append-to-body width="80%">
|
||||
<el-table v-loading="detailLoading" :data="wlList" show-overflow-tooltip>
|
||||
<el-table-column label="项目号" align="center" prop="xmNo" width="150"/>
|
||||
<el-table-column label="项目描述" align="center" prop="xmMs" width="250"/>
|
||||
<el-table-column label="物料号" align="center" prop="wlNo" width="100"/>
|
||||
<el-table-column label="物料描述" align="center" prop="wlMs" width="250"/>
|
||||
<el-table-column label="供应商名称" align="center" prop="gysMc" width="200"/>
|
||||
<!-- <el-table-column label="合同单价" align="center" prop="htDj" /> -->
|
||||
<el-table-column label="订单编号" align="center" prop="sapNo" width="150"/>
|
||||
<el-table-column label="计量单位" align="center" prop="dw" />
|
||||
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120"/>
|
||||
<!-- <el-table-column label="库位码" align="center" prop="pcode" width="120"/> -->
|
||||
<!-- <el-table-column label="托盘码" align="center" prop="trayCode" /> -->
|
||||
<!-- <el-table-column label="身份码" align="center" prop="entityId" width="200"/> -->
|
||||
<!-- <el-table-column label="物资类型" align="center" prop="wlTypeName" /> -->
|
||||
<!-- <el-table-column label="所属仓库" align="center" prop="cangkuName" width="150"/> -->
|
||||
|
||||
|
||||
<!-- <el-table-column label="库龄" align="center" prop="stockAge" /> -->
|
||||
<!-- <el-table-column label="理货员" align="center" prop="lihuoYName" /> -->
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" width="200"/>
|
||||
|
||||
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<el-dialog title="添加配送单" v-model="openBill" append-to-body width="80%" :close-on-click-modal="false">
|
||||
<div class="container">
|
||||
<el-form :model="delieryData" ref="form" :rules="rules" label-width="100">
|
||||
<el-divider content-position="left">配送信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="起点" prop="originName">
|
||||
<el-input
|
||||
v-model="delieryData.originName"
|
||||
placeholder="请输入起点"
|
||||
clearable
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="终点" prop="destName">
|
||||
<el-input
|
||||
v-model="delieryData.destName"
|
||||
placeholder="请输入终点"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配送人" prop="shipperName">
|
||||
<el-select v-model="delieryData.shipperName" placeholder="请选择配送人" clearable >
|
||||
<el-option v-for="dict in personList" :key="dict.userId" :label="dict.userName" :value="dict.userName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配送人电话" prop="shipperPhone">
|
||||
<el-input
|
||||
v-model="delieryData.shipperPhone"
|
||||
placeholder="请输入配送人电话"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收货人" prop="receiverName">
|
||||
<el-input
|
||||
v-model="delieryData.receiverName"
|
||||
placeholder="请输入收货人"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收货人电话" prop="receiverPhone">
|
||||
<el-input
|
||||
v-model="delieryData.receiverPhone"
|
||||
placeholder="请输入收货人电话"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="接收单位" prop="receiverOrgName">
|
||||
<el-input
|
||||
v-model="delieryData.receiverOrgName"
|
||||
placeholder="请输入接收单位"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配送日期" prop="deliveryDate">
|
||||
|
||||
<el-date-picker
|
||||
v-model="delieryData.deliveryDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider content-position="left">
|
||||
货物信息
|
||||
<el-button type="primary" size="small" @click="addLineFun" >添加</el-button>
|
||||
</el-divider>
|
||||
<!-- <el-row>
|
||||
<el-col :span="4" :offset="22">
|
||||
<el-button type="primary" size="small" @click="addLineFun" >添加</el-button>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<el-table :data="goodsList" max-height="300" show-overflow-tooltip :row-class-name="tableRowClassName" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="30" align="center" /> -->
|
||||
<el-table-column width="40" align="center" >
|
||||
<template #default="scope" >
|
||||
<el-icon :size="22" @click="delLineFun(scope.$index)"><RemoveFilled /></el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料号" align="center" prop="wlNo" width="150">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.wlNo" placeholder="请输入物料号" ></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料描述" align="center" prop="wlMs" width="200">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.wlMs" placeholder="请输入物料描述"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" prop="htDj" width="80">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.htDj" ></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="dw" width="80">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.dw" ></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="配送数量" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.realQty" placeholder="配送数量" @change="changeQty(scope.row.realQty,scope.$index)"></el-input>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="采购订单号" align="center" prop="sapNo" width="130" >
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.sapNo" placeholder="请输入订单号"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目号" align="center" prop="xmNo" width="150">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.xmNo" placeholder="项目定义号"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" prop="xmMs" width="300">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.xmMs" placeholder="项目名称"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" prop="gysMc" width="200">
|
||||
<template #default="scope" >
|
||||
<el-input v-model="scope.row.gysMc" placeholder="供应商"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入备注"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
<el-divider content-position="left">计算信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="重量" prop="deliveryTon">
|
||||
<el-input
|
||||
v-model="delieryData.deliveryTon"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="体积" prop="goodsSize">
|
||||
<el-input
|
||||
v-model="delieryData.goodsSize"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="公里数" prop="totalKm">
|
||||
<el-input
|
||||
v-model="delieryData.totalKm"
|
||||
placeholder="请输入公里数"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button type="primary" @click="calculateFun(null)">计算</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="推荐车型" prop="vehicleTypeId">
|
||||
<el-select v-model="delieryData.vehicleTypeId" placeholder="请选择推荐车型" clearable @change="changeCarType">
|
||||
<el-option v-for="dict in carTypeList" :key="dict.id" :label="dict.typeName" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="建议费用" prop="suggestFee">
|
||||
<el-input
|
||||
v-model="delieryData.suggestFee"
|
||||
placeholder=""
|
||||
clearable
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Order">
|
||||
import { listOrder,detailOrder,calcTotalWv,calculate,addDelivery } from "@/api/waitDelivery/waitDelivery"
|
||||
import { listType } from "@/api/document/type"
|
||||
import {listUser} from "@/api/system/user"; //理货员
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const orderList = ref([])
|
||||
const open = ref(false)
|
||||
const openBill = ref(false)
|
||||
const loading = ref(true)
|
||||
const detailLoading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
const wlList = ref([])
|
||||
const goodsList = ref([])
|
||||
const carTypeList = ref([]) //推荐车型下拉数据
|
||||
const personList = ref([]); //理货员下拉数据
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
// orderStatusList:[1,2],
|
||||
destName:null, // 目的地名称
|
||||
deliveryDate:null, // 配送日期
|
||||
plateNo:null, // 车牌号
|
||||
receiverOrgName:null, // 接收单位
|
||||
orderStatus:null,
|
||||
// xmMs: null,
|
||||
// xmNo: null,
|
||||
// wlNo: null,
|
||||
// wlMs: null,
|
||||
// realQty: null,
|
||||
// dw: null,
|
||||
// sapNo: null,
|
||||
// gysMc: null,
|
||||
// originName: null,
|
||||
// originLng: null,
|
||||
// originLat: null,
|
||||
// destName: null,
|
||||
// destLng: null,
|
||||
// destLat: null,
|
||||
// deliveryDate: null,
|
||||
// vehiclePlate: null,
|
||||
// shipperName: null,
|
||||
// shipperPhone: null,
|
||||
// receiverName: null,
|
||||
// receiverPhone: null,
|
||||
// receiverOrgName: null,
|
||||
// deliveryTon: null,
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
originName: [{ required: true, message: "起点不能为空", trigger: "change" }],
|
||||
destName: [{ required: true, message: "终点不能为空", trigger: "change" }],
|
||||
shipperName: [{ required: true, message: "配送人不能为空", trigger: "change" }],
|
||||
receiverName: [{ required: true, message: "收货人不能为空", trigger: "change" }],
|
||||
receiverPhone: [{ required: true, message: "收货人电话不能为空", trigger: "change" }],
|
||||
deliveryTon: [{ required: true, message: "重量不能为空", trigger: "change" }],
|
||||
goodsSize: [{ required: true, message: "体积不能为空", trigger: "change" }],
|
||||
totalKm: [{ required: true, message: "公里数不能为空", trigger: "change" }],
|
||||
vehicleTypeId: [{ required: true, message: "推荐车型不能为空", trigger: "change" }],
|
||||
suggestFee: [{ required: true, message: "建议费用不能为空", trigger: "change" }],
|
||||
deliveryDate:[{ required: true, message: "配送日期不能为空", trigger: "change" }]
|
||||
},
|
||||
//配送单提交的数据
|
||||
delieryData:{
|
||||
deliveryTon:null, //重量
|
||||
goodsSize:null, //体积
|
||||
items:[]
|
||||
},
|
||||
})
|
||||
|
||||
const { queryParams, form,delieryData,rules } = toRefs(data)
|
||||
|
||||
/** 查询配送单据主列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listOrder(queryParams.value).then(response => {
|
||||
orderList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
//添加货物信息
|
||||
function addLineFun(){
|
||||
|
||||
const info = {
|
||||
dw:'',
|
||||
htDj:'',
|
||||
realQty:'',
|
||||
gysMc:'',
|
||||
wlNo:'',
|
||||
wlMs:'',
|
||||
sapNo:'',
|
||||
xmNo:'',
|
||||
xmMs:'',
|
||||
gysMc:'',
|
||||
remark:'',
|
||||
billNoCk:''
|
||||
}
|
||||
|
||||
goodsList.value.push(info)
|
||||
}
|
||||
function delLineFun(index){
|
||||
// console.log(index)
|
||||
proxy.$modal.confirm('确定删除吗?').then(function() {
|
||||
|
||||
goodsList.value.splice(index,1)
|
||||
changeQty()
|
||||
return true
|
||||
// console.log(goodsList.value)
|
||||
}).then(() => {
|
||||
|
||||
}).catch(() => {});
|
||||
// if(checkPlanList.value.length==0){
|
||||
// proxy.$modal.msgWarning("请勾选数据");
|
||||
// return
|
||||
// }
|
||||
|
||||
}
|
||||
function changeQty(){
|
||||
|
||||
const data = goodsList.value.filter(item=>item.wlNo!='' && item.realQty!='').map(item=>({
|
||||
wlNo:item.wlNo,
|
||||
qty:item.realQty
|
||||
}))
|
||||
if(data.length>0){
|
||||
calcTotalWv({items:data}).then(response=>{
|
||||
let info = response.data
|
||||
delieryData.value.deliveryTon = info.totalWeightKg / 1000
|
||||
delieryData.value.goodsSize = info.totalVolumeM3
|
||||
// console.log(response)
|
||||
// delieryData.deliveryTon = response.data.deliveryTon
|
||||
// delieryData.goodsSize = response.data.goodsSize
|
||||
})
|
||||
}else{
|
||||
delieryData.value.deliveryTon = null
|
||||
delieryData.value.goodsSize = null
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function calculateFun(vehicleTypeId){
|
||||
if(!delieryData.value.deliveryTon || !delieryData.value.goodsSize || !delieryData.value.totalKm){
|
||||
proxy.$modal.msgWarning("请输入公里数、重量、体积");
|
||||
return
|
||||
}
|
||||
let info = {
|
||||
weightTon:0,
|
||||
volumeM3:0,
|
||||
distanceKm:0,
|
||||
vehicleTypeId:vehicleTypeId
|
||||
}
|
||||
info.weightTon = delieryData.value.deliveryTon
|
||||
info.volumeM3 = delieryData.value.goodsSize
|
||||
info.distanceKm = delieryData.value.totalKm
|
||||
if(vehicleTypeId){
|
||||
info.vehicleTypeId = vehicleTypeId
|
||||
}
|
||||
calculate(info).then(response=>{
|
||||
// 检查后端是否返回了错误信息
|
||||
if(response.data.errorMessage) {
|
||||
// 如果有错误信息,显示给用户,并清空相关字段
|
||||
proxy.$modal.msgError(response.data.errorMessage);
|
||||
if(!vehicleTypeId){
|
||||
delieryData.value.vehicleTypeId = null;
|
||||
}
|
||||
delieryData.value.suggestFee = null;
|
||||
delieryData.value.vehicleTypeName = null;
|
||||
} else {
|
||||
// 没有错误信息,正常处理返回的车型信息
|
||||
if(!vehicleTypeId){
|
||||
delieryData.value.vehicleTypeId = response.data.vehicleTypeId;
|
||||
}
|
||||
delieryData.value.suggestFee = response.data.suggestFee;
|
||||
delieryData.value.vehicleTypeName = response.data.vehicleTypeName;
|
||||
}
|
||||
// console.log(response)
|
||||
})
|
||||
}
|
||||
//切换车型
|
||||
function changeCarType(id){
|
||||
if(!delieryData.value.totalKm || !delieryData.value.deliveryTon || !delieryData.value.goodsSize){
|
||||
proxy.$modal.msgWarning("请输入公里数、重量、体积");
|
||||
return
|
||||
}
|
||||
calculateFun(id)
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
openBill.value = false
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
xmMs: null,
|
||||
xmNo: null,
|
||||
wlNo: null,
|
||||
wlMs: null,
|
||||
realQty: null,
|
||||
dw: null,
|
||||
sapNo: null,
|
||||
gysMc: null,
|
||||
remark: null,
|
||||
originName: null,
|
||||
originLng: null,
|
||||
originLat: null,
|
||||
destName: null,
|
||||
destLng: null,
|
||||
destLat: null,
|
||||
deliveryDate: null,
|
||||
vehiclePlate: null,
|
||||
shipperName: null,
|
||||
shipperPhone: null,
|
||||
receiverName: null,
|
||||
receiverPhone: null,
|
||||
receiverOrgName: null,
|
||||
deliveryTon: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
isDelete: null
|
||||
}
|
||||
proxy.resetForm("orderRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
queryParams.value.orderStatus = null
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加配送单据主"
|
||||
}
|
||||
|
||||
|
||||
function handleDetail(row) {
|
||||
open.value = true
|
||||
detailLoading.value = true
|
||||
detailOrder({orderNo:row.orderNo}).then(response=>{
|
||||
detailLoading.value = false
|
||||
wlList.value = response.data
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function statusFun(status){
|
||||
if(status==1){
|
||||
return "待配送"
|
||||
}else if(status==2){
|
||||
return "配送中"
|
||||
}else if(status==3){
|
||||
return "已完成"
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["form"].validate(valid => {
|
||||
// console.log(delieryData.value)
|
||||
// return
|
||||
|
||||
if (valid) {
|
||||
if(goodsList.value.length==0){
|
||||
proxy.$modal.msgWarning("请添加货物信息");
|
||||
return
|
||||
}
|
||||
delieryData.value.items = goodsList.value
|
||||
// console.log(delieryData.value)
|
||||
addDelivery(delieryData.value).then(response => {
|
||||
proxy.$modal.msgSuccess("操作成功")
|
||||
openBill.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除配送单据主编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delOrder(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('document/order/export', {
|
||||
...queryParams.value
|
||||
}, `order_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
function handleAddBill(){
|
||||
delieryData.value ={}
|
||||
goodsList.value = []
|
||||
|
||||
openBill.value = true
|
||||
//车型下拉数据
|
||||
listType({pageNum:1,pageSize:1000}).then(response => {
|
||||
carTypeList.value = response.rows
|
||||
|
||||
})
|
||||
//理货员下拉数据
|
||||
listUser().then(response=>{
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .container{
|
||||
|
||||
} */
|
||||
</style>
|
||||
Reference in New Issue
Block a user