Sfoglia il codice sorgente

商品管理修改

王新雷 4 anni fa
parent
commit
7ceaea73c6

+ 23 - 12
src/components/Editor/index.vue

@@ -1,7 +1,7 @@
 
 <template>
   <div class="editor">
-    <div id="demo1"></div>
+    <div id="editorContent"></div>
     <!-- <button type="button" class="btn" @click="getEditorData">获取当前内容</button> -->
     <!-- <h3>内容预览</h3> -->
     <!-- <textarea name="" id="" cols="170" rows="20" readonly v-model="editorData"></textarea> -->
@@ -24,8 +24,13 @@ export default {
       editorData: ''
     }
   },
+  props: {
+    value: { // 组件状态
+    	type: String
+    },
+  },
   mounted() {
-    const editor = new wangEditor(`#demo1`)
+    const editor = new wangEditor(`#editorContent`)
     // 默认情况下,显示所有菜单
     editor.config.menus = [
         'head',
@@ -54,11 +59,13 @@ export default {
     ]
     // 最大上传图片数
     editor.config.uploadImgMaxLength = 1
+    editor.config.zIndex = 500
     // 限制图片大小
     // editor.config.uploadImgMaxSize = 2 * 1024 * 1024
     // 配置 onchange 回调函数,将数据同步到 vue 中
     editor.config.onchange = (newHtml) => {
        this.editorData = newHtml
+       this.$emit('input', newHtml)
     }
     // console.log(editor.txt.eventHooks)
     // editor.txt.eventHooks.clickEvents.push(() => {
@@ -71,7 +78,7 @@ export default {
     editor.config.customUploadImg = async (resultFiles, insertImgFn) => {
         // resultFiles 是 input 中选中的文件列表
         // insertImgFn 是获取图片 url 后,插入到编辑器的方法
-
+        console.log(insertImgFn)
         const file = resultFiles[0]
         const imageType = {
           "image/png": true,
@@ -86,7 +93,7 @@ export default {
           this.$message.error("上传图片大小不能超过 2M!");
         }
         if(isImage && isLt2M) {
-          // load.startLoading()
+          load.startLoading()
           let form = new FormData()
           form.append('file', file)
           await axios({
@@ -97,16 +104,14 @@ export default {
             data: form,
             url: '/api-web/uploadFile',
           }).then(res => {
-            console.log(res)
-            // load.endLoading()
-          }).catch(err => {
-            console.log(err)
-            // load.endLoading()
+            const result = res.data
+            if(result.code == 200) {
+              // 上传图片,返回结果,将图片插入到编辑器中
+              insertImgFn(result.data.url)
+            }
           })
+          load.endLoading()
         }
-        // return isImage && isLt2M;
-        // 上传图片,返回结果,将图片插入到编辑器中
-        // insertImgFn(imgUrl)
     }
 
     // 创建编辑器
@@ -121,6 +126,12 @@ export default {
       // alert(data)
     }
   },
+  watch: {
+    value(newValue) {
+      console.log(newValue)
+      this.editor.txt.html(newValue)
+    }
+  },
   beforeDestroy() {
     // 调用销毁 API 对当前编辑器实例进行销毁
     this.editor.destroy()

+ 8 - 1
src/utils/searchArray.js

@@ -149,7 +149,13 @@ const saleStatus = [
   { value: 'ACCESSORIES', label: '配件销售' },
   { value: 'SCHOOL_BUY', label: '学校采购' },
   { value: 'OTHER', label: '其它' }
-
+]
+// 商品类型
+const goodsType = [
+  { value: 'INSTRUMENT', label: '乐器' },
+  { value: 'ACCESSORIES', label: '辅件' },
+  { value: 'TEACHING', label: '教材' },
+  { value: 'STAFF', label: '教谱' },
 ]
 
 const classStatus = [
@@ -186,5 +192,6 @@ export {
   visitChiose,
   paymentChannelStatus,
   saleStatus,
+  goodsType,
   classStatus
 }

+ 282 - 253
src/views/businessManager/shopManager/shopList.vue

@@ -4,154 +4,117 @@
       <div class="squrt"></div>商品列表
     </h2>
     <div class="m-core">
-      <el-button class="btn-primary"
-                 @click="onShopOperation('create')"
-                 v-permission="'/shopOperation'">添加</el-button>
-      <el-upload v-permission="'import/goods'"
-                 style="display: inline-block;"
-                 action="/api-web/import/goods"
-                 :show-file-list="false"
-                 :before-upload="beforeUpload"
-                 accept=".xlsx,.xls"
-                 :headers="headers"
-                 :on-error="handleError"
-                 :on-success="handleSuccess">
+      <el-button class="btn-primary" @click="onShopOperation('create')" v-permission="'/shopOperation'">添加</el-button>
+      <el-upload v-permission="'import/goods'" style="display: inline-block;" action="/api-web/import/goods"
+        :show-file-list="false" :before-upload="beforeUpload" accept=".xlsx,.xls" :headers="headers" :on-error="handleError"
+        :on-success="handleSuccess">
         <el-button class="btn-primary">商品导入</el-button>
       </el-upload>
-      <el-button class="btn-primary"
-                 @click="onDownload"
-                 v-permission="'import/downloadTemplate'">下载模板</el-button>
+      <el-button class="btn-primary" @click="onDownload" v-permission="'import/downloadTemplate'">下载模板</el-button>
+      <el-button class="btn-primary">添加组合商品</el-button>
       <!-- 搜索类型 -->
-      <!-- <el-form :inline="true"
-               class="searchForm"
-               v-model.trim="searchForm">
+      <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
         <el-form-item>
-          <el-select v-model.trim="searchForm.status"
-                     placeholder="工作类型">
-            <el-option label="哈哈哈"
-                       value="1"></el-option>
+          <el-input v-model.trim="searchForm.search" placeholder="货号,商品名称,别称,备查货号"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-select v-model.trim="searchForm.type" placeholder="商品类型">
+            <el-option v-for="(item, index) in goodsType" :key="index" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select v-model.trim="searchForm.goodsCategoryId" placeholder="商品分类">
+            <el-option v-for="(item, index) in categoryList" :key="index" :label="item.label" :value="item.value"></el-option>
           </el-select>
         </el-form-item>
-      </el-form> -->
-      <!-- 查询列表 -->
-      <!-- <div class="searchWrap">
-        <p>查询条件:</p>
-        <div class="searchItem"
-             @click="closeSearch(item)"
-             v-for="(item,index) in searchLsit">
-          {{ item.key }}
-          <i class="el-icon-close"></i>
-        </div>
-      </div> -->
+        <el-form-item>
+          <el-select v-model.trim="searchForm.status" placeholder="是否是组合商品">
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker v-model.trim="orderDate" style="width:410px;" type="daterange" value-format="yyyy-MM-dd"
+            @change="searchOrderDate" range-separator="至" :picker-options="{ firstDayOfWeek: 1 }"
+            start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="danger" @click="getList">搜索</el-button>
+          <el-button type="primary" @click="onReset">重置</el-button>
+        </el-form-item>
+      </el-form>
       <!-- 列表 -->
       <div class="tableWrap">
-        <el-table :data='tableList'
-                  :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-          <el-table-column align='center'
-                           prop="id"
-                           label="商品编号">
+        <el-table :data='tableList' :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+          <el-table-column align='center' prop="id" label="商品编号">
           </el-table-column>
-          <el-table-column align='center'
-                           prop="sn"
-                           label="货号">
+          <el-table-column align='center' prop="sn" label="货号">
           </el-table-column>
-          <el-table-column align='center'
-                           prop="brand"
-                           label="品牌">
+          <el-table-column align='center' prop="brand" label="品牌">
           </el-table-column>
-          <el-table-column align='center'
-                           prop="name"
-                           label="商品名称">
+          <el-table-column align='center' prop="name" label="商品名称">
+          </el-table-column>
+          <el-table-column align='center' label="是否组合商品">
+            <template slot-scope="scope">
+              {{ scope.row.complementGoodsIdList ? '是' : '否' }}
+            </template>
+          </el-table-column>
+          <el-table-column align='center' label="是否APP展示">
+            <template slot-scope="scope">
+              {{ scope.row.clientShow ? '是' : '否' }}
+            </template>
           </el-table-column>
-          <el-table-column align='center'
-                           label="商品类型">
+          <el-table-column align='center' label="商品类型">
             <template slot-scope="scope">
               {{ scope.row.type | shopType }}
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="goodsCategoryName"
-                           label="商品分类">
+          <el-table-column align='center' prop="goodsCategoryName" label="商品分类">
           </el-table-column>
-          <el-table-column align='center'
-                           prop="specification"
-                           label="具体型号">
+          <el-table-column align='center' prop="specification" label="具体型号">
             <template slot-scope="scope">
               <span style="max-height: 64px; display: block;">{{ scope.row.specification }}</span>
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="marketPrice"
-                           label="商品价格(元)">
+          <el-table-column align='center' prop="stockCount" label="内部库存">
+          </el-table-column>
+          <el-table-column align='center' prop="taxStockCount" label="税务库存">
+          </el-table-column>
+          <el-table-column align='center' prop="stockType" label="库存类型">
+          </el-table-column>
+          <el-table-column align='center' prop="marketPrice" label="商品价格(元)">
             <template slot-scope="scope">
-              <div>
                 {{scope.row.marketPrice|moneyFormat}}
-              </div>
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="groupPurchasePrice"
-                           label="商品团购价(元)">
+          <el-table-column align='center' prop="groupPurchasePrice" label="商品团购价(元)">
             <template slot-scope="scope">
-              <div>
                 {{scope.row.groupPurchasePrice|moneyFormat}}
-              </div>
             </template>
           </el-table-column>
-          <!-- <el-table-column align='center'
-                           prop="discountPrice"
-                           label="商品采购价1(元)">
+          <el-table-column align='center' cell-style="padding: 0" label="商品缩略图">
             <template slot-scope="scope">
-              <div>
-                {{scope.row.discountPrice|moneyFormat}}
-              </div>
+              <img class="shopImage" :src="scope.row.image" alt="" srcset="">
             </template>
           </el-table-column>
-          </el-table-column>
-          <el-table-column align='center'
-                           prop="agreeCostPrice"
-                           label="商品采购价2(元)">
+          <el-table-column align='center' label="商品描述">
             <template slot-scope="scope">
-              <div>
-                {{scope.row.agreeCostPrice|moneyFormat}}
-              </div>
-            </template>
-          </el-table-column> -->
-          <el-table-column align='center'
-                           cell-style="padding: 0"
-                           label="商品缩略图片">
-            <template slot-scope="scope">
-              <img class="shopImage"
-                   :src="scope.row.image"
-                   alt=""
-                   srcset="">
+              <Tooltip :content="scope.row.brief" />
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           label="商品描述">
+          <el-table-column align='center' label="商品详情">
             <template slot-scope="scope">
-              <!-- <div class="shopDesc">
-                {{ scope.row.desc }}
-              </div> -->
-              <Tooltip :content="scope.row.brief" />
+              <Tooltip :content="scope.row.desc" />
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           width="140px"
-                           label="操作">
+          <el-table-column align='center' width="180px" label="操作" fixed="right">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.status == 0"
-                         v-permission="'goods/update'"
-                         @click="onUpdate(scope.row)"
-                         type="text">上架</el-button>
-              <el-button v-if="scope.row.status == 0"
-                         v-permission="'/shopOperation'"
-                         @click="onShopOperation('update', scope.row)"
-                         type="text">修改</el-button>
-              <el-button v-if="scope.row.status == 1"
-                         v-permission="'goods/update'"
-                         @click="onUpdate(scope.row)"
-                         type="text">下架</el-button>
+              <!-- 组合商品没有进货清单按钮 -->
+              <el-button v-if="!scope.row.complementGoodsIdList" type="text">进货清单</el-button>
+              <el-button v-if="scope.row.status == 0" v-permission="'goods/update'" @click="onUpdate(scope.row)" type="text">上架</el-button>
+              <el-button v-if="scope.row.status == 0" v-permission="'/shopOperation'" @click="onShopOperation('update', scope.row)"
+                type="text">修改</el-button>
+              <el-button v-if="scope.row.status == 1" v-permission="'goods/update'" @click="onUpdate(scope.row)" type="text">下架</el-button>
               <!-- <el-button v-if="scope.row.status == 0"
                          v-permission="'goods/del'"
                          @click="onDelete(scope.row)"
@@ -159,165 +122,231 @@
             </template>
           </el-table-column>
         </el-table>
-        <pagination :total="pageInfo.total"
-                    :page.sync="pageInfo.page"
-                    :limit.sync="pageInfo.limit"
-                    :page-sizes="pageInfo.page_size"
-                    @pagination="getList" />
+        <pagination :total="pageInfo.total" :page.sync="pageInfo.page" :limit.sync="pageInfo.limit" :page-sizes="pageInfo.page_size"
+          @pagination="getList" />
       </div>
     </div>
   </div>
 </template>
 <script>
-import pagination from '@/components/Pagination/index'
-import { goodsQuery, goodsUpdate, goodsDelete } from '@/api/businessManager'
-import store from '@/store'
-import Tooltip from '@/components/Tooltip/index'
-import { Export } from '@/utils/downLoadFile'
-import { getToken } from "@/utils/auth";
-import load from '@/utils/loading'
-export default {
-  components: { pagination, Tooltip },
-  name: 'shopList',
-  data () {
-    return {
-      goodsLoading: false,
-      organId: null,
-      searchForm: {
-        status: ''
-      },
-      headers: {
-        Authorization: getToken()
-      },
-      searchLsit: [],
-      tableList: [],
-      pageInfo: {
-        // 分页规则
-        limit: 10, // 限制显示条数
-        page: 1, // 当前页
-        total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
-      },
-    }
-  },
-  created () {
-    this.init()
-  },
-  activated () {
-    this.init()
-  },
-  mounted () {
-
-  },
-  methods: {
-    init () {
-      if (this.$route.query.searchForm) {
-        this.$route.query.searchForm instanceof Object ? this.searchForm = this.$route.query.searchForm : this.searchForm = JSON.parse(this.$route.query.searchForm);
-      }
-      if (this.$route.query.pageInfo) {
-        this.$route.query.pageInfo instanceof Object ? this.pageInfo = this.$route.query.pageInfo : this.pageInfo = JSON.parse(this.$route.query.pageInfo);
-      }
-      this.getList()
-    },
-    onUpdate (row) {
-      goodsUpdate({
-        id: row.id,
-        status: row.status ? 0 : 1
-      }).then(res => {
-        this.messageTips(row.status ? '下架' : '上架', res)
-      })
-    },
-    onDelete (row) {
-      this.$confirm('您确定删除该商品吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        goodsDelete(row.id).then(res => {
-          this.messageTips('删除', res)
-        })
-      }).catch(() => { })
-
+  import pagination from '@/components/Pagination/index'
+  import {
+    categoryListTree,
+    goodsQuery,
+    goodsUpdate,
+    goodsDelete
+  } from '@/api/businessManager'
+  import store from '@/store'
+  import Tooltip from '@/components/Tooltip/index'
+  import {
+    Export
+  } from '@/utils/downLoadFile'
+  import {
+    getToken
+  } from "@/utils/auth";
+  import {
+    goodsType
+  } from '@/utils/searchArray'
+  import load from '@/utils/loading'
+  export default {
+    components: {
+      pagination,
+      Tooltip
     },
-    messageTips (title, res) {
-      if (res.code == 200) {
-        this.$message.success(title + '成功')
-        this.typeStatus = false
-        this.getList()
-      } else {
-        this.$message.error(res.msg)
+    name: 'shopList',
+    data() {
+      return {
+        goodsType: goodsType,
+        categoryList: [],
+        goodsLoading: false,
+        organId: null,
+        orderDate: null,
+        searchForm: {
+          search: null,
+          status: null,
+          type: null,
+          goodsCategoryId: null,
+          startTime: null,
+          endTime: null
+        },
+        headers: {
+          Authorization: getToken()
+        },
+        searchLsit: [],
+        tableList: [],
+        pageInfo: {
+          // 分页规则
+          limit: 10, // 限制显示条数
+          page: 1, // 当前页
+          total: 0, // 总条数
+          page_size: [10, 20, 40, 50] // 选择限制显示条数
+        },
       }
     },
-    getList () {
-      goodsQuery({
-        organId: this.organId,
-        rows: this.pageInfo.limit,
-        page: this.pageInfo.page
-      }).then(res => {
-        if (res.code == 200 && res.data) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
-        }
-      })
+    created() {
+      this.init()
     },
-    onShopOperation (type, row) { // 添加或修改
-      let params = {
-        type: type
-      }
-      if (row) {
-        params.id = row.id
-      }
-      let pageInfo = JSON.stringify(this.pageInfo)
-      let paramInfo = JSON.stringify(params)
-      this.$router.push({
-        path: '/shopManager/shopOperation',
-        query: { paramInfo, pageInfo }
-      })
+    activated() {
+      this.init()
     },
-    beforeUpload (file) {
-      // console.log(file.type)
-      // const isJPG = file.type === '.xlsx' || file.type === '.xls';
-      // // const isLt2M = file.size / 1024 / 1024 < 2;
-      // if (!isJPG) {
-      //   this.$message.error('上传头像图片只能是 JPG 格式!');
-      // }
-      // return isJPG;
-      // this.goodsLoading = true
-      load.startLoading()
+    mounted() {
+
     },
-    handleSuccess (response, file, fileList) { // 导入商品
-      // 报表导出
-      load.endLoading()
-      console.log(response, file, fileList)
-      if (response.code == 200) {
-        this.$message.success('导入成功')
+    methods: {
+      init() {
+        if (this.$route.query.searchForm) {
+          this.$route.query.searchForm instanceof Object ? this.searchForm = this.$route.query.searchForm : this.searchForm =
+            JSON.parse(this.$route.query.searchForm);
+        }
+        if (this.$route.query.pageInfo) {
+          this.$route.query.pageInfo instanceof Object ? this.pageInfo = this.$route.query.pageInfo : this.pageInfo =
+            JSON.parse(this.$route.query.pageInfo);
+        }
         this.getList()
-      } else {
-        this.$message.error(response.msg)
+        this.getCatagory()
+      },
+      getCatagory() {
+        categoryListTree({
+          delFlag: 0,
+          rows: 9999
+        }).then(res => {
+          let result = res.data
+          if (res.code == 200) {
+            let tempArray = []
+            result.rows.forEach(row => {
+              tempArray.push({
+                label: row.name,
+                value: row.id
+              })
+            })
+            this.categoryList = tempArray
+          }
+        })
+      },
+      onUpdate(row) {
+        goodsUpdate({
+          id: row.id,
+          status: row.status ? 0 : 1
+        }).then(res => {
+          this.messageTips(row.status ? '下架' : '上架', res)
+        })
+      },
+      onDelete(row) {
+        this.$confirm('您确定删除该商品吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          goodsDelete(row.id).then(res => {
+            this.messageTips('删除', res)
+          })
+        }).catch(() => {})
+
+      },
+      searchOrderDate (value) {
+        if (value) {
+          this.searchForm.startTime = value[0];
+          this.searchForm.endTime = value[1];
+        } else {
+          this.searchForm.startTime = null;
+          this.searchForm.endTime = null;
+        }
+      },
+      messageTips(title, res) {
+        if (res.code == 200) {
+          this.$message.success(title + '成功')
+          this.typeStatus = false
+          this.getList()
+        } else {
+          this.$message.error(res.msg)
+        }
+      },
+      getList() {
+        let params = Object.assign({}, this.searchForm)
+        params.organId = this.organId
+        params.rows = this.pageInfo.limit
+        params.page = this.pageInfo.page
+        goodsQuery(params).then(res => {
+          if (res.code == 200 && res.data) {
+            this.tableList = res.data.rows
+            this.pageInfo.total = res.data.total
+          }
+        })
+      },
+      onReset() { // 重置
+         this.searchForm = {
+           search: null,
+           status: null,
+           type: null,
+           goodsCategoryId: null,
+           startTime: null,
+           endTime: null
+         }
+         this.getList()
+      },
+      onShopOperation(type, row) { // 添加或修改
+        let params = {
+          type: type
+        }
+        if (row) {
+          params.id = row.id
+        }
+        let pageInfo = JSON.stringify(this.pageInfo)
+        let paramInfo = JSON.stringify(params)
+        this.$router.push({
+          path: '/shopManager/shopOperation',
+          query: {
+            paramInfo,
+            pageInfo
+          }
+        })
+      },
+      beforeUpload(file) {
+        // console.log(file.type)
+        // const isJPG = file.type === '.xlsx' || file.type === '.xls';
+        // // const isLt2M = file.size / 1024 / 1024 < 2;
+        // if (!isJPG) {
+        //   this.$message.error('上传头像图片只能是 JPG 格式!');
+        // }
+        // return isJPG;
+        // this.goodsLoading = true
+        load.startLoading()
+      },
+      handleSuccess(response, file, fileList) { // 导入商品
+        // 报表导出
+        load.endLoading()
+        if (response.code == 200) {
+          this.$message.success('导入成功')
+          this.getList()
+        } else {
+          this.$message.error(response.msg)
+        }
+      },
+      handleError(err, file, fileList) {
+        load.endLoading()
+        console.log(err, file, fileList)
+      },
+      onDownload() { // 下载模板
+        // // 报表导出
+        Export(this, {
+          url: "/api-web/import/downloadTemplate",
+          params: {
+            templateType: 'GOODS'
+          },
+          fileName: '商品导入模板.xlsx'
+        })
       }
-    },
-    handleError (err, file, fileList) {
-      load.endLoading()
-      console.log(err, file, fileList)
-    },
-    onDownload () { // 下载模板
-      // // 报表导出
-      Export(this, {
-        url: "/api-web/import/downloadTemplate",
-        params: { templateType: 'GOODS' },
-        fileName: '商品导入模板.xlsx'
-      })
     }
   }
-}
 </script>
 <style lang="scss">
-.shopImage {
-  width: 60px;
-  height: 60px;
-}
-.shopDesc {
-  max-height: 70px;
-  overflow: hidden;
-}
+  .shopImage {
+    width: 60px;
+    height: 60px;
+  }
+
+  .shopDesc {
+    max-height: 70px;
+    overflow: hidden;
+  }
 </style>

+ 50 - 76
src/views/businessManager/shopManager/shopOperation.vue

@@ -6,45 +6,58 @@
 
     <div class="m-core">
       <el-form :model="form" :rules="rules" ref="form" label-width="120px">
-        <el-form-item label="商品货号" prop="sn">
-          <el-input v-model.trim="form.sn" style="width: 400px"></el-input>
+        <el-form-item label="货号" prop="sn">
+          <el-input v-model.trim="form.sn" placeholder="请输入货号" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item label="品牌" prop="brand">
-          <el-input v-model.trim="form.brand" style="width: 400px"></el-input>
+          <el-input v-model.trim="form.brand" placeholder="请输入品牌" style="width: 400px"></el-input>
+        </el-form-item>
+        <el-form-item label="备查货号" prop="supplyChannel">
+          <el-input v-model.trim="form.supplyChannel" placeholder="请输入备查货号" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item label="商品名称" prop="name">
-          <el-input v-model.trim="form.name" style="width: 400px"></el-input>
+          <el-input v-model.trim="form.name" placeholder="请输入商品名称" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item label="商品类型" prop="type">
-          <el-select v-model.trim="form.type" style="width: 400px !important;">
-            <el-option label="乐器" value="INSTRUMENT"></el-option>
-            <el-option label="辅件" value="ACCESSORIES"></el-option>
-            <el-option label="教材" value="TEACHING"></el-option>
-            <el-option label="教谱" value="STAFF"></el-option>
-            <!-- <el-option label="其它"
-                       value="OTHER"></el-option> -->
+          <el-select v-model.trim="form.type" placeholder="请选择商品类型" style="width: 400px !important;">
+            <el-option v-for="(item, index) in goodsType"
+                       :key="index"
+                       :label="item.label"
+                       :value="item.value"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="商品分类" prop="goodsCategoryId">
-          <el-select v-model.trim="form.goodsCategoryId" style="width: 400px !important;" filterable>
+          <el-select v-model.trim="form.goodsCategoryId" placeholder="请选择商品分类" style="width: 400px !important;" filterable>
             <el-option v-for="item in categoryList" :key="item.value" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="商品型号" prop="specification">
-          <el-input v-model.trim="form.specification" style="width: 400px"></el-input>
+          <el-input v-model.trim="form.specification" placeholder="请输入商品型号" style="width: 400px"></el-input>
+        </el-form-item>
+        <el-form-item label="内部库存" prop="stockCount">
+          <el-input type="number" v-model.trim="form.stockCount" placeholder="请输入内部库存" style="width: 400px"></el-input>
+        </el-form-item>
+        <el-form-item label="税务库存" prop="taxStockCount">
+          <el-input type="number" v-model.trim="form.taxStockCount" placeholder="请输入税务库存" style="width: 400px"></el-input>
+        </el-form-item>
+        <el-form-item label="库存类型" prop="stockType">
+          <el-select v-model="form.stockType" placeholder="请选择库存类型" style="width: 400px !important;" multiple>
+            <el-option label="内部" value="INTERNAL"></el-option>
+            <el-option label="外部" value="EXTERNAL"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="商品价格" prop="marketPrice">
-          <el-input type="number" @mousewheel.native.prevent v-model.trim="form.marketPrice" style="width: 400px"></el-input>
+          <el-input type="number" placeholder="请输入商品价格" @mousewheel.native.prevent v-model.trim="form.marketPrice" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item label="商品团购价" prop="groupPurchasePrice">
-          <el-input type="number" @mousewheel.native.prevent v-model.trim="form.groupPurchasePrice" style="width: 400px"></el-input>
-        </el-form-item>
-        <el-form-item label="商品采购价1" prop="discountPrice">
-          <el-input type="number" @mousewheel.native.prevent v-model.trim="form.discountPrice" style="width: 400px"></el-input>
+          <el-input type="number" placeholder="请输入商品团购价" @mousewheel.native.prevent v-model.trim="form.groupPurchasePrice" style="width: 400px"></el-input>
         </el-form-item>
-        <el-form-item label="商品采购价2" prop="agreeCostPrice">
-          <el-input type="number" @mousewheel.native.prevent v-model.trim.number="form.agreeCostPrice" style="width: 400px"></el-input>
+        <el-form-item label="是否APP展示" prop="clientShow">
+          <el-select v-model="form.clientShow" placeholder="请选择库存类型" style="width: 400px !important;">
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="商品图片" prop="image">
           <el-upload class="avatar-uploader" action="/api-web/uploadFile" accept=".jpg, .jpeg, .png" :headers="headers"
@@ -56,8 +69,8 @@
         <el-form-item label="商品描述" prop="brief">
           <el-input type="textarea" v-model.trim="form.brief" style="width: 400px"></el-input>
         </el-form-item>
-        <el-form-item label="商品描述" prop="desc">
-          <editor />
+        <el-form-item label="商品详情" prop="desc">
+		  <el-input type="textarea" v-model.trim="form.desc" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item>
           <el-button @click="onSubmit('form')" type="primary">立即{{ pageType == "create" ? '创建' : '修改' }}</el-button>
@@ -77,7 +90,7 @@
   import {
     getToken
   } from '@/utils/auth'
-  import editor from '@/components/Editor'
+  import { goodsType } from '@/utils/searchArray'
   let validPrice = (rule, value, callback) => {
     if (value == '' && typeof value == 'string' || value == null) {
       callback(new Error('请输入金额'))
@@ -89,40 +102,20 @@
       callback()
     }
   }
-  let validPrice2 = (rule, value, callback) => {
-    console.log(value)
-    if (typeof value == 'string' || value == null) {
-      callback(new Error('请输入金额'))
-    } else if (value < 0) {
-      callback(new Error('输入金额必须大于或等于0'))
-    } else if (value >= 100000) {
-      callback(new Error('输入金额必须小于100000'))
-    } else {
-      callback()
-    }
-  }
   export default {
     name: 'shopOperation',
     data() {
       return {
+        goodsType: goodsType,
         categoryList: [],
         pageType: null,
         headers: {
           Authorization: getToken()
         },
         form: {
-          // brand: 'xxxl',
-          // name: '长号',
-          // type: 'INSTRUMENT',
-          // goodsCategoryId: 7,
-          // specification: 'xxxeed',
-          // marketPrice: 10000,
-          // groupPurchasePrice: 9000,
-          // discountPrice: 8000,
-          // image: null,
-          // desc: 'C调、法式键、曲列、E键、白铜按键、台湾镍白'
           sn: null,
           brand: null,
+          supplyChannel: null,
           name: null,
           type: null,
           goodsCategoryId: null,
@@ -130,16 +123,12 @@
           marketPrice: null,
           groupPurchasePrice: null,
           discountPrice: null,
-          agreeCostPrice: null,
           image: null,
-          brief: null
+          brief: null,
+          desc: null
         },
         rules: {
-          sn: [{
-            required: true,
-            message: '请输入商品货号',
-            trigger: 'blur'
-          }],
+          sn: [{ required: true, message: '请输入商品货号', trigger: 'blur' }],
           brand: [{
               required: true,
               message: '请输入品牌',
@@ -201,13 +190,6 @@
             validator: validPrice,
             trigger: 'blur'
           }],
-          agreeCostPrice: [{
-            validator: validPrice2,
-            trigger: 'blur'
-          }],
-          // marketPrice: [{ required: true, message: '请输入商品价格', trigger: 'blur' }],
-          // groupPurchasePrice: [{ required: true, message: '请输入商品团购价', trigger: 'blur' }],
-          // discountPrice: [{ required: true, message: '请输入商品采购价', trigger: 'blur' }],
           image: [{
             required: true,
             message: '请选择图片',
@@ -217,15 +199,17 @@
             required: true,
             message: '请输入商品描述',
             trigger: 'blur'
+          }],
+          desc: [{
+            required: true,
+            message: '请输入商品详情',
+            trigger: 'blur'
           }]
         },
         Fsearch: null,
         Frules: null
       }
     },
-    components: {
-      editor
-    },
     created() {
       this.init()
     },
@@ -302,16 +286,6 @@
       getList() {
         if (this.pageType == 'create') {
           this.form = {
-            // brand: 'xxxl',
-            // name: '长号',
-            // type: 'INSTRUMENT',
-            // goodsCategoryId: 7,
-            // specification: 'xxxeed',
-            // marketPrice: 10000,
-            // groupPurchasePrice: 9000,
-            // discountPrice: 8000,
-            // image: null,
-            // brief: 'C调、法式键、曲列、E键、白铜按键、台湾镍白'
             sn: null,
             brand: null,
             name: null,
@@ -322,9 +296,9 @@
             groupPurchasePrice: null,
             discountPrice: null,
             image: null,
-            brief: null
+            brief: null,
+            desc: null,
           }
-          // console.log(this.$refs['form'])
           if (this.$refs['form']) {
             this.$refs['form'].resetFields();
           }
@@ -344,9 +318,9 @@
                 marketPrice: result.marketPrice,
                 groupPurchasePrice: result.groupPurchasePrice,
                 discountPrice: result.discountPrice,
-                agreeCostPrice: result.agreeCostPrice,
                 image: result.image,
-                brief: result.brief
+                brief: result.brief,
+                desc: result.desc
               }
             }
           })

+ 2 - 2
vue.config.js

@@ -21,8 +21,8 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.139:8000' // 箭河
 // let target = 'http://192.168.3.28:8000' //邹璇
 // let target = 'http://192.168.3.8:8000' //勇哥
-let target = 'http://dev.dayaedu.com' // 测试服
-// let target = 'http://192.168.3.196:8080' // 乔
+// let target = 'http://dev.dayaedu.com' // 测试服
+let target = 'http://192.168.3.196:8080' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**

+ 0 - 0
{