Browse Source

始宁农业管理后台:农产品管理-上架申请

panyong 2 years ago
parent
commit
32730c6046

+ 10 - 0
htmldev/shiningManage/src/mixin/page.js

@@ -41,6 +41,16 @@ export default {
             }
           })
         }
+        if (['/api/admin/un/product/list'].findIndex(item => item === this.tableUrl) > -1) {
+          data.list = data.list.map(item => {
+            return {
+              ...item,
+              product_rotation_img_list: item.product_rotation_img_list ? JSON.parse(item.product_rotation_img_list) : {},
+              product_detail_img_list: item.product_detail_img_list ? JSON.parse(item.product_detail_img_list) : {}
+            }
+          })
+        }
+
         this.tableData = data.data || data.list || data
         this.totalCount = Number(data.total || data.count)
 

+ 26 - 31
htmldev/shiningManage/src/views/productManage/toBeReviewed/details.vue

@@ -7,38 +7,45 @@
       :close-on-click-modal="false"
       top="50px">
       <el-form
-        ref="formOfForbid"
+        ref="form"
         :rules="formRules"
         :model="form"
         label-width="120px">
         <el-form-item
           label="审核:"
-          prop="crash_status">
-          <el-radio-group v-model="form.crash_status">
+          prop="type"
+          :rules="formRules.select">
+          <el-radio-group
+            v-model="form.type">
             <el-radio
               :label="item.value"
-              v-for="item in statusOptions"
+              v-for="item in reviewStatus"
               :key="item.value">{{ item.name }}
             </el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item
           label="备注:"
-          prop="user_ids"
-          :rules="formRules.required">
+          prop="product_check_remark">
           <el-input
             type="textarea"
             :rows="6"
-            placeholder="请输入未通过理由"
-            v-model="form.user_ids"
+            placeholder="请输入备注"
+            v-model="form.product_check_remark"
             maxlength="1000"
             show-word-limit>
           </el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" style="text-align: center">
-        <el-button @click="dialog = false">取 消</el-button>
-        <el-button type="primary" @click="handleSubmit" :disabled="booLock">保存</el-button>
+        <el-button
+          @click="dialog = false">取 消
+        </el-button>
+        <el-button
+          type="primary"
+          @click="handleSubmit"
+          :disabled="booLock">保存
+        </el-button>
       </div>
     </el-dialog>
   </div>
@@ -62,14 +69,14 @@ export default {
     return {
       dialog: !!this.value,
       form: {
-        user_ids: ''
+        'product_check_remark': '', // 审核备注
+        'type': '1' // 状态(1通过2未通过)
       },
       booLock: false
     }
   },
   computed: {
-    paymentInformationReviewStatus() {
-      // return this.$store.state.common.paymentInformationReviewStatus
+    reviewStatus() {
       return [
         {
           name: '通过',
@@ -80,33 +87,18 @@ export default {
           value: '2'
         }
       ]
-    },
-    statusOptions() {
-      return this.paymentInformationReviewStatus
     }
   },
   methods: {
     async handleSubmit() {
-      this.$refs.formOfForbid.validate(async valid => {
+      this.$refs.form.validate(async valid => {
         if (valid) {
           this.booLock = true
-          const postData = {
-            user_ids: this.form.user_ids
-          }
-          const data = await this.$fetch('/v1/user/special/account/open', postData)
+          const data = await this.$fetch('/api/admin/product/check', this.form)
           if (data.code === 200) {
             this.dialog = false
-            this.$message.success('添加成功')
+            this.$message.success('已审核')
             this.$emit('success')
-          } else if (data.code === 500) {
-            // 新增失败
-            this.$alert(data.msg, '提示', {
-              confirmButtonText: '确定',
-              type: 'error',
-              callback: action => {
-
-              }
-            })
           }
           this.booLock = false
         }
@@ -114,6 +106,9 @@ export default {
     }
   },
   mounted() {
+    if (this.exData.id) {
+      this.$set(this.form, 'id', this.exData.id)
+    }
   },
   watch: {
     dialog(val) {

+ 49 - 3
htmldev/shiningManage/src/views/productManage/toBeReviewed/index.vue

@@ -48,26 +48,72 @@
       class="marginT-10 order-table"
       border
       :max-height="vheight">
-      <el-table-column label="农产品名字" prop="product_title"></el-table-column>
-      <el-table-column label="类型" prop="product_sale_at">
-        <template slot-scope="scope">{{ scope.row.product_sale_at > 0 ? '现货' : '预售' }}</template>
+      <el-table-column label="商品主图" prop="product_img_url" min-width="100">
+        <template slot-scope="scope">
+          <el-image
+            style="display:block;width: 80px; height: 80px;font-size: 0;"
+            :src="scope.row.product_img_url"
+            :preview-src-list="[scope.row.product_img_url]">
+          </el-image>
+        </template>
       </el-table-column>
+      <el-table-column label="商品轮播图" prop="product_rotation_img_list" min-width="100">
+        <template slot-scope="scope">
+          <template v-if="scope.row.product_rotation_img_list.length > 0">
+            <el-image
+              style="display:block;width: 80px; height: 80px;font-size: 0;"
+              :src="scope.row.product_rotation_img_list[0]"
+              :preview-src-list="scope.row.product_rotation_img_list">
+            </el-image>
+          </template>
+        </template>
+      </el-table-column>
+      <el-table-column label="商品详情图" prop="product_detail_img_list" min-width="100">
+        <template slot-scope="scope">
+          <template v-if="scope.row.product_detail_img_list.length > 0">
+            <el-image
+              style="display:block;width: 80px; height: 80px;font-size: 0;"
+              :src="scope.row.product_detail_img_list[0]"
+              :preview-src-list="scope.row.product_detail_img_list">
+            </el-image>
+          </template>
+        </template>
+      </el-table-column>
+      <el-table-column label="农产品名字" prop="product_title"></el-table-column>
+      <el-table-column label="农产品描述" prop="product_desc" show-overflow-tooltip></el-table-column>
+      <el-table-column label="分类" prop="product_category_name"></el-table-column>
+      <el-table-column label="商品品牌" prop="product_brand_name"></el-table-column>
+      <el-table-column label="商品规格" prop="product_spec"></el-table-column>
+      <el-table-column label="单位" prop="product_unit"></el-table-column>
+      <el-table-column label="商品货号" prop="product_code"></el-table-column>
       <el-table-column label="批发价(元)" prop="product_all_price">
         <template slot-scope="scope">{{ scope.row.product_all_price | fen2Yuan }}</template>
       </el-table-column>
       <el-table-column label="零售价(元)" prop="product_price">
         <template slot-scope="scope">{{ scope.row.product_price | fen2Yuan }}</template>
       </el-table-column>
+      <el-table-column label="库存" prop="product_count"></el-table-column>
+      <el-table-column label="发售时间" prop="product_title">
+        <template slot-scope="scope">{{ scope.row.product_sale_at > 0 ? scope.row.product_sale_at : '' }}</template>
+      </el-table-column>
+      <el-table-column label="类型" prop="product_sale_at">
+        <template slot-scope="scope">{{ scope.row.product_sale_at > 0 ? '现货' : '预售' }}</template>
+      </el-table-column>
       <el-table-column label="申请人" prop="user_id" show-overflow-tooltip>
         <template slot-scope="scope">
           {{ scope.row.user_id }}{{ scope.row.user_name ? scope.row.user_name + '/' : '' }}
         </template>
       </el-table-column>
+      <el-table-column label="店铺名称" prop="shop_name" show-overflow-tooltip>
+        <template slot-scope="scope">{{ scope.row.shop_name }}</template>
+      </el-table-column>
       <el-table-column label="审核状态" prop="product_status">
         <template slot-scope="scope">{{ getProductStatusText(scope.row.product_status) }}</template>
       </el-table-column>
       <el-table-column label="申请时间" prop="created_at" min-width="120"></el-table-column>
       <el-table-column label="审核人" prop="product_check_name"></el-table-column>
+      <el-table-column label="审核备注" prop="product_check_remark" show-overflow-tooltip></el-table-column>
+      <el-table-column label="审核时间" prop="product_check_at"></el-table-column>
       <el-table-column label="操作">
         <template slot-scope="scope">
           <el-button type="text" @click="edit(scope.row)">操作</el-button>