|
@@ -2,38 +2,23 @@
|
|
|
<div class="tenant">
|
|
|
<!-- <Banner /> -->
|
|
|
<div class="content">
|
|
|
- <byTable
|
|
|
- :source="sourceList.data"
|
|
|
- :pagination="sourceList.pagination"
|
|
|
- :config="config"
|
|
|
- :loading="loading"
|
|
|
- highlight-current-row
|
|
|
- :selectConfig="selectConfig"
|
|
|
- :table-events="{
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
+ :selectConfig="selectConfig" :table-events="{
|
|
|
//element talbe事件都能传
|
|
|
select: select,
|
|
|
- }"
|
|
|
- :action-list="[
|
|
|
+ }" :action-list="[
|
|
|
{
|
|
|
text: '添加订单',
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
- ]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ ]" @get-list="getList">
|
|
|
<template #code="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickCode(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickCode(item)">
|
|
|
{{ item.code }}
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #status="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickStatus(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickStatus(item)">
|
|
|
{{ dictValueLabel(item.status, statusData) }}
|
|
|
</div>
|
|
|
</template>
|
|
@@ -45,140 +30,70 @@
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '添加订单' : '调仓接收'"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="60%"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="byform"
|
|
|
- >
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加订单' : '调仓接收'" v-model="dialogVisible" width="80%" v-loading="loading">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
<template #countryId>
|
|
|
- <div>
|
|
|
- <el-select
|
|
|
- v-model="formData.data.countryId"
|
|
|
- placeholder="国家"
|
|
|
- @change="(val) => getCityData(val, '20', true)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in countryData"
|
|
|
- :label="item.chineseName"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-select v-model="formData.data.countryId" placeholder="国家" style="width:100%" @change="(val) => getCityData(val, '20', true)">
|
|
|
+ <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #provinceId>
|
|
|
- <div>
|
|
|
- <selectCity
|
|
|
- placeholder="省/洲"
|
|
|
- @change="(val) => getCityData(val, '30', true)"
|
|
|
- addressId="provinceId"
|
|
|
- addressName="provinceName"
|
|
|
- v-model="formData.data"
|
|
|
- :data="provinceData"
|
|
|
- >
|
|
|
+ <div style="width:100%">
|
|
|
+ <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
|
|
|
+ v-model="formData.data" :data="provinceData">
|
|
|
</selectCity>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #cityId>
|
|
|
- <div>
|
|
|
- <selectCity
|
|
|
- placeholder="城市"
|
|
|
- addressId="cityId"
|
|
|
- addressName="cityName"
|
|
|
- v-model="formData.data"
|
|
|
- :data="cityData"
|
|
|
- >
|
|
|
+ <div style="width:100%">
|
|
|
+ <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
|
|
|
</selectCity>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #products>
|
|
|
<div style="width: 100%">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="openProduct = true"
|
|
|
- style="margin-bottom: 10px"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="openProduct = true" style="margin-bottom: 10px">
|
|
|
添加产品
|
|
|
</el-button>
|
|
|
- <el-table
|
|
|
- :data="formData.data.orderDetailsList"
|
|
|
- show-summary
|
|
|
- :summary-method="getSummaries"
|
|
|
- >
|
|
|
- <el-table-column prop="productCode" label="产品编码" />
|
|
|
- <el-table-column prop="productName" label="产品名称" />
|
|
|
- <el-table-column prop="price" label="单价" min-width="150">
|
|
|
+ <el-button type="primary" @click="openExcel = true" style="margin-bottom: 10px">
|
|
|
+ excel导入
|
|
|
+ </el-button>
|
|
|
+ <el-table :data="formData.data.orderDetailsList" show-summary :summary-method="getSummaries">
|
|
|
+ <el-table-column prop="productCode" label="产品编码" width="150" />
|
|
|
+ <el-table-column prop="productName" label="产品名称" min-width="150" />
|
|
|
+ <el-table-column prop="price" label="单价" width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.price'"
|
|
|
- :rules="rules.price"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.price"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="totalAmount"
|
|
|
- placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'orderDetailsList.' + $index + '.price'" :rules="rules.price" :inline-message="true">
|
|
|
+ <el-input-number v-model="row.price" :precision="4" :controls="false" :min="0" @change="totalAmount" placeholder="请输入"
|
|
|
+ onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="quantity" label="数量" min-width="150">
|
|
|
+ <el-table-column prop="quantity" label="数量" width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.quantity'"
|
|
|
- :rules="rules.quantity"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="totalAmount"
|
|
|
- placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'orderDetailsList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
|
+ <el-input-number v-model="row.quantity" :precision="4" :controls="false" :min="0" @change="totalAmount" placeholder="请输入"
|
|
|
+ onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="total" label="小计" />
|
|
|
+ <el-table-column prop="total" label="小计" width="120" />
|
|
|
<el-table-column prop="remark" label="备注" min-width="200">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.remark'"
|
|
|
- :rules="rules.remark"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="'orderDetailsList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true">
|
|
|
<el-input v-model="row.remark" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="zip"
|
|
|
- label="操作"
|
|
|
- width="60"
|
|
|
- fixed="right"
|
|
|
- align="center"
|
|
|
- >
|
|
|
+ <el-table-column prop="zip" label="操作" width="60" fixed="right" align="center">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button type="primary" link @click="handleRemove($index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -187,22 +102,29 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm('byform')"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- v-model="openProduct"
|
|
|
- title="选择产品"
|
|
|
- width="70%"
|
|
|
- append-to-body
|
|
|
- >
|
|
|
+
|
|
|
+ <el-dialog v-model="openExcel" title="excel导入" width="30%" append-to-body>
|
|
|
+ <div v-loading="excelLoading">
|
|
|
+ <div style="margin: 15px 0">
|
|
|
+ <el-button @click="downloadTemplate" type="primary">Excel模板下载</el-button>
|
|
|
+ </div>
|
|
|
+ <el-upload :action="actionUrl + '/orderInfo/excelImport'" :headers="headers" :before-upload="useImportExcelStore().updateRequestHeaders"
|
|
|
+ :on-success="handleSuccess" :on-progress="handleProgress" :show-file-list="false" :on-error="handleError" accept=".xls, .xlsx">
|
|
|
+ <el-button type="primary" plain>点击导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openExcel = false" size="large">取 消</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="openProduct" title="选择产品" width="70%" append-to-body>
|
|
|
<SelectProduct @handleSelect="handleSelect"></SelectProduct>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
@@ -211,16 +133,8 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="openDetails"
|
|
|
- title="订单详情"
|
|
|
- width="40%"
|
|
|
- append-to-body
|
|
|
- >
|
|
|
- <OrderDetails
|
|
|
- :orderData="formData.orderData"
|
|
|
- :key="formData.orderData.id"
|
|
|
- ></OrderDetails>
|
|
|
+ <el-dialog v-model="openDetails" title="订单详情" width="40%" append-to-body>
|
|
|
+ <OrderDetails :orderData="formData.orderData" :key="formData.orderData.id"></OrderDetails>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="openDetails = false">取消</el-button>
|
|
@@ -228,37 +142,18 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="'查看'"
|
|
|
- v-model="recordDialog"
|
|
|
- width="900"
|
|
|
- destroy-on-close
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="recordFormConfig"
|
|
|
- :formOption="recordFormOption"
|
|
|
- v-model="recordFormData.data"
|
|
|
- >
|
|
|
+ <el-dialog :title="'查看'" v-model="recordDialog" width="900" destroy-on-close>
|
|
|
+ <byForm :formConfig="recordFormConfig" :formOption="recordFormOption" v-model="recordFormData.data">
|
|
|
<template #products>
|
|
|
<div style="width: 100%">
|
|
|
<el-table :data="recordFormData.data.list">
|
|
|
- <el-table-column
|
|
|
- prop="logisticsCompanyName"
|
|
|
- label="物流/快递公司"
|
|
|
- />
|
|
|
+ <el-table-column prop="logisticsCompanyName" label="物流/快递公司" />
|
|
|
<el-table-column prop="code" label="物流/快递单号" />
|
|
|
- <el-table-column
|
|
|
- prop="logisticsStatus"
|
|
|
- label="物流状态"
|
|
|
- width="100"
|
|
|
- :formatter="(row) => handleShowKdStatus(row.logisticsStatus)"
|
|
|
- />
|
|
|
+ <el-table-column prop="logisticsStatus" label="物流状态" width="100" :formatter="(row) => handleShowKdStatus(row.logisticsStatus)" />
|
|
|
<el-table-column prop="createTime" label="创建时间" width="155" />
|
|
|
<el-table-column label="操作" width="90" align="center">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button type="primary" text @click="pushKdRoute(row)"
|
|
|
- >查看</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" text @click="pushKdRoute(row)">查看</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -282,6 +177,9 @@ import useUserStore from "@/store/modules/user";
|
|
|
import SelectProduct from "@/components/WDLY/product/SelectProduct";
|
|
|
import OrderDetails from "@/components/WDLY/order/details";
|
|
|
import selectCity from "@/components/selectCity/index.vue";
|
|
|
+import useImportExcelStore from "@/store/modules/importExcel";
|
|
|
+const headers = computed(() => useImportExcelStore().requestHeaders);
|
|
|
+const actionUrl = import.meta.env.VITE_APP_BASE_API;
|
|
|
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
@@ -536,6 +434,9 @@ const formConfig = reactive([
|
|
|
method: "post",
|
|
|
resUrl: "rows",
|
|
|
},
|
|
|
+ style: {
|
|
|
+ width: "31.5%",
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -543,22 +444,25 @@ const formConfig = reactive([
|
|
|
label: "订单类型",
|
|
|
itemWidth: 100,
|
|
|
data: [],
|
|
|
+ style: {
|
|
|
+ width: "31.5%",
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "contacts",
|
|
|
label: "收件人",
|
|
|
- itemWidth: 20,
|
|
|
+ itemWidth: 33.33,
|
|
|
placeholder: "姓名",
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "phone",
|
|
|
label: " ",
|
|
|
- itemWidth: 80,
|
|
|
+ itemWidth: 66,
|
|
|
placeholder: "联系电话",
|
|
|
style: {
|
|
|
- width: "30%",
|
|
|
+ width: "48%",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -888,6 +792,64 @@ const getSummaries = (param) => {
|
|
|
});
|
|
|
return sums;
|
|
|
};
|
|
|
+
|
|
|
+const openExcel = ref(false);
|
|
|
+const excelLoading = ref(false);
|
|
|
+const downloadTemplate = () => {
|
|
|
+ fetch("/static/SaleOrderImportTemplate.xlsx")
|
|
|
+ .then((res) => res.blob())
|
|
|
+ .then((res) => {
|
|
|
+ const url = window.URL.createObjectURL(res);
|
|
|
+ let filename = "销售订单导入模板.xlsx";
|
|
|
+ const link = document.createElement("a");
|
|
|
+ link.style.display = "none";
|
|
|
+ link.href = url;
|
|
|
+ link.setAttribute("download", filename);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleProgress = () => {
|
|
|
+ excelLoading.value = true;
|
|
|
+};
|
|
|
+const handleSuccess = (res) => {
|
|
|
+ if (res.code != 200) {
|
|
|
+ excelLoading.value = false;
|
|
|
+ return ElMessage({
|
|
|
+ message: `${res.msg},请重试!`,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: "导入成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ if (res && res.data && res.data.length > 0) {
|
|
|
+ formData.data.orderDetailsList = res.data.map((x) => ({
|
|
|
+ productName: x.productName,
|
|
|
+ productCode: x.productCustomCode,
|
|
|
+ productId: x.bussinessId,
|
|
|
+ total: "",
|
|
|
+ quantity: x.count,
|
|
|
+ price: x.price,
|
|
|
+ remark: x.remark,
|
|
|
+ }));
|
|
|
+ totalAmount();
|
|
|
+ }
|
|
|
+ openExcel.value = false;
|
|
|
+ excelLoading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleError = (err) => {
|
|
|
+ ElMessage({
|
|
|
+ message: `${err},请重试!`,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ openExcel.value = false;
|
|
|
+ excelLoading.value = false;
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|