|
|
@@ -2,29 +2,6 @@
|
|
|
<z-paging class="page" ref="paging" v-model="dataList" @query="queryList">
|
|
|
<!-- z-paging默认铺满全屏,此时页面所有view都应放在z-paging标签内,否则会被盖住 -->
|
|
|
<!-- 需要固定在页面顶部的view请通过slot="top"插入,包括自定义的导航栏 -->
|
|
|
- <template #top>
|
|
|
- <uni-row class="search-row flex-row align-center justify-between">
|
|
|
- <uni-col :span="19">
|
|
|
- <uni-easyinput
|
|
|
- v-model="orderName"
|
|
|
- :styles="inputStyles"
|
|
|
- :placeholderStyle="placeholderStyle"
|
|
|
- :placeholder="$t('operation.searchText')"
|
|
|
- >
|
|
|
- </uni-easyinput>
|
|
|
- </uni-col>
|
|
|
- <uni-col :span="5" class="flex-row justify-end">
|
|
|
- <button
|
|
|
- class="mini-btn"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- @click="searchList"
|
|
|
- >
|
|
|
- {{ $t("operation.search") }}
|
|
|
- </button>
|
|
|
- </uni-col>
|
|
|
- </uni-row>
|
|
|
- </template>
|
|
|
<view class="list">
|
|
|
<view class="item" v-for="(item, index) in dataList" :key="index">
|
|
|
<view
|
|
|
@@ -32,8 +9,7 @@
|
|
|
:class="{
|
|
|
tobeFilled: item.orderStatus == 0,
|
|
|
ignore: item.orderStatus == 3,
|
|
|
- }"
|
|
|
- >
|
|
|
+ }">
|
|
|
<!-- 创建时间 -->
|
|
|
<view class="module-name">
|
|
|
{{ item.createTime ? formatDate(item.createTime) : "" }}
|
|
|
@@ -44,8 +20,7 @@
|
|
|
:class="{
|
|
|
pending: item.orderStatus == 0,
|
|
|
ignore: item.orderStatus == 3,
|
|
|
- }"
|
|
|
- >
|
|
|
+ }">
|
|
|
{{ fillStatusDict[item.orderStatus] }}
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -125,8 +100,7 @@
|
|
|
type="default"
|
|
|
class="btn-ignore"
|
|
|
v-if="item.orderStatus == 0 || item.orderStatus == 2"
|
|
|
- @click="ignoreOrder(item)"
|
|
|
- >
|
|
|
+ @click="ignoreOrder(item)">
|
|
|
{{ $t("operation.ignore") }}
|
|
|
</button>
|
|
|
<!-- 查看 -->
|
|
|
@@ -134,22 +108,78 @@
|
|
|
type="primary"
|
|
|
plain="true"
|
|
|
v-if="item.orderStatus == 1 || item.orderStatus == 3"
|
|
|
- @click="navigatorDetail(item, 0)"
|
|
|
- >
|
|
|
+ @click="navigatorDetail(item, 0)">
|
|
|
{{ $t("operation.view") }}
|
|
|
</button>
|
|
|
<!-- 填写 -->
|
|
|
<button
|
|
|
type="primary"
|
|
|
v-if="item.orderStatus == 0 || item.orderStatus == 2"
|
|
|
- @click="navigatorDetail(item, 1)"
|
|
|
- >
|
|
|
+ @click="navigatorDetail(item, 1)">
|
|
|
{{ $t("operation.fill") }}
|
|
|
</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</z-paging>
|
|
|
+
|
|
|
+ <UniFab
|
|
|
+ :pattern="fabPattern"
|
|
|
+ horizontal="right"
|
|
|
+ vertical="bottom"
|
|
|
+ direction="horizontal"
|
|
|
+ :popMenu="false"
|
|
|
+ @fabClick="openFilterPopup" />
|
|
|
+
|
|
|
+ <uni-popup
|
|
|
+ ref="filterPopup"
|
|
|
+ type="bottom"
|
|
|
+ background-color="#fff"
|
|
|
+ border-radius="10px 10px 0 0">
|
|
|
+ <view class="filter-popup">
|
|
|
+ <view class="filter-header">
|
|
|
+ <text class="filter-action" @click="closeFilterPopup">{{
|
|
|
+ $t("operation.cancel")
|
|
|
+ }}</text>
|
|
|
+ <text class="filter-title">筛选条件</text>
|
|
|
+ <text class="filter-action primary" @click="searchList">{{
|
|
|
+ $t("operation.confirm")
|
|
|
+ }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="filter-body">
|
|
|
+ <view class="filter-item">
|
|
|
+ <view class="filter-label">工单名称</view>
|
|
|
+ <uni-easyinput
|
|
|
+ v-model="orderName"
|
|
|
+ :input-border="false"
|
|
|
+ :styles="inputStyles"
|
|
|
+ :placeholderStyle="placeholderStyle"
|
|
|
+ :placeholder="$t('operation.searchText')"
|
|
|
+ @confirm="searchList" />
|
|
|
+ </view>
|
|
|
+ <view class="filter-item">
|
|
|
+ <view class="filter-label">创建时间</view>
|
|
|
+ <uni-datetime-picker
|
|
|
+ v-model="createTime"
|
|
|
+ type="datetimerange"
|
|
|
+ return-type="string"
|
|
|
+ :border="false"
|
|
|
+ :placeholder="$t('operation.PleaseSelect')" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="filter-footer">
|
|
|
+ <button class="filter-button reset" @click="resetFilter">
|
|
|
+ {{ $t("inventory.search.reset") }}
|
|
|
+ </button>
|
|
|
+ <button class="filter-button" type="primary" @click="searchList">
|
|
|
+ {{ $t("operation.search") }}
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
<ignore-reason ref="ignorePopupRef" @ignore-submit="ignoreSubmit" />
|
|
|
</template>
|
|
|
|
|
|
@@ -161,9 +191,10 @@ import {
|
|
|
getRecordFillingList,
|
|
|
recordFillingIgnore,
|
|
|
} from "@/api/recordFilling.js";
|
|
|
-import { getUserId, getDeptId } from "@/utils/auth.js";
|
|
|
+import { getDeptId } from "@/utils/auth.js";
|
|
|
import { useDataDictStore } from "@/store/modules/dataDict";
|
|
|
import ignoreReason from "@/components/ignore/reason.vue";
|
|
|
+import UniFab from "@/uni_modules/uni-fab/components/uni-fab/uni-fab.vue";
|
|
|
|
|
|
// 获取字典项
|
|
|
const { getStrDictOptions } = useDataDictStore();
|
|
|
@@ -175,6 +206,20 @@ getStrDictOptions("operation_fill_order_status").map((item) => {
|
|
|
console.log("🚀 ~ getDataDictList ~ fillStatusDict:", fillStatusDict);
|
|
|
|
|
|
const orderName = ref("");
|
|
|
+const getCurrentMonthRange = () => [
|
|
|
+ dayjs().startOf("week").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ dayjs().endOf("week").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+];
|
|
|
+const createTime = ref(getCurrentMonthRange());
|
|
|
+const filterPopup = ref(null);
|
|
|
+const fabPattern = reactive({
|
|
|
+ color: "#fff",
|
|
|
+ backgroundColor: "#fff",
|
|
|
+ selectedColor: "#fff",
|
|
|
+ buttonColor: "#004098",
|
|
|
+ iconColor: "#fff",
|
|
|
+ icon: "search",
|
|
|
+});
|
|
|
const placeholderStyle = ref("color:#797979;font-weight:500;font-size:16px");
|
|
|
const inputStyles = reactive({
|
|
|
backgroundColor: "#FFFFFF",
|
|
|
@@ -192,6 +237,7 @@ const queryList = (pageNo, pageSize) => {
|
|
|
pageSize,
|
|
|
deptId: getDeptId(),
|
|
|
orderName: orderName.value,
|
|
|
+ createTime: createTime.value,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
// 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
|
|
|
@@ -205,8 +251,19 @@ const queryList = (pageNo, pageSize) => {
|
|
|
});
|
|
|
};
|
|
|
const searchList = () => {
|
|
|
+ closeFilterPopup();
|
|
|
paging.value.reload();
|
|
|
};
|
|
|
+const openFilterPopup = () => {
|
|
|
+ filterPopup.value?.open();
|
|
|
+};
|
|
|
+const closeFilterPopup = () => {
|
|
|
+ filterPopup.value?.close();
|
|
|
+};
|
|
|
+const resetFilter = () => {
|
|
|
+ orderName.value = "";
|
|
|
+ createTime.value = getCurrentMonthRange();
|
|
|
+};
|
|
|
const navigatorDetail = (item, type) => {
|
|
|
console.log("item", item);
|
|
|
const param = {
|
|
|
@@ -276,18 +333,6 @@ onShow(() => {
|
|
|
<style lang="scss" scoped>
|
|
|
@import "@/style/work-order.scss";
|
|
|
|
|
|
-.search-row {
|
|
|
- height: 35px;
|
|
|
- background: #f3f5f9;
|
|
|
-
|
|
|
- .mini-btn {
|
|
|
- height: 35px;
|
|
|
- line-height: 35px;
|
|
|
- width: 100%;
|
|
|
- margin-left: 8px;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
.item {
|
|
|
width: 100%;
|
|
|
// height: 245px;
|
|
|
@@ -297,4 +342,79 @@ onShow(() => {
|
|
|
border-radius: 6px;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+
|
|
|
+.filter-popup {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-header {
|
|
|
+ height: 48px;
|
|
|
+ padding: 0 16px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-bottom: 1px solid #f0f0f0;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-title {
|
|
|
+ color: #333;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-action {
|
|
|
+ min-width: 48px;
|
|
|
+ color: #666;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-action.primary {
|
|
|
+ color: #004098;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-body {
|
|
|
+ padding: 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-item + .filter-item {
|
|
|
+ margin-top: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-label {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ color: #333;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-footer {
|
|
|
+ display: flex;
|
|
|
+ padding: 10px 16px 14px;
|
|
|
+ border-top: 1px solid #f0f0f0;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-button {
|
|
|
+ flex: 1;
|
|
|
+ height: 38px;
|
|
|
+ margin: 0;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 38px;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-button + .filter-button {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.filter-button.reset {
|
|
|
+ border: 1px solid #004098;
|
|
|
+ background: #fff;
|
|
|
+ color: #004098;
|
|
|
+}
|
|
|
</style>
|