guhongwei 3 年 前
コミット
c9f314f94c
2 ファイル変更36 行追加28 行削除
  1. 17 17
      src/views/menu/market/index.vue
  2. 19 11
      src/views/menu/order/index.vue

+ 17 - 17
src/views/menu/market/index.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one">
-          <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @export="toExport">
+          <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @check="toCheck">
             <template #options="{ item }">
               <template v-if="item.prop == 'status'">
                 <el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.value"></el-option>
@@ -40,7 +40,7 @@ export default {
       fields: [
         { label: '商品名称', prop: 'name', filter: true },
         { label: '商品类型', prop: 'type_name', filter: true },
-        { label: '商品价格', prop: 'money', filter: 'select' },
+        { label: '商品价格', prop: 'money' },
         {
           label: '商品状态',
           prop: 'status',
@@ -53,10 +53,10 @@ export default {
       ],
       //操作项
       opera: [
-        { label: '详细信息', method: 'view' },
-        { label: '上架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '0' },
-        { label: '下架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '1' },
-        { label: '重新上架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '2' },
+        { label: '详', method: 'view' },
+        { label: '上架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '0' },
+        { label: '下架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '1' },
+        { label: '重新上架', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '2' },
       ],
       //表格数据
       list: [
@@ -64,18 +64,18 @@ export default {
           name: '喜羊羊',
           type_name: '羊肉',
           money: '22',
-          status: '1',
+          status: '0',
           brief: '一份',
           img_url: [{ url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }, { url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }],
         },
-        { name: '喜羊羊', type_name: '羊肉', money: '22', status: '0', brief: '一份' },
         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
+        { name: '喜羊羊', type_name: '羊肉', money: '22', status: '2', brief: '一份' },
       ],
       // 列表数据总数
       total: 0,
       //弹框
       dialog: { title: '详细信息', show: false, type: '1' },
-      form: { order: [], img_url: [] },
+      form: { img_url: [] },
       // 状态
       statusList: [
         { label: '待上架', value: '0' },
@@ -89,27 +89,27 @@ export default {
   },
   methods: {
     //查询数据
-    async search() {},
+    async search({ skip = 0, limit = 10, ...info } = {}) {},
     //详细信息
     async toView({ data }) {
       this.$set(this, `form`, data);
       this.dialog = { title: '详细信息', show: true, type: '2', widths: '40%' };
     },
+    // 添加
+    toAdd() {
+      this.dialog = { title: '添加信息', show: true, type: '1', widths: '40%' };
+    },
     //上架,下架,重新上架
-    async toExport({ data }) {
-      this.dialog = { title: '导出条件', show: true, type: '1', widths: '40%' };
+    async toCheck({ data }) {
+      console.log(data);
     },
     // 提交保存,创建/修改
     async toSave({ data }) {
       console.log(data);
     },
-    // 添加
-    toAdd() {
-      this.dialog = { title: '添加信息', show: true, type: '1', widths: '40%' };
-    },
     //关闭
     toClose() {
-      this.form = { order: [] };
+      this.form = { img_url: [] };
       this.dialog = { title: '详细信息', show: false, type: '1' };
       this.search();
     },

+ 19 - 11
src/views/menu/order/index.vue

@@ -5,8 +5,8 @@
         <el-col :span="24" class="one">
           <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @view="toView">
             <template #options="{ item }">
-              <template v-if="item.prop == 'status_name'">
-                <el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.label"></el-option>
+              <template v-if="item.prop == 'status'">
+                <el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.value"></el-option>
               </template>
             </template>
           </data-table>
@@ -39,13 +39,21 @@ export default {
         { label: '收货人', prop: 'receive_user_name', filter: true },
         { label: '收货电话', prop: 'receive_user_phone', filter: true },
         { label: '收货地址', prop: 'receive_address', filter: true },
-        { label: '货物状态', prop: 'status_name', filter: 'select' },
+        {
+          label: '货物状态',
+          prop: 'status',
+          filter: 'select',
+          format: (i) => {
+            let data = this.statusList.find((r) => r.value == i);
+            if (data) return data.label;
+          },
+        },
       ],
       //操作项
       opera: [
-        { label: '详细信息', method: 'view' },
+        { label: '详', method: 'view' },
         { label: '订单确认', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '0' },
-        { label: '订单确认签收', method: 'sign', type: 'success', confirm: true, display: (i) => i.status == '2' },
+        { label: '确认签收', method: 'sign', type: 'success', confirm: true, display: (i) => i.status == '2' },
       ],
       //表格数据
       list: [
@@ -65,7 +73,7 @@ export default {
           order_num: 'Hgj4757945hdFueu',
           receive_user_name: '胡图图',
           mech_name: '翻斗幼儿园-小豆班',
-          status: '1',
+          status: '2',
           user_name: '采购人员',
           user_phone: '12345678901',
           money: '3344',
@@ -82,7 +90,7 @@ export default {
       //弹框
       dialog: { title: '详细信息', show: false, type: '1' },
       form: { order: [] },
-      statusList: [],
+      statusList: buy_status,
     };
   },
   async created() {
@@ -90,10 +98,10 @@ export default {
   },
   methods: {
     //查询数据
-    async search() {
-      for (const val of this.list) {
-        val.status_name = buy_status.find((i) => i.value == val.status).label;
-      }
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // for (const val of this.list) {
+      //   val.status_name = buy_status.find((i) => i.value == val.status).label;
+      // }
     },
     //详细信息
     async toView({ data }) {