lex 1 year ago
parent
commit
363ddf7216

+ 8 - 0
src/api/product.js

@@ -90,4 +90,12 @@ export function getProductSkuStockRecordCreate(params) {
     data:params
   })
 }
+/** 修改商品库存入库记录 */
+export function getProductSkuStockRecordUpdate(params) {
+  return request({
+    url:'/PmsProductSkuStockRecord/update',
+    method:'post',
+    data:params
+  })
+}
 

+ 22 - 6
src/views/oms/order/index.vue

@@ -29,7 +29,7 @@
         >
           重置
         </el-button>
-        
+
       </div>
       <div style="margin-top: 15px">
         <el-form
@@ -146,10 +146,14 @@
             scope.row.createTime | formatCreateTime
           }}</template>
         </el-table-column>
+        <el-table-column label="来源" align="center">
+          <template slot-scope="scope">{{ scope.row.orderFormType | formatOrderFormType }}</template>
+        </el-table-column>
         <el-table-column label="用户类型" align="center">
           <template slot-scope="scope">
-            <p v-if="scope.row.userType == 'STUDENT'">学生</p>
-            <p v-else-if="scope.row.userType == 'TEACHER'">老师</p>
+            <p v-if="scope.row.platformType == 'STUDENT'">学生</p>
+            <p v-else-if="scope.row.platformType == 'TEACHER'">老师</p>
+            <p v-else-if="scope.row.platformType == 'SCHOOL'">学校</p>
             <p v-else>--</p>
           </template>
         </el-table-column>
@@ -160,7 +164,7 @@
           <template slot-scope="scope">{{ scope.row.username }}</template>
         </el-table-column>
         <el-table-column label="手机号" align="center">
-          <template slot-scope="scope">{{ scope.row.phone }}</template>
+          <template slot-scope="scope">{{ scope.row.phone || '-' }}</template>
         </el-table-column>
         <el-table-column label="订单金额" width="120" align="center">
           <template slot-scope="scope">¥{{ scope.row.totalAmount }}</template>
@@ -404,11 +408,23 @@ export default {
         return "未支付";
       }
     },
+    formatOrderFormType(value) {
+      if(value === 'MEC') {
+        return '管乐迷'
+      }
+    },
     formatSourceType(value) {
-      if (value === 1) {
+      // 0->PC订单;1->app订单 2->学校采购 3 个人订单 4 其他订单")
+      if(value === 0) {
+        return "PC订单";
+      } else if (value === 1) {
         return "APP订单";
+      } else if (value === 2) {
+        return "学校采购";
+      } else if (value === 3) {
+        return "个人订单";
       } else {
-        return "PC订单";
+        return "其他订单";
       }
     },
     formatStatus(value) {

+ 12 - 5
src/views/oms/order/orderDetail.vue

@@ -97,9 +97,10 @@
           <el-col :span="4" class="table-cell">{{
             order.memberUsername
           }}</el-col>
-          <el-col :span="4" class="table-cell">{{
-            order.payType | formatPayType
-          }}</el-col>
+          <el-col :span="4" class="table-cell">
+            <span v-if="order.sourceType === 2">--</span>
+            <span  v-else>{{ order.payType | formatPayType }}</span>
+          </el-col>
           <el-col :span="4" class="table-cell">{{
             order.sourceType | formatSourceType
           }}</el-col>
@@ -568,10 +569,16 @@ export default {
       }
     },
     formatSourceType(value) {
-      if (value === 1) {
+      if(value === 0) {
+        return "PC订单";
+      } else if (value === 1) {
         return "APP订单";
+      } else if (value === 2) {
+        return "学校采购";
+      } else if (value === 3) {
+        return "个人订单";
       } else {
-        return "PC订单";
+        return "其他订单";
       }
     },
     formatOrderType(value) {

+ 1 - 1
src/views/pms/product/index.vue

@@ -322,7 +322,7 @@
         <el-table-column label="销售价格" align="center">
           <template slot-scope="scope">
             <!-- <el-input v-model="scope.row.price"></el-input> -->
-            <el-input-number :controls="false" class="number-input" v-model="scope.row.price" :min="0" :max="999999" :precision="2"
+            <el-input-number :controls="false" class="number-input" v-model="scope.row.price" :min="1" :max="999999" :precision="2"
             type="number"></el-input-number>
           </template>
         </el-table-column>

+ 21 - 3
src/views/pms/purchaseList/index.vue

@@ -88,7 +88,7 @@
         <el-table-column label="备查货号" width="120" align="center" >
           <template slot-scope="scope">{{ scope.row.selectProductSn }}</template>
         </el-table-column>
-        <el-table-column label="商品编号" align="center">
+        <el-table-column label="号" align="center">
           <template slot-scope="scope">
             <p>{{ scope.row.productSkuId }}</p>
           </template>
@@ -209,7 +209,8 @@ import {
 } from "@/api/skuStock";
 import {
   getProductSkuStockRecord,
-  getProductSkuStockRecordCreate
+  getProductSkuStockRecordCreate,
+  getProductSkuStockRecordUpdate
 } from "@/api/product";
 const defaultListQuery = {
   keyword: null,
@@ -278,7 +279,8 @@ export default {
               productId: this.productId,
             }
             this.loading = true
-            getProductSkuStockRecordCreate(obj).then(response=>{
+            if(this.type == 'create') {
+              getProductSkuStockRecordCreate(obj).then(response=>{
                 this.$message({
                   message: this.type == 'create' ? '添加成功' : '修改成功',
                   type: 'success',
@@ -290,6 +292,21 @@ export default {
               }).catch(() => {
                 this.loading = false
               });
+            } else {
+            getProductSkuStockRecordUpdate(obj).then(response=>{
+                this.$message({
+                  message: this.type == 'create' ? '添加成功' : '修改成功',
+                  type: 'success',
+                  duration:1000
+                });
+                this.dialogVisible = false;
+                this.handleClose()
+                this.getList();
+              }).catch(() => {
+                this.loading = false
+              });
+            }
+
           } else {
             console.log('error submit!!');
             return false;
@@ -310,6 +327,7 @@ export default {
       this.type = 'update'
       this.loading = false
       this.editSkuInfo = {
+        id: row.id,
         productId: row.productId,
         productSkuId: row.productSkuId,
         selectProductSn: row.selectProductSn,