|
@@ -37,7 +37,8 @@
|
|
|
<text class="report-export-status" :class="'report-export-status-' + item.status">{{
|
|
<text class="report-export-status" :class="'report-export-status-' + item.status">{{
|
|
|
getStatusText(item.status) }}</text>
|
|
getStatusText(item.status) }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="report-export-item-row">品种:{{ item.physicName }}</view>
|
|
|
|
|
|
|
+ <view class="report-export-item-row">品种:{{ item.physicName || "" }}</view>
|
|
|
|
|
+ <view class="report-export-item-row">规格:{{ item.pkgSpec || "" }}</view>
|
|
|
<view class="report-export-item-row">时间:{{ formatDate(item.beginTime) }}--{{
|
|
<view class="report-export-item-row">时间:{{ formatDate(item.beginTime) }}--{{
|
|
|
formatDate(item.endTime)
|
|
formatDate(item.endTime)
|
|
|
}}</view>
|
|
}}</view>
|
|
@@ -190,14 +191,14 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="report-export-create-modal-row">
|
|
|
|
|
|
|
+ <view class="report-export-create-modal-row">
|
|
|
<text class="report-export-create-modal-label">其它客户</text>
|
|
<text class="report-export-create-modal-label">其它客户</text>
|
|
|
<view class="report-export-create-modal-inputwrap">
|
|
<view class="report-export-create-modal-inputwrap">
|
|
|
<input class="report-export-dropdown-search-input" v-model="form.otherCustomer"
|
|
<input class="report-export-dropdown-search-input" v-model="form.otherCustomer"
|
|
|
placeholder="请填写(多个客户用半角逗号隔开)" placeholder-class="report-export-dropdown-other-customer-input"
|
|
placeholder="请填写(多个客户用半角逗号隔开)" placeholder-class="report-export-dropdown-other-customer-input"
|
|
|
:disabled="modalType === 'read'" :style="{ color: '#666', padding: 0, border: 'none' }" />
|
|
:disabled="modalType === 'read'" :style="{ color: '#666', padding: 0, border: 'none' }" />
|
|
|
</view>
|
|
</view>
|
|
|
- </view> -->
|
|
|
|
|
|
|
+ </view>
|
|
|
<view class="report-export-create-modal-row">
|
|
<view class="report-export-create-modal-row">
|
|
|
<text class="report-export-create-modal-label">品种</text>
|
|
<text class="report-export-create-modal-label">品种</text>
|
|
|
<view class="report-export-create-modal-inputwrap"
|
|
<view class="report-export-create-modal-inputwrap"
|
|
@@ -220,12 +221,32 @@
|
|
|
modalType !== 'read' && pickOption('product', op)
|
|
modalType !== 'read' && pickOption('product', op)
|
|
|
">{{ op.physicName }}
|
|
">{{ op.physicName }}
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="displayProducts.length === 0" class="report-export-create-modal-dropdown-item">
|
|
|
|
|
|
|
+ <view v-if="displayProducts?.length === 0" class="report-export-create-modal-dropdown-item">
|
|
|
未查找到该品种</view>
|
|
未查找到该品种</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="report-export-create-modal-row">
|
|
|
|
|
+ <text class="report-export-create-modal-label">规格</text>
|
|
|
|
|
+ <view class="report-export-create-modal-inputwrap"
|
|
|
|
|
+ :class="{ 'report-export-input-disabled': !form.product?.drugEntBaseInfoId }"
|
|
|
|
|
+ @click.stop="modalType !== 'read' && form.product?.drugEntBaseInfoId && openDropdown('pkgSpec')">
|
|
|
|
|
+ <view class="report-export-create-modal-static">{{
|
|
|
|
|
+ form.pkgSpec || "请选择规格(请先选择品种)"
|
|
|
|
|
+ }}</view>
|
|
|
|
|
+ <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
|
|
|
|
|
+ <view class="report-export-create-modal-dropdown" v-if="dropdown.pkgSpec" @click.stop
|
|
|
|
|
+ :style="[{ top: 'auto', bottom: '84rpx' }]">
|
|
|
|
|
+ <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('pkgSpec')"
|
|
|
|
|
+ :key="'t-' + i" @click.stop="
|
|
|
|
|
+ modalType !== 'read' && pickOption('pkgSpec', op)
|
|
|
|
|
+ ">{{ op }}</view>
|
|
|
|
|
+ <view v-if="filteredOptions('pkgSpec')?.length === 0" class="report-export-create-modal-dropdown-item">
|
|
|
|
|
+ 未查找到该品种规格</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<view class="report-export-create-modal-row">
|
|
<view class="report-export-create-modal-row">
|
|
|
<text class="report-export-create-modal-label">时间</text>
|
|
<text class="report-export-create-modal-label">时间</text>
|
|
|
<view class="report-export-create-modal-inputwrap">
|
|
<view class="report-export-create-modal-inputwrap">
|
|
@@ -265,12 +286,33 @@
|
|
|
@scrolltolower="loadMoreProducts('filter')">
|
|
@scrolltolower="loadMoreProducts('filter')">
|
|
|
<view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filterDisplayProducts"
|
|
<view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filterDisplayProducts"
|
|
|
:key="'prd-' + i" @click.stop="pickFilterOption('product', op)">{{ op.physicName }}</view>
|
|
:key="'prd-' + i" @click.stop="pickFilterOption('product', op)">{{ op.physicName }}</view>
|
|
|
- <view v-if="filterDisplayProducts.length === 0" class="report-export-create-modal-dropdown-item">未查找到该品种
|
|
|
|
|
|
|
+ <view v-if="filterDisplayProducts?.length === 0" class="report-export-create-modal-dropdown-item">
|
|
|
|
|
+ 未查找到该品种
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <!-- <view class="report-export-create-modal-row">
|
|
|
|
|
+ <text class="report-export-create-modal-label">规格</text>
|
|
|
|
|
+ <view class="report-export-create-modal-inputwrap"
|
|
|
|
|
+ :class="{ 'report-export-input-disabled': !filterForm.product?.drugEntBaseInfoId }"
|
|
|
|
|
+ @click.stop="filterForm.product?.drugEntBaseInfoId && openFilterDropdown('pkgSpec')">
|
|
|
|
|
+ <view class="report-export-create-modal-static">{{
|
|
|
|
|
+ filterForm.pkgSpec || "请选择品种规格(请先选择品种)"
|
|
|
|
|
+ }}</view>
|
|
|
|
|
+ <view class="report-export-input-arrow"></view>
|
|
|
|
|
+ <view class="report-export-create-modal-dropdown" v-if="filterDropdown.pkgSpec" @click.stop
|
|
|
|
|
+ :style="[{ top: 'auto', bottom: '84rpx' }]">
|
|
|
|
|
+ <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('pkgSpec')"
|
|
|
|
|
+ :key="'t-' + i" @click.stop="
|
|
|
|
|
+ pickFilterOption('pkgSpec', op)
|
|
|
|
|
+ ">{{ op }}</view>
|
|
|
|
|
+ <view v-if="filteredOptions('pkgSpec')?.length === 0" class="report-export-create-modal-dropdown-item">
|
|
|
|
|
+ 未查找到该品种规格</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view> -->
|
|
|
<view class="report-export-create-modal-row">
|
|
<view class="report-export-create-modal-row">
|
|
|
<text class="report-export-create-modal-label">时间:</text>
|
|
<text class="report-export-create-modal-label">时间:</text>
|
|
|
<view class="report-export-create-modal-inputwrap">
|
|
<view class="report-export-create-modal-inputwrap">
|
|
@@ -358,7 +400,7 @@ export default {
|
|
|
customerType: "",
|
|
customerType: "",
|
|
|
customer: [],
|
|
customer: [],
|
|
|
product: { physicName: "" },
|
|
product: { physicName: "" },
|
|
|
- // otherCustomer: "",
|
|
|
|
|
|
|
+ otherCustomer: "",
|
|
|
},
|
|
},
|
|
|
dateRange: [],
|
|
dateRange: [],
|
|
|
computeTimer: null,
|
|
computeTimer: null,
|
|
@@ -367,11 +409,13 @@ export default {
|
|
|
customerType: false,
|
|
customerType: false,
|
|
|
customer: false,
|
|
customer: false,
|
|
|
product: false,
|
|
product: false,
|
|
|
|
|
+ pkgSpec: false,
|
|
|
},
|
|
},
|
|
|
options: {
|
|
options: {
|
|
|
region: [],
|
|
region: [],
|
|
|
customerType: ["VIP客户", "二级客户", "三级客户"],
|
|
customerType: ["VIP客户", "二级客户", "三级客户"],
|
|
|
product: [],
|
|
product: [],
|
|
|
|
|
+ pkgSpec: [],
|
|
|
status: ["全部", "待开始", "进行中", "已完成"],
|
|
status: ["全部", "待开始", "进行中", "已完成"],
|
|
|
},
|
|
},
|
|
|
// dropdown search inputs (create modal)
|
|
// dropdown search inputs (create modal)
|
|
@@ -404,8 +448,9 @@ export default {
|
|
|
filterForm: {
|
|
filterForm: {
|
|
|
product: { physicName: "" },
|
|
product: { physicName: "" },
|
|
|
status: "全部",
|
|
status: "全部",
|
|
|
|
|
+ pkgSpec: "",
|
|
|
},
|
|
},
|
|
|
- filterDropdown: { product: false },
|
|
|
|
|
|
|
+ filterDropdown: { product: false, pkgSpec: false },
|
|
|
filterDateRange: [],
|
|
filterDateRange: [],
|
|
|
modalType: "",
|
|
modalType: "",
|
|
|
dropdownUpward: false,
|
|
dropdownUpward: false,
|
|
@@ -483,13 +528,13 @@ export default {
|
|
|
getCustomerName(data = {}) {
|
|
getCustomerName(data = {}) {
|
|
|
const { customerName = "", otherCustomer = "" } = data;
|
|
const { customerName = "", otherCustomer = "" } = data;
|
|
|
let name = customerName || "";
|
|
let name = customerName || "";
|
|
|
- // if (otherCustomer) {
|
|
|
|
|
- // if (name) {
|
|
|
|
|
- // name += `,${otherCustomer}`;
|
|
|
|
|
- // } else {
|
|
|
|
|
- // name = otherCustomer;
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (otherCustomer) {
|
|
|
|
|
+ if (name) {
|
|
|
|
|
+ name += `,${otherCustomer}`;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ name = otherCustomer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
const arr = name.split(",");
|
|
const arr = name.split(",");
|
|
|
if (arr.length == 0) return "--";
|
|
if (arr.length == 0) return "--";
|
|
|
return arr.length == 1 ? arr[0].trim() : `${arr.length}个公司`;
|
|
return arr.length == 1 ? arr[0].trim() : `${arr.length}个公司`;
|
|
@@ -517,6 +562,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ getGuigeList(physicName) {
|
|
|
|
|
+ if (!physicName) return;
|
|
|
|
|
+ request("/report/getDrugSpec", { physicName, path: "/reportExport/index.vue" }).then(res => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.options.pkgSpec = res.data || [];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getProviceList() {
|
|
getProviceList() {
|
|
|
request("/common/getProviceList", {
|
|
request("/common/getProviceList", {
|
|
|
path: "/reportExport/index.vue",
|
|
path: "/reportExport/index.vue",
|
|
@@ -594,13 +647,19 @@ export default {
|
|
|
? "VIP客户"
|
|
? "VIP客户"
|
|
|
: item.customerType == 2
|
|
: item.customerType == 2
|
|
|
? "二级客户"
|
|
? "二级客户"
|
|
|
- : "三级客户",
|
|
|
|
|
|
|
+ : item.customerType == 3
|
|
|
|
|
+ ? "三级客户"
|
|
|
|
|
+ : "",
|
|
|
product: {
|
|
product: {
|
|
|
physicName: item.physicName,
|
|
physicName: item.physicName,
|
|
|
drugEntBaseInfoId: item.drugEntBaseInfoId,
|
|
drugEntBaseInfoId: item.drugEntBaseInfoId,
|
|
|
},
|
|
},
|
|
|
- // otherCustomer: item?.otherCustomer || "",
|
|
|
|
|
|
|
+ pkgSpec: item?.pkgSpec || "",
|
|
|
|
|
+ otherCustomer: item?.otherCustomer || "",
|
|
|
};
|
|
};
|
|
|
|
|
+ if (item.physicName) {
|
|
|
|
|
+ this.getGuigeList(item.physicName);
|
|
|
|
|
+ }
|
|
|
this.dateRange = [item.beginTime, item.endTime];
|
|
this.dateRange = [item.beginTime, item.endTime];
|
|
|
}
|
|
}
|
|
|
this.createModalOpen = true;
|
|
this.createModalOpen = true;
|
|
@@ -628,6 +687,7 @@ export default {
|
|
|
reportType: 2,
|
|
reportType: 2,
|
|
|
taskType: statusMap?.[this.filterForm?.status] || "",
|
|
taskType: statusMap?.[this.filterForm?.status] || "",
|
|
|
drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
|
|
drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
|
|
|
|
|
+ pkgSpec: this.filterForm?.pkgSpec || "",
|
|
|
beginTime: this.filterDateRange[0],
|
|
beginTime: this.filterDateRange[0],
|
|
|
endTime: this.filterDateRange[1],
|
|
endTime: this.filterDateRange[1],
|
|
|
customerName: this.keyword || "",
|
|
customerName: this.keyword || "",
|
|
@@ -695,7 +755,7 @@ export default {
|
|
|
customerType: "",
|
|
customerType: "",
|
|
|
customer: [],
|
|
customer: [],
|
|
|
product: { physicName: "" },
|
|
product: { physicName: "" },
|
|
|
- // otherCustomer: "",
|
|
|
|
|
|
|
+ otherCustomer: "",
|
|
|
};
|
|
};
|
|
|
this.searchForm = {
|
|
this.searchForm = {
|
|
|
region: "",
|
|
region: "",
|
|
@@ -719,7 +779,7 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!this.isFormComplete()) {
|
|
if (!this.isFormComplete()) {
|
|
|
- uni.showToast({ title: "请完整填写任务内容", icon: "none" });
|
|
|
|
|
|
|
+ // uni.showToast({ title: "请完整填写任务内容", icon: "none" });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
// uni.showToast({ title: "已创建", icon: "none" });
|
|
// uni.showToast({ title: "已创建", icon: "none" });
|
|
@@ -739,14 +799,17 @@ export default {
|
|
|
request(url, {
|
|
request(url, {
|
|
|
id:
|
|
id:
|
|
|
this.modalType === "create" ? undefined : this.currentItem?.id || "",
|
|
this.modalType === "create" ? undefined : this.currentItem?.id || "",
|
|
|
|
|
+ reportType: 2,
|
|
|
regionCode: this.form?.region?.regionCode || "",
|
|
regionCode: this.form?.region?.regionCode || "",
|
|
|
customerType: customerTypeMap?.[this.form?.customerType] || "",
|
|
customerType: customerTypeMap?.[this.form?.customerType] || "",
|
|
|
customerId,
|
|
customerId,
|
|
|
customerName,
|
|
customerName,
|
|
|
- // otherCustomer: this.form?.otherCustomer || "",
|
|
|
|
|
|
|
+ otherCustomer: this.form?.otherCustomer || "",
|
|
|
drugEntBaseInfoId: this.form?.product?.drugEntBaseInfoId || "",
|
|
drugEntBaseInfoId: this.form?.product?.drugEntBaseInfoId || "",
|
|
|
- beginTime: this.dateRange[0],
|
|
|
|
|
- endTime: this.dateRange[1],
|
|
|
|
|
|
|
+ pkgSpec: this.form?.pkgSpec || "",
|
|
|
|
|
+ physicName: this.form?.product?.physicName || "",
|
|
|
|
|
+ beginTime: this.formatDate(this.dateRange[0], 'YYYY-MM-DD'),
|
|
|
|
|
+ endTime: this.formatDate(this.dateRange[1], 'YYYY-MM-DD'),
|
|
|
path: "",
|
|
path: "",
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -770,13 +833,27 @@ export default {
|
|
|
let customerOk = Array.isArray(f.customer)
|
|
let customerOk = Array.isArray(f.customer)
|
|
|
? f.customer.length > 0
|
|
? f.customer.length > 0
|
|
|
: !!f.customer;
|
|
: !!f.customer;
|
|
|
- return (
|
|
|
|
|
- f.region?.regionName &&
|
|
|
|
|
- f.customerType &&
|
|
|
|
|
- customerOk &&
|
|
|
|
|
- f.product?.physicName &&
|
|
|
|
|
- drOk
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ customerOk = customerOk || f.otherCustomer
|
|
|
|
|
+ if (!customerOk) {
|
|
|
|
|
+ uni.showToast({ title: "请选择至少一个客户或其他客户", icon: "none" });
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!f.product?.physicName) {
|
|
|
|
|
+ uni.showToast({ title: "请选择品种", icon: "none" });
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!drOk) {
|
|
|
|
|
+ uni.showToast({ title: "请选择时间范围", icon: "none" });
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+ // return (
|
|
|
|
|
+ // f.region?.regionName &&
|
|
|
|
|
+ // f.customerType &&
|
|
|
|
|
+ // customerOk &&
|
|
|
|
|
+ // f.product?.physicName &&
|
|
|
|
|
+ // drOk
|
|
|
|
|
+ // );
|
|
|
},
|
|
},
|
|
|
confirmDelete() {
|
|
confirmDelete() {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -796,6 +873,7 @@ export default {
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
|
});
|
|
});
|
|
|
this.resetFetch();
|
|
this.resetFetch();
|
|
|
|
|
+ this.closeCreate();
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: res?.msg || "删除失败",
|
|
title: res?.msg || "删除失败",
|
|
@@ -833,8 +911,10 @@ export default {
|
|
|
customerType: false,
|
|
customerType: false,
|
|
|
customer: false,
|
|
customer: false,
|
|
|
product: false,
|
|
product: false,
|
|
|
|
|
+ pkgSpec: false,
|
|
|
};
|
|
};
|
|
|
this.filterDropdown.product = false;
|
|
this.filterDropdown.product = false;
|
|
|
|
|
+ this.filterDropdown.pkgSpec = false;
|
|
|
},
|
|
},
|
|
|
openFilterDropdown(k) {
|
|
openFilterDropdown(k) {
|
|
|
this.closeDropdownAll();
|
|
this.closeDropdownAll();
|
|
@@ -854,12 +934,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
pickFilterOption(k, v) {
|
|
pickFilterOption(k, v) {
|
|
|
- if (["status"].includes(k) && this.filterForm[k] === v) {
|
|
|
|
|
|
|
+ if (!["status"].includes(k) && this.filterForm[k] === v) {
|
|
|
this.filterForm[k] = "";
|
|
this.filterForm[k] = "";
|
|
|
this.filterDropdown[k] = false;
|
|
this.filterDropdown[k] = false;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.filterForm[k] = v;
|
|
this.filterForm[k] = v;
|
|
|
|
|
+ if (k === "product") {
|
|
|
|
|
+ this.filterForm.pkgSpec = "";
|
|
|
|
|
+ this.getGuigeList(v.physicName);
|
|
|
|
|
+ }
|
|
|
this.filterDropdown[k] = false;
|
|
this.filterDropdown[k] = false;
|
|
|
},
|
|
},
|
|
|
filteredFilterOptions(k) {
|
|
filteredFilterOptions(k) {
|
|
@@ -902,6 +986,10 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.form[k] = v;
|
|
this.form[k] = v;
|
|
|
|
|
+ if (k === "product") {
|
|
|
|
|
+ this.form.pkgSpec = "";
|
|
|
|
|
+ this.getGuigeList(v.physicName);
|
|
|
|
|
+ }
|
|
|
this.dropdown[k] = false;
|
|
this.dropdown[k] = false;
|
|
|
},
|
|
},
|
|
|
isCustomerSelected(name) {
|
|
isCustomerSelected(name) {
|
|
@@ -1262,7 +1350,7 @@ export default {
|
|
|
.report-export-item-header {
|
|
.report-export-item-header {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- align-items: baseline;
|
|
|
|
|
|
|
+ align-items: flex-start;
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1681,4 +1769,10 @@ export default {
|
|
|
margin-top: 10rpx;
|
|
margin-top: 10rpx;
|
|
|
display: block;
|
|
display: block;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.report-export-input-disabled {
|
|
|
|
|
+ background-color: #f5f7fa;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ opacity: 0.7;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|