|
|
@@ -113,10 +113,10 @@
|
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
|
@click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
+ >搜索</el-button
|
|
|
>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
+ >重置</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -130,7 +130,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- >新增</el-button
|
|
|
+ >新增</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -141,7 +141,7 @@
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
- >修改</el-button
|
|
|
+ >修改</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -152,7 +152,7 @@
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
- >删除</el-button
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -162,7 +162,7 @@
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- >导出</el-button
|
|
|
+ >导出</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
|
@@ -200,8 +200,8 @@
|
|
|
width="180"
|
|
|
>
|
|
|
<template slot-scope="scope">{{
|
|
|
- parseTime(scope.row.createTime)
|
|
|
- }}</template>
|
|
|
+ parseTime(scope.row.createTime)
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="建档时间"
|
|
|
@@ -210,8 +210,8 @@
|
|
|
width="180"
|
|
|
>
|
|
|
<template slot-scope="scope">{{
|
|
|
- parseTime(scope.row.filingTime)
|
|
|
- }}</template>
|
|
|
+ parseTime(scope.row.filingTime)
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="归属销售" align="center" prop="companyUserName" />
|
|
|
<el-table-column label="归属分组" align="center" prop="deptName" />
|
|
|
@@ -241,7 +241,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-info"
|
|
|
@click="handleDetail(scope.row)"
|
|
|
- >详情</el-button
|
|
|
+ >详情</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -249,7 +249,7 @@
|
|
|
icon="el-icon-edit"
|
|
|
v-if="scope.row.myCustomerFlag"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- >修改</el-button
|
|
|
+ >修改</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -257,49 +257,49 @@
|
|
|
icon="el-icon-delete"
|
|
|
v-if="scope.row.myCustomerFlag"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- >删除</el-button
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-user"
|
|
|
@click="handleClaim(scope.row)"
|
|
|
- >认领客户</el-button
|
|
|
+ >认领客户</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-view"
|
|
|
@click="handlePrescribe(scope.row)"
|
|
|
- >查看处方</el-button
|
|
|
+ >查看处方</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-document"
|
|
|
@click="handleCollection(scope.row)"
|
|
|
- >查看信息采集</el-button
|
|
|
+ >查看信息采集</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-document-copy"
|
|
|
@click="handleViewLog(scope.row)"
|
|
|
- >认领记录</el-button
|
|
|
+ >认领记录</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-folder-add"
|
|
|
@click="handleCreateOrder(scope.row)"
|
|
|
- >制单</el-button
|
|
|
+ >制单</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-view"
|
|
|
@click="handleViewOrderList(scope.row)"
|
|
|
- >查看订单列表</el-button
|
|
|
+ >查看订单列表</el-button
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -604,8 +604,8 @@
|
|
|
width="180"
|
|
|
>
|
|
|
<template slot-scope="scope">{{
|
|
|
- parseTime(scope.row.claimTime)
|
|
|
- }}</template>
|
|
|
+ parseTime(scope.row.claimTime)
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
@@ -652,7 +652,7 @@
|
|
|
type="primary"
|
|
|
:loading="claimSubmitLoading"
|
|
|
@click="submitClaim"
|
|
|
- >确 认</el-button
|
|
|
+ >确 认</el-button
|
|
|
>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -686,11 +686,11 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="收货地址">
|
|
|
<el-cascader
|
|
|
- ref="citySelect"
|
|
|
- v-model="kdnCityIds"
|
|
|
- :options="kdnCitys"
|
|
|
- @change="handleKdnCityChange">
|
|
|
- </el-cascader>
|
|
|
+ ref="citySelect"
|
|
|
+ v-model="kdnCityIds"
|
|
|
+ :options="kdnCitys"
|
|
|
+ @change="handleKdnCityChange">
|
|
|
+ </el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="详细地址" prop="detail" required>
|
|
|
<el-input
|
|
|
@@ -720,7 +720,7 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
@click="handleAddProduct"
|
|
|
- >添加商品</el-button
|
|
|
+ >添加商品</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -773,17 +773,17 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="removeProduct(scope.row)"
|
|
|
- >删除</el-button
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-row>
|
|
|
<el-col
|
|
|
- ><span>商品合计:{{ products.length }}</span
|
|
|
- ><span style="margin-left: 10px"
|
|
|
- >商品总价:{{ totalMoney.toFixed(2) }}</span
|
|
|
- ></el-col
|
|
|
+ ><span>商品合计:{{ products.length }}</span
|
|
|
+ ><span style="margin-left: 10px"
|
|
|
+ >商品总价:{{ totalMoney.toFixed(2) }}</span
|
|
|
+ ></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
</el-form-item>
|
|
|
@@ -794,7 +794,7 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
@click="handleAddGiftProduct"
|
|
|
- >添加赠品</el-button
|
|
|
+ >添加赠品</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -846,7 +846,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="removeGiftProduct(scope.row)"
|
|
|
- >删除</el-button
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -888,7 +888,7 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="createOrderSubmitForm"
|
|
|
- >确 定</el-button
|
|
|
+ >确 定</el-button
|
|
|
>
|
|
|
<el-button @click="createOrderCancel">取 消</el-button>
|
|
|
</div>
|
|
|
@@ -951,10 +951,10 @@
|
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
|
@click="handleOrderQuery"
|
|
|
- >搜索</el-button
|
|
|
+ >搜索</el-button
|
|
|
>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetOrderQuery"
|
|
|
- >重置</el-button
|
|
|
+ >重置</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -1026,8 +1026,8 @@
|
|
|
width="160"
|
|
|
>
|
|
|
<template slot-scope="scope">{{
|
|
|
- parseTime(scope.row.createTime)
|
|
|
- }}</template>
|
|
|
+ parseTime(scope.row.createTime)
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="收货人"
|
|
|
@@ -1065,7 +1065,7 @@
|
|
|
icon="el-icon-qrcode"
|
|
|
v-if="scope.row.payType === '1' && scope.row.paid === 0"
|
|
|
@click="handleGetQrCode(scope.row)"
|
|
|
- >获取二维码</el-button
|
|
|
+ >获取二维码</el-button
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -1105,7 +1105,7 @@
|
|
|
type="primary"
|
|
|
@click="downloadQrCode"
|
|
|
:disabled="!qrCodeImage"
|
|
|
- >下载二维码</el-button
|
|
|
+ >下载二维码</el-button
|
|
|
>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -1373,32 +1373,82 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
handleKdnCityChange(value) {
|
|
|
- var nodes=this.$refs.citySelect.getCheckedNodes();
|
|
|
- this.kdnCityIds=value.toString();
|
|
|
- this.createOrderForm.province=nodes[0].pathLabels[0];
|
|
|
- this.createOrderForm.city=nodes[0].pathLabels[1];
|
|
|
- this.createOrderForm.district=nodes[0].pathLabels[2];
|
|
|
+ const nodes = this.$refs.citySelect.getCheckedNodes();
|
|
|
+ this.kdnCityIds = value.toString();
|
|
|
+ if (nodes && nodes.length > 0) {
|
|
|
+ const selectedNode = nodes[0];
|
|
|
+ if (selectedNode.pathValues && selectedNode.pathValues.length >= 3) {
|
|
|
+ // 设置ID字段
|
|
|
+ this.createOrderForm.provinceId = selectedNode.pathValues[0];
|
|
|
+ this.createOrderForm.cityId = selectedNode.pathValues[1];
|
|
|
+ this.createOrderForm.districtId = selectedNode.pathValues[2];
|
|
|
+ }
|
|
|
+ // 设置名称字段
|
|
|
+ if (selectedNode.pathLabels && selectedNode.pathLabels.length >= 3) {
|
|
|
+ this.createOrderForm.province = selectedNode.pathLabels[0];
|
|
|
+ this.createOrderForm.city = selectedNode.pathLabels[1];
|
|
|
+ this.createOrderForm.district = selectedNode.pathLabels[2];
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
sAddress(row) {
|
|
|
- getAddress(row.address).then((response) => {
|
|
|
- var addressJson = response.data;
|
|
|
- this.msgSuccess(addressJson.reason);
|
|
|
- this.createOrderForm.province = addressJson.data.provinceName;
|
|
|
- this.createOrderForm.city = addressJson.data.cityName;
|
|
|
- this.createOrderForm.district = addressJson.data.expAreaName;
|
|
|
- this.createOrderForm.detail =
|
|
|
- addressJson.data.streetName + addressJson.data.address;
|
|
|
- var province = this.kdnCitys.find(function (o) {
|
|
|
- return o.label == addressJson.data.provinceName;
|
|
|
- });
|
|
|
- var city = province.children.find(function (o) {
|
|
|
- return o.label == addressJson.data.cityName;
|
|
|
- });
|
|
|
- var district = city.children.find(function (o) {
|
|
|
- return o.label == addressJson.data.expAreaName;
|
|
|
+ getAddress(row.address)
|
|
|
+ .then((response) => {
|
|
|
+ const addressJson = response.data;
|
|
|
+ // 检查解析结果是否有效
|
|
|
+ if (
|
|
|
+ !addressJson ||
|
|
|
+ !addressJson.data ||
|
|
|
+ !addressJson.data.provinceName
|
|
|
+ ) {
|
|
|
+ this.$message.error("地址解析失败:未找到有效的省市区信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 回填省市区名称
|
|
|
+ this.createOrderForm.province = addressJson.data.provinceName;
|
|
|
+ this.createOrderForm.city = addressJson.data.cityName;
|
|
|
+ this.createOrderForm.district = addressJson.data.expAreaName;
|
|
|
+ this.createOrderForm.detail =
|
|
|
+ (addressJson.data.streetName || "") +
|
|
|
+ (addressJson.data.address || "");
|
|
|
+
|
|
|
+ // 根据名称查找对应ID
|
|
|
+ const province = this.kdnCitys.find(
|
|
|
+ (o) => o.label === addressJson.data.provinceName
|
|
|
+ );
|
|
|
+ if (!province) {
|
|
|
+ this.$message.error(`未找到省份:${addressJson.data.provinceName}`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const city = province.children.find(
|
|
|
+ (o) => o.label === addressJson.data.cityName
|
|
|
+ );
|
|
|
+ if (!city) {
|
|
|
+ this.$message.error(`未找到城市:${addressJson.data.cityName}`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const district = city.children.find(
|
|
|
+ (o) => o.label === addressJson.data.expAreaName
|
|
|
+ );
|
|
|
+ if (!district) {
|
|
|
+ this.$message.error(`未找到区县:${addressJson.data.expAreaName}`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置ID字段(用于校验)
|
|
|
+ this.createOrderForm.provinceId = province.value;
|
|
|
+ this.createOrderForm.cityId = city.value;
|
|
|
+ this.createOrderForm.districtId = district.value;
|
|
|
+
|
|
|
+ // 设置级联选择器的值
|
|
|
+ this.kdnCityIds = [province.value, city.value, district.value];
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("地址解析接口错误:", error);
|
|
|
+ const errorMsg =
|
|
|
+ error?.msg || error?.message || "地址智能识别失败,请手动选择";
|
|
|
+ this.$message.error(errorMsg);
|
|
|
});
|
|
|
- this.kdnCityIds = [province.value, city.value, district.value];
|
|
|
- });
|
|
|
},
|
|
|
getKdnCitys() {
|
|
|
getKdnCitys().then((res) => {
|