Jelajahi Sumber

修改订单查询的备注查询

Alex 10 bulan lalu
induk
melakukan
1d5a0016e3
1 mengubah file dengan 122 tambahan dan 99 penghapusan
  1. 122 99
      src/views/recycleOrder/components/order-search.vue

+ 122 - 99
src/views/recycleOrder/components/order-search.vue

@@ -1,145 +1,168 @@
 <!-- 搜索表单 -->
 <template>
-    <ele-card :body-style="{ paddingBottom: '8px' }">
-        <ProSearch :items="columns" ref="searchRef" :isShowLabel="false" @search="search">
-            <el-col :span="6" style="min-width: 160px">
-                <el-button style="width: 80px" type="primary" plain @click="search">查询</el-button>
-                <el-button style="width: 80px" type="info" @click="reset">重置</el-button>
-            </el-col>
-        </ProSearch>
-    </ele-card>
+  <ele-card :body-style="{ paddingBottom: '8px' }">
+    <ProSearch
+      :items="columns"
+      ref="searchRef"
+      :isShowLabel="false"
+      @search="search"
+    >
+      <el-col :span="6" style="min-width: 160px">
+        <el-button style="width: 80px" type="primary" plain @click="search"
+          >查询</el-button
+        >
+        <el-button style="width: 80px" type="info" @click="reset"
+          >重置</el-button
+        >
+      </el-col>
+    </ProSearch>
+  </ele-card>
 </template>
 
 <script setup>
-import { reactive, ref, defineEmits } from 'vue';
-import { useFormData } from '@/utils/use-form-data';
-import ProSearch from '@/components/CommonPage/ProSearch2.vue';
-import request from '@/utils/request';
+  import { reactive, ref, defineEmits } from 'vue';
+  import { useFormData } from '@/utils/use-form-data';
+  import ProSearch from '@/components/CommonPage/ProSearch2.vue';
+  import request from '@/utils/request';
 
-const emit = defineEmits(['search']);
-const columns = ref([
+  const emit = defineEmits(['search']);
+  const columns = ref([
     {
-        type: 'input',
-        label: '发件人名称',
-        prop: 'sendNameLike'
+      type: 'input',
+      label: '发件人名称',
+      prop: 'sendNameLike'
     },
     {
-        type: 'input',
-        label: '发件人电话',
-        prop: 'sendMobileLike'
+      type: 'input',
+      label: '发件人电话',
+      prop: 'sendMobileLike'
     },
     {
-        type: 'input',
-        label: '发件人地址(仅查询7天内数据)',
-        prop: 'sendAddressLike',
-        colProps: { span: 5 }
+      type: 'input',
+      label: '发件人地址(仅查询7天内数据)',
+      prop: 'sendAddressLike',
+      colProps: { span: 5 }
     },
     {
-        type: 'input',
-        label: '用户名',
-        prop: 'userName'
+      type: 'input',
+      label: '用户名',
+      prop: 'userName'
     },
     {
-        type: 'input',
-        label: '搜索备注关键字',
-        prop: 'userRemark'
+      type: 'autocomplete',
+      label: '全部备注',
+      prop: 'remark',
+      props: {
+        fetchSuggestions: (queryString, cb) => {
+          cb([
+            { value: '无内容', label: '0' },
+            { value: '有内容', label: '1' }
+          ]);
+        }
+      }
     },
     {
-        type: 'select',
-        label: '收货仓库',
-        prop: 'godownId',
-        options: [],
-        colProps: { span: 3 },
+      type: 'select',
+      label: '收货仓库',
+      prop: 'godownId',
+      options: [],
+      colProps: { span: 3 }
     },
     {
-        type: 'dictSelect',
-        label: '订单类型',
-        prop: 'orderType',
-        props: { code: 'order_type' }
+      type: 'dictSelect',
+      label: '订单类型',
+      prop: 'orderType',
+      props: { code: 'order_type' }
     },
     {
-        type: 'dictSelect',
-        label: '物流公司',
-        prop: 'finalExpress',
-        props: { code: 'final_express' }
+      type: 'dictSelect',
+      label: '物流公司',
+      prop: 'finalExpress',
+      props: { code: 'final_express' }
     },
     {
-        type: 'dictSelect',
-        label: '全部方式',
-        prop: 'expressType',
-        props: { code: 'express_type' }
+      type: 'dictSelect',
+      label: '全部方式',
+      prop: 'expressType',
+      props: { code: 'express_type' }
     },
     {
-        type: 'datetime',
-        label: '建单时间(开始时间)',
-        prop: 'createTimeStart',
-        props: {
-            format: 'YYYY-MM-DD HH:mm:ss',
-            valueFormat: 'YYYY-MM-DD HH:mm:ss'
-        }
+      type: 'datetime',
+      label: '建单时间(开始时间)',
+      prop: 'createTimeStart',
+      props: {
+        format: 'YYYY-MM-DD HH:mm:ss',
+        valueFormat: 'YYYY-MM-DD HH:mm:ss'
+      }
     },
     {
-        type: 'datetime',
-        label: '建单时间(结束时间)',
-        prop: 'createTimeEnd',
-        props: {
-            valueFormat: 'YYYY-MM-DD HH:mm:ss'
-        }
+      type: 'datetime',
+      label: '建单时间(结束时间)',
+      prop: 'createTimeEnd',
+      props: {
+        valueFormat: 'YYYY-MM-DD HH:mm:ss'
+      }
     },
     {
-        type: 'datetime',
-        label: '提交时间(开始时间)',
-        prop: 'orderTimeStart',
-        props: {
-            valueFormat: 'YYYY-MM-DD HH:mm:ss'
-        }
+      type: 'datetime',
+      label: '提交时间(开始时间)',
+      prop: 'orderTimeStart',
+      props: {
+        valueFormat: 'YYYY-MM-DD HH:mm:ss'
+      }
     },
     {
+      type: 'datetime',
+      label: '提交时间(结束时间)',
+      prop: 'orderTimeEnd',
+      props: {
         type: 'datetime',
-        label: '提交时间(结束时间)',
-        prop: 'orderTimeEnd',
-        props: {
-            type: 'datetime',
-            valueFormat: 'YYYY-MM-DD HH:mm:ss'
-        }
+        valueFormat: 'YYYY-MM-DD HH:mm:ss'
+      }
     },
     {
-        type: 'input',
-        label: '订单编号(多个以中文逗号、空格或换行分割)',
-        prop: 'orderIds',
-        colProps: { span: 7 }
+      type: 'input',
+      label: '订单编号(多个以中文逗号、空格或换行分割)',
+      prop: 'orderIds',
+      colProps: { span: 7 }
     },
     {
-        type: 'input',
-        label: '物流单号(多个以中文逗号、空格或换行分割)',
-        prop: 'waybillCodes',
-        colProps: { span: 7 }
+      type: 'input',
+      label: '物流单号(多个以中文逗号、空格或换行分割)',
+      prop: 'waybillCodes',
+      colProps: { span: 7 }
     }
-]);
+  ]);
 
-//获取仓库数据
-function getGodownList() {
+  //获取仓库数据
+  function getGodownList() {
     request.post('/baseinfo/godown/searchGodown?name=').then((res) => {
-        if (res.data.code === 200) {
-            let item = columns.value.find((item) => item.prop === 'godownId');
-            item.options = res.data.data.map((item) => ({
-                label: item.godownName,
-                value: item.id
-            }));
-        }
+      if (res.data.code === 200) {
+        let item = columns.value.find((item) => item.prop === 'godownId');
+        item.options = res.data.data.map((item) => ({
+          label: item.godownName,
+          value: item.id
+        }));
+      }
     });
-}
-getGodownList()
+  }
+  getGodownList();
 
-const searchRef = ref(null);
-/** 搜索 */
-const search = (data) => {
+  const searchRef = ref(null);
+  /** 搜索 */
+  const search = (data) => {
+    data.remark =
+      data.remark === '无内容'
+        ? '0'
+        : data.remark === '有内容'
+          ? '1'
+          : data.remark;
     emit('search', { ...data });
-};
+  };
 
-/** 重置 */
-const reset = () => {
+  /** 重置 */
+  const reset = () => {
     resetFields();
     search();
-};
+  };
 </script>