guhongwei 3 vuotta sitten
vanhempi
commit
dc7f8883e7

+ 12 - 13
src/views/menu/market/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" @export="toExport">
             <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>
             <template #selfbtn>
@@ -26,9 +26,7 @@
 </template>
 
 <script>
-const { type } = require('@common/src/layout/deploy/dict');
 import { mapState, createNamespacedHelpers } from 'vuex';
-const moment = require('moment');
 export default {
   name: 'index',
   props: {},
@@ -47,19 +45,16 @@ export default {
           label: '商品状态',
           prop: 'status',
           filter: 'select',
-          format: (i) => (i == '0' ? '待上架' : i == '1' ? '已上架' : i == '2' ? '已下架' : '暂无'),
+          format: (i) => {
+            let data = this.statusList.find((r) => r.value == i);
+            if (data) return data.label;
+          },
         },
       ],
       //操作项
       opera: [
         { label: '详细信息', method: 'view' },
-        {
-          label: '下架',
-          method: 'export',
-          type: 'success',
-          confirm: true,
-          display: (i) => i.status == '1',
-        },
+        { label: '下架', method: 'export', type: 'success', confirm: true, display: (i) => i.status == '1' },
       ],
       //表格数据
       list: [
@@ -80,7 +75,11 @@ export default {
       dialog: { title: '详细信息', show: false, type: '1' },
       form: { order: [], img_url: [] },
       // 状态
-      statusList: type,
+      statusList: [
+        { label: '待上架', value: '0' },
+        { label: '已上架', value: '1' },
+        { label: '已下架', value: '2' },
+      ],
     };
   },
   async created() {

+ 26 - 20
src/views/menu/market_buy/detail.vue

@@ -27,17 +27,19 @@
       <template slot="info">
         <el-col :span="24" v-if="dialog.type == '1'">
           <el-col class="orderForm" :span="24" v-for="(item, index) in orderForm" :key="index">
-            <el-col :span="24" class="name">
+            <el-col :span="24" class="mech_name">
               供货单位:<span>{{ item.mech_name }}</span>
             </el-col>
-            <el-col :span="24" class="money">
+            <el-col :span="24" class="totalMoney">
               选购总价:<span>{{ item.totalMoney }}¥</span>
             </el-col>
-            <el-col class="orderlist" :span="11" v-for="(order, index) in item.order" :key="index">
-              <el-col :span="24" class="name">商品名称:{{ order.name }}</el-col>
-              <el-col :span="24" class="num"> 选购数量:{{ order.num }}</el-col>
-              <el-col :span="24" class="money"
-                >商品单价:<span>{{ order.money }}¥</span>
+            <el-col :span="24" class="order">
+              <el-col class="orderlist" :span="12" v-for="(order, index) in item.order" :key="index">
+                <el-col :span="24" class="txt">商品名称:{{ order.name }}</el-col>
+                <el-col :span="24" class="txt"> 选购数量:{{ order.num }}</el-col>
+                <el-col :span="24" class="txt">
+                  商品单价:<span>{{ order.money }}¥</span>
+                </el-col>
               </el-col>
             </el-col>
           </el-col>
@@ -236,10 +238,10 @@ export default {
   }
 }
 .orderForm {
-  padding: 15px;
+  padding: 10px;
   border: 1px solid #ccc;
-  margin-top: 10px;
-  .name {
+  margin: 0 0 10px 0;
+  .mech_name {
     margin: 0 0 5px 0;
     overflow: hidden;
     text-overflow: ellipsis;
@@ -251,7 +253,7 @@ export default {
       color: #000;
     }
   }
-  .money {
+  .totalMoney {
     span {
       color: red;
       font-size: 14px;
@@ -259,22 +261,26 @@ export default {
     }
   }
   .orderlist {
-    padding: 10px;
+    width: 49%;
     border: 1px solid #ccc;
-    margin-top: 10px;
-    margin-right: 5px;
-    .name {
-      color: #000;
+    padding: 10px;
+    margin: 0 10px 10px 0;
+    .txt {
       font-size: 14px;
-      font-weight: bold;
+      margin: 0 0 5px 0;
     }
-    .money {
+    .txt:nth-child(3) {
       span {
-        color: red;
-        font-size: 14px;
+        color: #ff0000;
         font-weight: bold;
       }
     }
   }
+  .orderlist:nth-child(2n) {
+    margin: 0 0 10px 0;
+  }
+  .order {
+    margin: 10px 0 0 0;
+  }
 }
 </style>

+ 8 - 8
src/views/menu/market_buy/index.vue

@@ -104,27 +104,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.$router.push({ path: '/menu/market_buy/detail' });
+    },
     //导出数据
     async toExport() {
       this.dialog = { title: '导出条件', show: true, type: '1', widths: '40%' };
     },
-    // 订单签收
-    async toSign({ data }) {
-      console.log(data);
-    },
     //导出
     async toSave({ data }) {
       console.log(data);
     },
-    // 添加
-    toAdd() {
-      this.$router.push({ path: '/menu/market_buy/detail' });
+    // 订单签收
+    async toSign({ data }) {
+      console.log(data);
     },
     //关闭
     toClose() {

+ 8 - 12
src/views/menu/payment/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">
+          <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_name'">
                 <el-option v-for="item in statusList" :key="item.label" :label="item.label" :value="item.label"></el-option>
@@ -15,7 +15,7 @@
     </el-row>
     <e-dialog :dialog="dialog" @toClose="toClose">
       <template slot="info">
-        <info-1 :form="form"></info-1>
+        <info-1 v-if="dialog.type == '1'" :form="form"></info-1>
       </template>
     </e-dialog>
   </div>
@@ -44,7 +44,7 @@ export default {
       //操作项
       opera: [
         { label: '详情', method: 'view' },
-        { label: '订单确认', method: 'confirm', type: 'success', confirm: true, display: (i) => i.status == '3' },
+        { label: '订单确认', method: 'check', type: 'success', confirm: true, display: (i) => i.status == '3' },
       ],
       //表格数据
       list: [
@@ -91,26 +91,22 @@ 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: '1', widths: '40%' };
     },
+    // 订单确定
+    toCheck({ data }) {
+      console.log(data);
+    },
     //关闭
     toClose() {
       this.form = { order: [] };
       this.dialog = { title: '详细信息', show: false, type: '1' };
       this.search();
     },
-    // 商品信息保存
-    orderSave({ data }) {
-      this.form.order.push(data);
-    },
-    // 删除商品信息
-    orderDelete({ index }) {
-      this.form.order.splice(index, 1);
-    },
   },
   computed: {
     ...mapState(['user']),