wuhongyu 5 年之前
父節點
當前提交
cf536259c6

+ 93 - 0
src/layout/transaction/detaliinfo.vue

@@ -0,0 +1,93 @@
+<template>
+  <div id="person">
+    <el-col :span="24" class="info">
+      <van-form @submit="onSubmit">
+        <van-field
+          v-model="form.product_name"
+          name="产品名称"
+          label="产品名称"
+          placeholder="请输入产品名称"
+          disabled
+          :rules="[{ required: true, message: '请输入产品名称' }]"
+        />
+
+        <van-field
+          v-model="form.market_username"
+          name="营销人名称"
+          label="营销人名称"
+          placeholder="请输入营销人名称"
+          disabled
+          :rules="[{ required: true, message: '请输入营销人名称' }]"
+        />
+
+        <van-field
+          v-model="form.username"
+          name="购买人名称"
+          label="购买人名称"
+          placeholder="请输入购买人名称"
+          disabled
+          :rules="[{ required: true, message: '请输入购买人名称' }]"
+        />
+      </van-form>
+
+      <van-field
+        type="textarea"
+        disabled
+        v-model="form.description"
+        name="描述"
+        label="描述"
+        placeholder="请输入描述"
+        :rules="[{ required: true, message: '请输入描述' }]"
+      />
+      <van-field name="radio" label="单选框">
+        <template #input>
+          <van-radio-group v-model="radio" direction="horizontal">
+            <van-radio name="0">待审核 </van-radio>
+            <van-radio name="1">审核通过</van-radio>
+          </van-radio-group>
+        </template>
+      </van-field>
+
+      <div style="margin: 16px;">
+        <van-button round block type="info" native-type="submit" @click="onSubmit">
+          保存
+        </van-button>
+      </div>
+    </el-col>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'person',
+  props: {
+    form: null,
+  },
+  components: {},
+  data: () => ({
+    // 出生日期
+  }),
+  created() {},
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  methods: {
+    // 出生日期
+
+    onSubmit() {
+      console.log(this.form);
+
+      this.$emit('onSubmit', { data: this.form });
+    },
+    // 图片上传
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  margin: 0 0 50px 0;
+}
+</style>

+ 9 - 0
src/router/index.js

@@ -190,6 +190,15 @@ const routes = [
     meta: { title: '产品供求交易状态审核管理', isleftarrow: true },
     component: () => import('../views/adminCenter/transaction/index.vue'),
   },
+
+  // 管理员个人中心-产品供求交易状态审核管理
+  {
+    path: '/adminCenter/transaction/detail',
+    name: 'adminCenter_detail',
+    meta: { title: '产品供求交易状态审核管理详情', isleftarrow: true },
+    component: () => import('../views/adminCenter/transaction/detail.vue'),
+  },
+
   ,
 ];
 

+ 103 - 0
src/views/adminCenter/transaction/detail.vue

@@ -0,0 +1,103 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <detaliinfo :form="form" @onSubmit="onSubmit"></detaliinfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import detaliinfo from '@/layout/transaction/detaliinfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
+const { mapActions: productpact } = createNamespacedHelpers('productpact');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    NavBar,
+    detaliinfo, //个人信息维护
+  },
+  data: () => ({
+    // 头部标题
+    title: '',
+    // meta为true
+    isleftarrow: '',
+    // 返回
+    navShow: true,
+    // 个人信息
+    form: {},
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    role() {
+      return this.$route.query.role;
+    },
+  },
+  methods: {
+    ...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
+    ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
+    async searchInfo() {
+      const res = await this.productpactFetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    async onSubmit({ data }) {
+      const res = await this.productpactUpdate(this.form);
+      if (this.$checkRes(res)) {
+        this.form.status = '2';
+        this.form.id = this.form.transaction_id;
+        const arr = await this.transactionupdate(this.form);
+        if (this.$checkRes(arr)) {
+          this.$message({
+            message: '审核通过',
+            type: 'success',
+          });
+        }
+      }
+      this.$router.push({ path: './index' });
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+  position: relative;
+  z-index: 999;
+}
+.main {
+  min-height: 570px;
+}
+.foot {
+  position: absolute;
+  bottom: 0;
+}
+</style>

+ 39 - 40
src/views/adminCenter/transaction/parts/list.vue

@@ -4,21 +4,23 @@
       <el-col :span="24" class="info">
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <p class="textOver">
-            <span class="titel">{{ item.name }}</span>
-            <span style="float:right;margin:0 0 0  5px;"> <van-button type="info" size="mini" @click="sussess(item)">审核通过</van-button></span>
+            <span @click="$router.push({ path: '/userCenter/matter/detailinfo', query: { id: item.id } })">{{ item.product_name }}</span>
+            <span style="float:right"><van-button v-if="item.status == '4'" type="primary" size="small" @click="submit(item)">审核</van-button> </span>
           </p>
-          <p class="newptwo">
-            <span class="ptwo"><span>类型:</span>{{ item.status == '0' ? '技术' : item.status == '1' ? '产品' : '服务' }}</span>
+          <p>
+            <span class="ptwo"><span>购买人名称:</span>{{ item.username || '暂无' }}</span>
           </p>
 
-          <p class="newptwo">
-            <span class="ptwo"><span>联系人:</span>{{ item.contact_user }}</span>
+          <p>
+            <span class="ptwo"><span>营销人名称:</span>{{ item.market_username || '暂无' }}</span>
+            <span>状态:</span
+            >{{
+              item.status == '0' ? '正在洽谈' : item.status == '1' ? '达成意向' : item.status == '2' ? '我的交易' : item.status == '4' ? '合同审核中' : '未识别'
+            }}
           </p>
-          <p class="newptwo">
-            <span>审核状态:</span>{{ item.status == '0' ? '待审核' : item.status == '1' ? '审核成功' : item.status == '2' ? '审核拒绝' : '草稿' }}
-          </p>
-          <p class="newptwo"><span>简介:</span>{{ item.introduction }}</p></el-col
-        >
+
+          <p class="textOver"><span>说明:</span>{{ item.description || '暂无' }}</p>
+        </el-col>
       </el-col>
     </el-row>
   </div>
@@ -26,7 +28,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: product } = createNamespacedHelpers('transaction');
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
 
 export default {
   name: 'auditList',
@@ -34,25 +36,32 @@ export default {
   components: {},
   data: function() {
     return {
-      list: [{ name: '1' }],
+      list: [],
     };
   },
   created() {
     this.searchInfo();
   },
   methods: {
-    ...transaction(['query', 'update']),
+    ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
     async searchInfo() {
       if (this.user.role == '4') {
         let userid = this.user.uid;
-        let res = await this.query({ userid });
-        this.$set(this, `list`, res.data);
+        let res = await this.transactionList({ userid });
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+        }
       } else {
-        let res = await this.query();
-        this.$set(this, `list`, res.data);
+        let userid = this.user.uid;
+        let res = await this.transactionList();
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+        }
       }
     },
-    async sussess(item) {},
+    async submit(item) {
+      this.$router.push({ path: './detail', query: { id: item.id } });
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -67,13 +76,8 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.newuser {
-  float: right;
-  padding: 10px 0 10px 10px;
-}
 .info {
   border-top: 1px solid #f5f5f5;
-
   .list {
     background: #fff;
     padding: 0 10px;
@@ -88,8 +92,18 @@ export default {
     }
     p:nth-child(2) .ptwo {
       display: inline-block;
-      width: 50%;
+      width: 75%;
+    }
+
+    p:nth-child(3) .ptwo {
+      display: inline-block;
+      width: 40%;
+    }
+
+    p:nth-child(3) .ptwo span:first-child {
+      color: #ccc;
     }
+
     p:nth-child(2) .ptwo span:first-child {
       color: #ccc;
     }
@@ -106,19 +120,4 @@ export default {
 .newptwo {
   color: #ccc !important;
 }
-/deep/.van-button--small {
-  min-width: 60px;
-  height: 30px;
-  padding: 0 8px;
-  font-size: 12px;
-  margin: 0 5px 0 0;
-}
-.titel {
-  display: inline-block;
-  width: 41%;
-
-  overflow: hidden;
-  text-overflow: ellipsis;
-  whitewhite-space: nowrap;
-}
 </style>