Ver Fonte

修改问题

lex há 1 ano atrás
pai
commit
f17366e5b6

+ 9 - 0
src/api/businessManager.js

@@ -38,6 +38,15 @@ export function goodsAdd(data) {
   });
 }
 
+// 批量新增商品(教材、辅件)
+export function goodsAddBatch(data) {
+  return request({
+    url: api + "/goods/addBatch",
+    method: "post",
+    data: data
+  });
+}
+
 // 修改商品(教材、辅件)
 export function goodsUpdate(data) {
   return request({

+ 2 - 1
src/views/branchPayManager/payschoolList.vue

@@ -214,7 +214,7 @@ export default {
       searchForm: {
         cooperationId: this.$route.query.id,
         refundStatus: "",
-        payTime: null
+        payTime: []
       },
       name: this.$route.query.name,
       backTypeList,
@@ -269,6 +269,7 @@ export default {
     },
     onReSet() {
       this.$refs["searchForm"].resetFields();
+      this.searchForm.payTime = []
       this.searchForm.cooperationId = this.$route.query.id;
       this.search();
     },

+ 17 - 15
src/views/businessManager/shopManager/model/combinationProducts.vue

@@ -708,21 +708,21 @@ export default {
             message: "请选择图片",
             trigger: "blur"
           }
-        ],
-        brief: [
-          {
-            required: true,
-            message: "请输入商品描述",
-            trigger: "blur"
-          }
-        ],
-        desc: [
-          {
-            required: true,
-            message: "请输入商品详情",
-            trigger: "blur"
-          }
         ]
+        // brief: [
+        //   {
+        //     required: true,
+        //     message: "请输入商品描述",
+        //     trigger: "blur"
+        //   }
+        // ],
+        // desc: [
+        //   {
+        //     required: true,
+        //     message: "请输入商品详情",
+        //     trigger: "blur"
+        //   }
+        // ]
       },
       goodsDetail: {},
       cropperOptions: {
@@ -879,7 +879,7 @@ export default {
           }
           form.goodsList = null;
           form.groupGoods = 1;
-          console.log(form, '1221')
+          console.log(form, "1221");
           if (this.addType == "create" || this.addType == "copy") {
             if (this.form.id) {
               // 判断有没有Id,如果有则删除
@@ -956,6 +956,8 @@ export default {
           goodsList.push({
             name: item.name,
             goodsId: item.goodsId,
+            brandId: item.brandId,
+            brandName: item.brandName,
             skuStockId: item.skuStockId,
             skuCode: item.skuCode,
             price: item.price,

+ 204 - 87
src/views/businessManager/shopManager/model/singleProducts.vue

@@ -14,7 +14,7 @@
           v-model.trim="form.educationShowOrganId"
           filterable
           placeholder="移动端可售分部"
-          style="width: 300px !important"
+          style="width: 400px !important"
           multiple
           clearable
           :disabled="addDisabled"
@@ -36,7 +36,7 @@
           v-model.trim="form.courseFeeShowOrganId"
           filterable
           placeholder="课程收费乐团可售分部"
-          style="width: 300px !important"
+          style="width: 400px !important"
           multiple
           clearable
           :disabled="addDisabled"
@@ -58,7 +58,7 @@
           v-model.trim="form.memberFeeShowOrganId"
           filterable
           placeholder="请选择会员收费团可见分部"
-          style="width: 300px !important"
+          style="width: 400px !important"
           multiple
           clearable
           :disabled="addDisabled"
@@ -80,7 +80,7 @@
           v-model.trim="form.freeFeeShowOrganId"
           filterable
           placeholder="请选择会员收费团可见分部"
-          style="width: 300px !important"
+          style="width: 400px !important"
           multiple
           clearable
           :disabled="addDisabled"
@@ -103,7 +103,7 @@
           v-model.trim="form.replacementShowOrganId"
           filterable
           placeholder="请选择乐器置换可售分部"
-          style="width: 300px !important"
+          style="width: 400px !important"
           multiple
           clearable
           :disabled="addDisabled"
@@ -127,13 +127,18 @@
             <tooltip :content="scope.row.name" />
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="productSn" label="商品货号">
+        <el-table-column align="center" prop="sn" label="商品货号">
         </el-table-column>
-        <el-table-column align="center" prop="bankName" label="品牌">
+        <el-table-column align="center" prop="brandName" label="品牌">
         </el-table-column>
         <el-table-column align="center" prop="skuCode" label="sku编号">
         </el-table-column>
-        <el-table-column align="center" prop="marketPrice" label="市场价">
+        <el-table-column
+          align="center"
+          prop="marketPrice"
+          label="市场价"
+          width="160"
+        >
           <template slot-scope="scope">
             <el-form-item
               :show-message="false"
@@ -160,7 +165,12 @@
             </el-form-item>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="discountPrice" label="零售价">
+        <el-table-column
+          align="center"
+          prop="discountPrice"
+          label="零售价"
+          width="160"
+        >
           <template slot-scope="scope">
             <el-form-item
               :show-message="false"
@@ -191,6 +201,7 @@
           align="center"
           prop="groupPurchasePrice"
           label="团购价"
+          width="160"
         >
           <template slot-scope="scope">
             <el-form-item
@@ -218,7 +229,44 @@
             </el-form-item>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="type" label="商品类型">
+        <el-table-column
+          align="center"
+          prop="goodsPrice"
+          label="成本"
+          width="160"
+        >
+          <template slot-scope="scope">
+            <el-form-item
+              :show-message="false"
+              class="tableItem"
+              :prop="'goodsList.' + scope.$index + '.goodsPrice'"
+              :rules="[
+                {
+                  required: true,
+                  validator: validPrice,
+                  trigger: 'blur'
+                }
+              ]"
+            >
+              <el-input-number
+                style="width: 100%!important;"
+                class="number-input"
+                v-model="form.goodsList[scope.$index].goodsPrice"
+                :controls="false"
+                :precision="0"
+                :min="0"
+                placeholder="请选择成本"
+                :disabled="addDisabled"
+              />
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="type"
+          label="商品类型"
+          width="160"
+        >
           <template slot-scope="scope">
             <el-form-item
               :show-message="false"
@@ -232,16 +280,28 @@
                 }
               ]"
             >
-              <el-cascader
+              <el-select
                 v-model.trim="form.goodsList[scope.$index].type"
-                :options="categoryList"
-                placeholder="商品分类"
-                :props="{ checkStrictly: true, expandTrigger: 'hover' }"
-              ></el-cascader>
+                style="width: 100%!important;"
+                clearable
+                placeholder="商品类型"
+              >
+                <el-option
+                  v-for="(item, index) in goodsType"
+                  :key="index"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="goodsCategoryId" label="商品分类">
+        <el-table-column
+          align="center"
+          prop="goodsCategoryId"
+          label="商品分类"
+          width="160"
+        >
           <template slot-scope="scope">
             <el-form-item
               :show-message="false"
@@ -257,11 +317,12 @@
             >
               <el-select
                 v-model.trim="form.goodsList[scope.$index].goodsCategoryId"
+                style="width: 100%!important;"
                 clearable
                 placeholder="商品分类"
               >
                 <el-option
-                  v-for="(item, index) in goodsType"
+                  v-for="(item, index) in categoryList"
                   :key="index"
                   :label="item.label"
                   :value="item.value"
@@ -277,7 +338,7 @@
             </el-tag>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="sn" label="操作">
+        <el-table-column align="center" prop="sn" label="操作" fixed="right">
           <template slot-scope="scope">
             <el-button
               type="text"
@@ -289,7 +350,12 @@
         </el-table-column>
       </el-table>
     </el-form>
-    <span slot="footer" v-if="!addDisabled" class="dialog-footer">
+    <span
+      slot="footer"
+      v-if="!addDisabled"
+      class="dialog-footer"
+      style="padding-top: 12px;"
+    >
       <el-button @click="$listeners.close()">取 消</el-button>
       <el-button @click="onShopSubmit('ruleForm')" type="primary"
         >确 定</el-button
@@ -308,14 +374,17 @@
         :disabledIds="disabledIds"
         @close="recordStatus = false"
         @comfirm="onConfirm"
-        :categoryList="categoryList"
         :goodsBrand="goodsBrand"
       />
     </el-dialog>
   </div>
 </template>
 <script>
-import { goodsAdd, goodsUpdate, api_goodsGet } from "@/api/businessManager";
+import {
+  goodsAddBatch,
+  goodsUpdate,
+  api_goodsGet
+} from "@/api/businessManager";
 import cleanDeep from "clean-deep";
 import subShopGoods from "./subShopGoods.vue";
 let validPrice = (rule, value, callback) => {
@@ -393,26 +462,31 @@ export default {
             form[i] = row[i];
           }
         }
-        if (row.goodsCategoryId) {
-          form.goodsCategoryId = this.formatParentId(
-            row.goodsCategoryId,
-            this.categoryList
-          );
-        }
-        let ids = row.goodsSubList;
-        let goodsList = [];
-        ids.forEach(item => {
-          goodsList.push({
-            name: item.mallGoodsName,
-            goodsId: item.mallGoodsId,
-            skuStockId: item.sku,
-            price: item.price,
-            publishStatus: item.goodsStatus,
-            productSn: item.productSn,
-            goodsPrice: item.goodsPrice // 成本
-          });
-        });
-        form.goodsList = goodsList;
+        const goodsSub =
+          row.goodsSubList && row.goodsSubList.length > 0
+            ? row.goodsSubList[0]
+            : {};
+        form.goodsList = [
+          {
+            name: row.name,
+            sn: row.sn,
+            brandId: row.brand,
+            brandName: row.brandName,
+            type: row.type,
+            goodsCategoryId: row.goodsCategoryId,
+            specification: row.specification,
+            marketPrice: row.marketPrice,
+            discountPrice: row.discountPrice,
+            groupPurchasePrice: row.groupPurchasePrice,
+            groupGoods: row.groupGoods ? 1 : 0,
+            pic: row.image,
+            skuStockId: goodsSub.sku,
+            skuCode: goodsSub.skuCode,
+            goodsPrice: goodsSub.goodsPrice,
+            goodsId: goodsSub.goodsId,
+            publishStatus: goodsSub.goodsStatus
+          }
+        ];
         form.id = row.id;
 
         if (row.studentShowOrganId) {
@@ -447,6 +521,7 @@ export default {
     }
   },
   methods: {
+    validPrice,
     async __init() {
       let params = {
         delFlag: 0,
@@ -474,7 +549,6 @@ export default {
         });
         this.categoryList = tempArray;
       } catch {}
-
     },
     formatParentId(id, list, ids = []) {
       for (const item of list) {
@@ -494,70 +568,95 @@ export default {
       return ids;
     },
     onShopSubmit(formName) {
+      let form = Object.assign({}, this.form);
+      if (form.studentShowOrganId) {
+        form.studentShowOrganId = form.studentShowOrganId.join(",");
+      }
+      if (form.educationShowOrganId) {
+        form.educationShowOrganId = form.educationShowOrganId.join(",");
+      }
+
+      if (form.courseFeeShowOrganId) {
+        form.courseFeeShowOrganId = form.courseFeeShowOrganId.join(",");
+      }
+      if (form.memberFeeShowOrganId) {
+        form.memberFeeShowOrganId = form.memberFeeShowOrganId.join(",");
+      }
+      if (form.freeFeeShowOrganId) {
+        form.freeFeeShowOrganId = form.freeFeeShowOrganId.join(",");
+      }
+      if (form.replacementShowOrganId) {
+        form.replacementShowOrganId = form.replacementShowOrganId.join(",");
+      }
+      if (
+        !form.studentShowOrganId &&
+        !form.educationShowOrganId &&
+        !form.courseFeeShowOrganId &&
+        !form.freeFeeShowOrganId &&
+        !form.memberFeeShowOrganId &&
+        !form.replacementShowOrganId
+      ) {
+        this.$message.error("请至少选择一个可见分部");
+        return;
+      }
       if (this.form.goodsList.length <= 0) {
-        this.$message.error("请至少添加一个子商品");
+        this.$message.error("请至少添加一个商品");
         return;
       }
       this.$refs[formName].validate(valid => {
         if (valid) {
-          let form = Object.assign({}, this.form);
           let temps = [];
           form.goodsList.forEach(item => {
             if (item.skuStockId) {
               temps.push({
-                mallGoodsId: item.goodsId,
-                sku: item.skuStockId,
-                goodsStatus: item.publishStatus,
-                goodsPrice: item.goodsPrice
+                name: item.name,
+                sn: item.sn,
+                brand: item.brandId,
+                type: item.type,
+                goodsCategoryId: item.goodsCategoryId,
+                specification: item.specification,
+                marketPrice: item.marketPrice,
+                discountPrice: item.discountPrice,
+                groupPurchasePrice: item.groupPurchasePrice,
+                groupGoods: 0,
+                studentShowOrganId: form.studentShowOrganId,
+                educationShowOrganId: form.educationShowOrganId,
+                memberFeeShowOrganId: form.memberFeeShowOrganId,
+                courseFeeShowOrganId: form.courseFeeShowOrganId,
+                freeFeeShowOrganId: form.freeFeeShowOrganId,
+                replacementShowOrganId: form.replacementShowOrganId,
+                image: item.pic,
+                goodsSubList: [
+                  {
+                    mallGoodsId: item.goodsId,
+                    sku: item.skuStockId,
+                    goodsStatus: item.publishStatus,
+                    goodsPrice: item.goodsPrice
+                  }
+                ]
+                // brief: item.detailHtml,
+                // desc: ""
               });
             }
           });
-          form.goodsSubList = temps;
-          form.goodsCategoryId =
-            form.goodsCategoryId && form.goodsCategoryId.length > 0
-              ? form.goodsCategoryId[form.goodsCategoryId.length - 1]
-              : null;
-          if (form.studentShowOrganId) {
-            form.studentShowOrganId = form.studentShowOrganId.join(",");
-          }
-          if (form.educationShowOrganId) {
-            form.educationShowOrganId = form.educationShowOrganId.join(",");
-          }
 
-          if (form.courseFeeShowOrganId) {
-            form.courseFeeShowOrganId = form.courseFeeShowOrganId.join(",");
-          }
-          if (form.memberFeeShowOrganId) {
-            form.memberFeeShowOrganId = form.memberFeeShowOrganId.join(",");
-          }
-          if (form.freeFeeShowOrganId) {
-            form.freeFeeShowOrganId = form.freeFeeShowOrganId.join(",");
-          }
-          if (form.replacementShowOrganId) {
-            form.replacementShowOrganId = form.replacementShowOrganId.join(",");
-          }
-          if (
-            !form.studentShowOrganId &&
-            !form.educationShowOrganId &&
-            !form.courseFeeShowOrganId &&
-            !form.freeFeeShowOrganId &&
-            !form.replacementShowOrganId
-          ) {
-            this.$message.error("请至少选择一个可见分部");
-            return;
-          }
-          form.goodsList = null;
+          console.log(temps, "temps");
           if (this.addType == "create" || this.addType == "copy") {
             if (this.form.id) {
               // 判断有没有Id,如果有则删除
               delete this.form.id;
             }
-            form.status = "NO"; // 默认上架
-            goodsAdd(cleanDeep(form)).then(res => {
+            // form.status = "NO"; // 默认下架
+            temps.forEach(temp => {
+              temp.status = "NO";
+            });
+            goodsAddBatch(cleanDeep(temps)).then(res => {
               this.messageTips("保存", res);
             });
           } else if (this.addType == "update") {
-            goodsUpdate(cleanDeep(form)).then(res => {
+            const goods = temps[0];
+            goods.id = this.form.id;
+            goodsUpdate(cleanDeep(goods)).then(res => {
               this.messageTips("保存", res);
             });
           }
@@ -616,16 +715,34 @@ export default {
         const index = this.form.goodsList.findIndex(
           goods => goods.skuStockId == item.skuStockId
         );
+
         if (index == -1) {
+          // 商品型号
+          const spData = item.spData
+            ? JSON.parse(item.spData)
+            : [{ key: "默认" }];
+          let spText = "";
+          spData.forEach(sp => {
+            spText += sp.key + (sp.value ? ":" + sp.value : "");
+          });
+
           goodsList.push({
             name: item.name,
             goodsId: item.goodsId,
+            brandId: item.brandId,
+            brandName: item.brandName,
             skuStockId: item.skuStockId,
             skuCode: item.skuCode,
+            pic: item.pic,
+            specification: spText,
+            detailHtml: item.detailHtml,
             price: item.price,
             publishStatus: item.publishStatus,
-            productSn: item.productSn,
-            goodsPrice: null // 成本
+            sn: item.productSn,
+            marketPrice: null,
+            discountPrice: null,
+            groupPurchasePrice: null,
+            goodsPrice: null
           });
         }
       });

+ 2 - 3
src/views/businessManager/shopManager/model/subShopGoods.vue

@@ -142,12 +142,13 @@ import {
   api_queryGoodsCategoryList
 } from "@/api/businessManager";
 export default {
-  props: ["disabledIds", "categoryList", "goodsBrand"],
+  props: ["disabledIds", "goodsBrand"],
   components: {
     pagination
   },
   data() {
     return {
+      categoryList: [],
       pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -170,7 +171,6 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     this.__init();
-    console.log(this.employeeInfoId);
     this.getList();
   },
   methods: {
@@ -243,7 +243,6 @@ export default {
       this.$listeners.close();
     },
     onSubmit() {
-      console.log(this.selectList, "Select");
       this.$listeners.comfirm(this.selectList);
       this.onClose();
     },

+ 2 - 2
src/views/businessManager/shopManager/shopCategory.vue

@@ -210,7 +210,7 @@ export default {
           result.rows.forEach(row => {
             let subjectname = [],
               subjectIds = [];
-            row.subjects.forEach(item => {
+            (row.subjects || []).forEach(item => {
               subjectname.push(item.name);
               subjectIds.push(item.id);
             });
@@ -253,7 +253,7 @@ export default {
           let tempArray = [];
           result.rows.forEach((item, index) => {
             let subject = [];
-            item.subjects.forEach(s => {
+            (item.subjects || []).forEach(s => {
               subject.push({
                 value: s.id,
                 label: s.name

+ 16 - 5
src/views/businessManager/shopManager/shopList.vue

@@ -376,7 +376,13 @@
             label="商品缩略图"
           >
             <template slot-scope="scope">
-              <img class="shopImage" :src="scope.row.image" alt="" srcset="" />
+              <img
+                class="shopImage"
+                v-if="scope.row.image"
+                :src="scope.row.image"
+                alt=""
+                srcset=""
+              />
             </template>
           </el-table-column>
           <!-- <el-table-column align="center" label="所属分部">
@@ -479,7 +485,7 @@
       :title="addString[addType] + '组合商品'"
       v-if="routeShopStatus"
       :visible.sync="routeShopStatus"
-      width="1200px"
+      width="1000px"
     >
       <combinationProducts
         :activeRow="activeRow"
@@ -500,7 +506,7 @@
       v-if="singleShopStatus"
       :visible.sync="singleShopStatus"
       @close="onFormClose('ruleForm')"
-      width="1000px"
+      width="1200px"
     >
       <singleProducts
         :activeRow="activeRow"
@@ -809,9 +815,14 @@ export default {
       // 判断是否是修改组合商品
       if (type == "update" || type == "look" || type == "copy") {
         this.activeRow = row;
+        if (row.groupGoods) {
+          this.routeShopStatus = true;
+        } else {
+          this.singleShopStatus = true;
+        }
+        return;
       }
-      // this.singleShopStatus = true;
-      this.routeShopStatus = true;
+      this.singleShopStatus = true;
     },
 
     onDownload() {

+ 7 - 1
src/views/resetTeaming/modals/review-detail.vue

@@ -401,7 +401,7 @@
       <descriptions-item label="手机号:">{{
         address.phone
       }}</descriptions-item>
-      <descriptions-item label="详细地址:">
+      <descriptions-item label="详细地址:" :span="2">
         {{ address.provinceName }} {{ address.cityName }}
         {{ address.regionName }}
         {{ address.address }}
@@ -424,6 +424,12 @@
       style="width: 100%; margin-top: 10px"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
     >
+      <el-table-column
+        v-if="calender && calender.paymentType === 'GOODS_PURCHASE'"
+        prop="responsiblePersonName"
+        label="责任人"
+      >
+      </el-table-column>
       <el-table-column prop="refundAmount" label="回款金额"> </el-table-column>
       <el-table-column prop="refundDate" label="回款状态">
         <template slot-scope="scope">