소스 검색

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 년 전
부모
커밋
1c10f98523

+ 8 - 1
src/api/mallManagement/commodity/productList.js

@@ -166,5 +166,12 @@ export const priceDelete = (id) => {
         }
     })
 }
+//下架触发
 
-
+export const underCommodity = (data) => {
+    return request({
+        url: '/api/store-goods/goodsdesc/batchOperationGoods',
+        method: 'post',
+        params: data
+    })
+}

+ 27 - 8
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -275,6 +275,7 @@ import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
 import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
+import { contrastObj, contrastList } from "@/util/contrastData";
 
 export default {
   name: "detailsPage",
@@ -526,6 +527,12 @@ export default {
       warehouseName: [],
       maxFeeNum: 0,
       maxGoodsNum: 0,
+      oldForm: {
+        orderStatus: "录入"
+      },
+      oldGoodsList: [],
+      oldFeesList: [],
+      oldUploadList: [],
     }
   },
   //初始化查询
@@ -670,6 +677,10 @@ export default {
             return b > a? b: a;
           })
         }
+        this.oldForm = Object.assign({}, this.form)
+        this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
+        this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
+        this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
         if (isCopy) {
           delete this.form.sysNo
           delete this.form.id
@@ -1067,15 +1078,23 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$confirm("是否保存当前页面?", "提示", {
-        confirmButtonText: "保存",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.editCustomer(true)
-      }).catch(() => {
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(true)
+        }).catch(() => {
+          this.$emit("goBack");
+        })
+      } else {
         this.$emit("goBack");
-      })
+      }
     },
     // 确认发货
     sendOutGoods() {

+ 27 - 8
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -411,6 +411,7 @@ import commodity from "./configuration/commodity.json"
 import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
 import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
+import { contrastObj, contrastList } from "@/util/contrastData";
 
 export default {
   name: "detailsPage",
@@ -625,6 +626,12 @@ export default {
       maxFeeNum: 0,
       maxGoodsNum: 0,
       selection: [],
+      oldForm: {
+        orderStatus: "录入"
+      },
+      oldGoodsList: [],
+      oldFeesList: [],
+      oldUploadList: [],
     }
   },
   //初始化查询
@@ -708,6 +715,10 @@ export default {
             return b > a? b: a;
           })
         }
+        this.oldForm = Object.assign({}, this.form)
+        this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
+        this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
+        this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
         if (isCopy) {
           delete this.form.sysNo;
           delete this.form.id
@@ -1150,15 +1161,23 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$confirm("是否保存当前页面?", "提示", {
-        confirmButtonText: "保存",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.editCustomer(true)
-      }).catch(() => {
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(true)
+        }).catch(() => {
+          this.$emit("goBack");
+        })
+      } else {
         this.$emit("goBack");
-      })
+      }
     },
     // 保存列设置
     async saveColumn(name) {

+ 27 - 8
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -276,6 +276,7 @@ import {getDeptLazyTree, customerList,getDeptLazyTreeTwo} from "@/api/basicData/
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
 import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
+import { contrastObj, contrastList } from "@/util/contrastData";
 
 export default {
   name: "detailsPage",
@@ -529,6 +530,12 @@ export default {
       // 费用信息排序的最大值
       maxFeeNum: 0,
       maxGoodsNum: 0,
+      oldForm: {
+        orderStatus: "录入"
+      },
+      oldGoodsList: [],
+      oldFeesList: [],
+      oldUploadList: [],
     }
   },
   //初始化查询
@@ -667,6 +674,10 @@ export default {
             return b > a? b: a;
           })
         }
+        this.oldForm = Object.assign({}, this.form)
+        this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
+        this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
+        this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
         if (isCopy) {
           delete this.form.id
           delete this.form.sysNo
@@ -1113,15 +1124,23 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$confirm("是否保存当前页面?", "提示", {
-        confirmButtonText: "保存",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.editCustomer(true)
-      }).catch(() => {
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(true)
+        }).catch(() => {
+          this.$emit("goBack");
+        })
+      } else {
         this.$emit("goBack");
-      })
+      }
     },
     // 保存列设置
     async saveColumn(name) {

+ 27 - 13
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -478,6 +478,7 @@ import {
 } from "@/api/basicData/basicFeesDesc";
 import _ from "lodash";
 import option from "./configuration/mainList.json";
+import { contrastObj, contrastList } from "@/util/contrastData";
 
 export default {
   name: "detailsPage",
@@ -999,6 +1000,12 @@ export default {
       // 费用信息排序的最大值
       maxFeeNum: 0,
       maxGoodsNum: 0,
+      oldForm: {
+        orderStatus: "录入"
+      },
+      oldGoodsList: [],
+      oldFeesList: [],
+      oldUploadList: [],
     }
   },
   //初始化查询
@@ -1099,6 +1106,10 @@ export default {
             return b > a? b: a;
           })
         }
+        this.oldForm = Object.assign({}, this.form)
+        this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
+        this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
+        this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
         if (isCopy) {
           this.$set(this.form, 'orderStatus', '录入')
           delete this.form.id
@@ -1650,20 +1661,23 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$confirm("是否保存当前页面?", "提示", {
-        confirmButtonText: "保存",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.editCustomer(true)
-      }).catch(() => {
-        // this.$router.$avueRouter.closeTag();
-        // this.$router.push({
-        //   path: '/businessManagement/salesOrder/index',
-        //   query: {}
-        // });
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(true)
+        }).catch(() => {
+          this.$emit("goBack");
+        })
+      } else {
         this.$emit("goBack");
-      })
+      }
     },
     // 保存列设置
     async saveColumn(name) {

+ 10 - 0
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -32,6 +32,16 @@
               :disabled="detailData.status == 1"
             ></select-component>
           </template>
+          <template slot="exchangeRate">
+            <el-input
+              size="mini"
+              v-model="form.exchangeRate"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+              @change="rateChange"
+              placeholder="请输入 汇率"
+              :disabled="detailData.status == 1"
+              ><template slot="append">%</template></el-input>
+          </template>
         </avue-form>
       </basic-container>
       <div>

+ 123 - 0
src/views/mallManagement/commodity/productList/configuration/commodity.json

@@ -0,0 +1,123 @@
+
+{
+  "tip": false,
+  "addBtn": false,
+  "searchShow": false,
+  "searchShowBtn": false,
+  "menu": false,
+  "searchMenuSpan": 6,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": true,
+  "dialogClickModal": false,
+  "column": [
+    {
+      "label": "商品编码",
+      "prop": "code",
+      "search": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "商品名称",
+      "prop": "cname",
+      "slot": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "multiple": true,
+      "props": {
+        "label": "title"
+      },
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "规格编码",
+      "prop": "typeno",
+      "search": true
+    },
+    {
+      "label": "品牌",
+      "prop": "brand",
+      "slot": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "slot": true
+    },
+    {
+      "label": "规格尺寸",
+      "prop": "specs",
+      "slot": true
+    },
+    {
+      "label": "产品类别",
+      "prop": "category",
+      "slot": true
+    },
+    {
+      "label": "产品分类",
+      "prop": "categoryitem",
+      "slot": true
+    },
+    {
+      "label": "供应商",
+      "prop": "providers",
+      "slot": true
+    },
+    {
+      "label": "计量单位",
+      "prop": "unit",
+      "slot": true
+    },
+    {
+      "label": "包装单位",
+      "prop": "packgeunit",
+      "slot": true
+    },
+    {
+      "label": "商品图片",
+      "prop": "url",
+      "type": "upload",
+      "listType": "picture-img",
+      "dataType": "string",
+      "action": "/api/blade-resource/oss/endpoint/put-file",
+      "propsHttp": {
+        "res": "data",
+        "url": "link"
+      },
+      "hide": true,
+      "span": 24
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "slot": true
+    }
+  ]
+}

+ 0 - 22
src/views/mallManagement/commodity/productList/configuration/imgUploadList.json

@@ -39,28 +39,6 @@
         "trigger": "blur"
       }
     ]
-  }, {
-    "label": "图片",
-    "prop": "img",
-    "type": "upload",
-    "index": 3,
-    "width": 150,
-    "listType": "picture-img",
-    "span": 24,
-    "tip": "只能上传jpg/png/jpeg文件,且不超过2M,宽高比为1:1",
-    "action": "/api/blade-resource/oss/endpoint/put-file",
-    "dataType": "string",
-    "propsHttp": {
-      "res": "data",
-      "url": "link"
-    },
-    "rules": [
-      {
-        "required": true,
-        "message": "请上传图片",
-        "trigger": "blur"
-      }
-    ]
   },
     {
       "label": "商品详情轮播",

+ 45 - 36
src/views/mallManagement/commodity/productList/configuration/specification.json

@@ -11,20 +11,34 @@
   "menuWidth": 130,
   "column": [
     {
-      "label": "规格名称",
+      "label": "规格",
       "prop": "cname",
       "minWidth": 100,
       "span": 24
-    },
-    {
+    },{
+      "label": "商品名称",
+      "prop": "goodsName",
+      "minWidth": 100,
+      "disabled":true,
+      "span": 24
+    },{
+      "label": "商品编码",
+      "prop": "goodsCode",
+      "disabled":true,
+      "minWidth": 100,
+      "span": 24
+    },{
       "label": "限时精选",
       "prop": "isHandpick",
-      "type": "checkbox",
+      "type": "radio",
       "minWidth": 100,
       "cell": true,
       "dicData": [{
         "label": "显示",
-        "value": "false"
+        "value": "1"
+      },{
+        "label": "关闭",
+        "value": "0"
       }],
       "mock":{
         "type":"dic"
@@ -34,12 +48,15 @@
     {
       "label": "热门推荐",
       "prop": "isRecommended",
-      "type": "checkbox",
+      "type": "radio",
       "minWidth": 100,
       "cell": true,
       "dicData": [{
         "label": "显示",
-        "value": "false"
+        "value": "1"
+      },{
+        "label": "关闭",
+        "value": "0"
       }],
       "mock":{
         "type":"dic"
@@ -54,28 +71,28 @@
       "cell": true,
       "dicData": [{
         "label": "家电",
-        "value": "false"
+        "value": "0"
       },{
         "label": "箱包",
-        "value": "false"
+        "value": "1"
       },{
         "label": "饰品",
-        "value": "false"
+        "value": "2"
       },{
         "label": "服装",
-        "value": "false"
+        "value": "3"
       },{
         "label": "手机",
-        "value": "false"
+        "value": "4"
       },{
         "label": "轮胎",
-        "value": "false"
+        "value": "5"
       },{
         "label": "耗材",
-        "value": "false"
+        "value": "6"
       },{
         "label": "数码",
-        "value": "false"
+        "value": "7"
       }],
       "mock":{
         "type":"dic"
@@ -90,16 +107,16 @@
       "cell": true,
       "dicData": [{
         "label": "假一赔十",
-        "value": "false"
+        "value": "0"
       },{
         "label": "假一赔三",
-        "value": "false"
+        "value": "1"
       },{
         "label": "极速退款",
-        "value": "false"
+        "value": "2"
       },{
         "label": "7天无理由退换",
-        "value": "false"
+        "value": "3"
       }],
       "mock":{
         "type":"dic"
@@ -120,7 +137,6 @@
         "precision":2
       },
       "minRows": 0,
-      "maxRows": 3,
       "row":true,
       "controls":false
     },
@@ -137,7 +153,6 @@
         "precision":2
       },
       "minRows": 0,
-      "maxRows": 3,
       "row":true,
       "controls":false
     },
@@ -147,10 +162,10 @@
       "prop": "vip",
       "type": "switch",
       "dicData": [{
-        "label": "开启",
+        "label": "关闭",
         "value": 0
       }, {
-        "label": "关闭",
+        "label": "开启",
         "value": 1
       }],
       "mock":{
@@ -172,7 +187,6 @@
         "precision":2
       },
       "minRows": 0,
-      "maxRows": 3,
       "row":true,
       "controls":false
     },
@@ -211,23 +225,16 @@
     {
       "label": "已出售数",
       "prop": "sold",
-      "type": "number",
-      "span": 24,
-      "precision":0,
-      "mock":{
-        "type":"number",
-        "max":1,
-        "min":2,
-        "precision":2
-      },
-      "minRows": 0,
-      "maxRows": 3,
-      "row":true
+      "minWidth": 100,
+      "disabled":true,
+      "cell": true,
+      "span": 24
     },
     {
       "label": "已访问数",
       "prop": "view",
       "minWidth": 100,
+      "disabled":true,
       "cell": true,
       "span": 24
     },
@@ -235,12 +242,14 @@
       "label": "已收藏数",
       "prop": "collection",
       "minWidth": 100,
+      "disabled":true,
       "cell": true,
       "span": 24
     },
     {
       "label": "已分享数",
       "prop": "share",
+      "disabled":true,
       "minWidth": 100,
       "cell": true,
       "span": 24

+ 171 - 18
src/views/mallManagement/commodity/productList/detailsPageEdit.vue

@@ -32,14 +32,17 @@
       <containerTitle title="商品规格"></containerTitle>
       <basic-container style="margin-bottom: 10px">
         <avue-crud
+            v-model="obj"
             :data="sftData"
             :option="sftOption"
             @row-save="rowSave"
             @row-del="rowSftDel"
+            @row-update="rowUpdateBankOfDeposit"
         >
-<!--          <template slot-scope="{row}" slot="cnameForm">-->
-<!--            <el-checkbox v-model="row.cname">显示</el-checkbox>-->
-<!--          </template>-->
+          <template slot-scope="scope" slot="goodsNameForm">
+            {{obj.goodsName}}
+            <el-button type="text" @click="dialogVisible = !dialogVisible">选择</el-button>
+          </template>
           <template slot="menu" slot-scope="{ row, index }">
             <el-button
                 size="small"
@@ -109,6 +112,55 @@
         <avue-ueditor v-model="form.details" :options="options"></avue-ueditor>
       </basic-container>
     </div>
+    <el-dialog
+        title="导入商品"
+        append-to-body
+        class="el-dialogDeep"
+        :visible.sync="dialogVisible"
+        width="60%"
+        :close-on-click-modal="false"
+        :destroy-on-close="true"
+        :close-on-press-escape="false"
+        top="10vh"
+    >
+      <span>
+        <el-row>
+          <el-col :span="5">
+            <div>
+              <el-scrollbar>
+                <basic-container style="margin-top:45px">
+                  <avue-tree :option="treeOption" @node-click="nodeClick" />
+                </basic-container>
+              </el-scrollbar>
+            </div>
+          </el-col>
+          <el-col :span="19">
+            <avue-crud
+                :option="goodsOption"
+                :table-loading="loading"
+                :data="goodsList"
+                ref="goodsCrud"
+                @refresh-change="refreshChange"
+                @selection-change="selectionChange"
+                @row-click="rowClick"
+                :page.sync="page"
+                @on-load="onLoad"
+                @saveColumn="saveGoodsColumn"
+            ></avue-crud>
+          </el-col>
+        </el-row>
+      </span>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button
+            type="primary"
+            @click="importGoods"
+            :disabled="selectionList.length == 0"
+        >导入</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -116,6 +168,8 @@ import {getDetail, updateDetail, getDeptTree, priceDelete} from "@/api/mallManag
 import sftOption from "./configuration/specification.json";
 import imgUploadList from "./configuration/imgUploadList.json";
 import productParameters from "./configuration/productParameters.json";
+import {getDeptLazyTree, getGoods} from "@/api/exportTrade/purchaseContract";
+import goodsOption from "./configuration/commodity.json";
 export default {
   name: "detailsPage",
   data() {
@@ -123,7 +177,16 @@ export default {
       form: {
         details:'<h1 class="ql-align-center" style="text-align: center;"><a href="https://avuejs.com/doc/plugins/ueditor-plugins" target="_blank" style="font-weight: bold; color: rgb(194, 79, 74);">欢迎使用Avue富文本编辑器</a></h1><p class="ql-align-center" style="text-align: center;"><span style="font-weight: bold; color: rgb(194, 79, 74);"><img src="https://avuejs.com/images/logo-bg.jpg" height="200" width="200"></span></p>'
       },
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      selectionList:[],
+      dialogVisible:false,
+      obj:{},
       sftData: [],
+      goodsOption: goodsOption,
       sftOption: sftOption,
       imgUploadList: imgUploadList,
       productParameters: productParameters,
@@ -137,10 +200,37 @@ export default {
         },
       },
       disabled: false,
+      loading: false,
+      goodsList: [],
       userDialog: false,//供应商导入窗口
       imgUploadData: [],
       dicData: [],
       sftDataParameters: [],
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function(node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+                res.data.data.map(item => {
+                  return {
+                    ...item,
+                    leaf: !item.hasChildren
+                  };
+                })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          label: "title",
+          value: "value",
+          children: "children"
+        }
+      },
       detailsSelect: {},
       option: {
         menuBtn: false,
@@ -208,15 +298,52 @@ export default {
       this.dicData = res.data.data;
     });
     if (this.$route.query.id) {
-      getDetail(JSON.parse(this.$route.query.id)).then(res => {
-        this.form = res.data.data
-        this.sftData = res.data.data.itemsList
-      })
+      this.query(JSON.parse(this.$route.query.id))
     } else {
       this.$set(this.form, "goodsTypeId", this.$route.query.treeDeptId)
     }
   },
   methods: {
+    importGoods() {
+      this.selectionList.forEach((item,index) => {
+        console.log(item);
+        this.obj.goodsName = item.cname
+        this.obj.goodsCode = item.typeno
+      });
+      this.dialogVisible = false;
+    },
+    async saveGoodsColumn() {
+      const inSave = await this.saveColumnData(
+          this.getColumnName(27),
+          this.goodsOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //费用查询
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getGoods(page.currentPage, page.pageSize, this.treeDeptId).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.goodsList = data.records;
+        this.loading = false;
+        if (this.page.total) {
+          this.goodsOption.height = window.innerHeight - 550;
+        } else {
+          this.goodsOption.height = window.innerHeight - 475;
+        }
+      });
+    },
+    rowClick(row) {
+      this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
     // 商品图片上传保存
     imgUploadSave(row, done, loading) {
       console.log(row);
@@ -276,10 +403,11 @@ export default {
           }
         } else {
           const width = 750;
-          const height = 1000;
-          isSize = img.width === width && img.height <= height;
+          const height = 750;
+          console.log(img.width,img.height)
+          isSize = img.width === img.height
           if (!isSize) {
-            this.$message.error("商品详情轮播图宽为750,高不能超过1000");
+            this.$message.error("商品详情轮播图宽为"+width+",高不能超过"+width+"或小于"+width);
           }
         }
         if (is2M && isType && isSize) {
@@ -291,14 +419,6 @@ export default {
       img.src = _URL.createObjectURL(file);
     },
     addSftRow() {
-      this.sftData.push({
-        $cellEdit: true,
-        cname: null,
-        texture: null,
-        colour: null,
-        describe: null,
-        remarks: null
-      });
     },
     parameterAddition() {
       this.sftDataParameters.push({
@@ -317,12 +437,30 @@ export default {
     rowPurchaseCell(row, index) {
       this.$refs.crudPurchase.rowCell(row, index)
     },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //修改商品规格触发
+    rowUpdateBankOfDeposit(row, index, done, loading) {
+      done(row);
+    },
     //修改提交触发
     editProductInfo() {
       this.$refs["form"].validate((valid) => {
         //校验明细列表
         if (valid) {
           console.log(this.form);
+          this.form.picture = JSON.stringify(this.imgUploadData)
+          let data = this.sftData
+          // if (typeof data ==  )
+          data.forEach((item,index)=>{
+            console.log(typeof item.goodsTitel)
+            if ('object' == typeof item.goodsTitel) item.goodsTitel = item.goodsTitel.join(',')
+            if ('object' == typeof item.serviceTitel) item.serviceTitel = item.serviceTitel.join(',')
+          })
+          this.form.itemsList = data
           const params = {
             ...this.form,
             type: 0,
@@ -330,6 +468,7 @@ export default {
           updateDetail(params).then(res => {
             if (res.data.success) {
               this.$message.success("操作成功!")
+              this.query(this.form.id)
             }
           })
         } else {
@@ -337,6 +476,20 @@ export default {
         }
       });
     },
+    query(id){
+      getDetail(id).then(res => {
+        this.form = res.data.data
+        if (this.form.picture) this.imgUploadData = JSON.parse(this.form.picture)
+        if (res.data.data.itemsList) {
+          res.data.data.itemsList.forEach((item,index)=>{
+            item.goodsTitel = item.goodsTitel.split(',')
+            item.serviceTitel = item.serviceTitel.split(',')
+          })
+          this.sftData = res.data.data.itemsList
+        }
+        delete this.form.itemsList
+      })
+    },
     //返回列表
     backToList() {
       this.$router.$avueRouter.closeTag();

+ 18 - 46
src/views/mallManagement/commodity/productList/index.vue

@@ -67,29 +67,24 @@
                 type="text"
                 icon="el-icon-delete"
                 size="small"
+                @click="lowerShelf(1,scope.row)"
+            >上架
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-delete"
+                size="small"
+                @click="lowerShelf(2,scope.row)"
             >下架
             </el-button>
           </template>
         </avue-crud>
-        <el-dialog title="导入产品"
-                   append-to-body
-                   :visible.sync="excelBox"
-                   width="555px">
-          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="derivation">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-          <p style="text-align: center;color: #DC0505">温馨提示  第一次导入时请先下载模板</p>
-        </el-dialog>
       </basic-container>
     </el-col>
   </el-row>
 </template>
 <script>
-import {getList, getUser, getUserPlatform, remove, updatePlatform, add, grant, getDeptLazyTree, getDeptTree} from "@/api/mallManagement/commodity/productList";
+import {getList, getUser, getUserPlatform, remove, updatePlatform, add, grant, getDeptLazyTree, getDeptTree,underCommodity} from "@/api/mallManagement/commodity/productList";
 import {getRoleTree} from "@/api/system/role";
 import {getToken} from '@/util/auth';
 import option from "./configuration/mainList.json";
@@ -159,44 +154,12 @@ export default {
       platformSelectionList: [],
       platformData: [],
       platformForm: {},
-      excelForm: {},
-      excelOption: {
-        submitBtn: false,
-        emptyBtn: false,
-        column: [
-          {
-            label: '模板下载',
-            prop: 'excelTemplate',
-            formslot: true,
-            span: 24,
-          },
-          {
-            label: '模板上传',
-            prop: 'excelFile',
-            type: 'upload',
-            drag: true,
-            loadText: '模板上传中,请稍等',
-            span: 24,
-            propsHttp: {
-              res: 'data',
-            },
-            tip: '请上传 .xls,.xlsx 标准格式文件',
-            action: "/api/blade-client/goodsdesc/import-desc",
-          },
-        ]
-      }
     };
   },
   methods: {
     derivation() {
       window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
     },
-    uploadAfter(res, done, loading, column) {
-      window.console.log(column);
-      this.excelBox = false;
-      this.refreshChange();
-      done();
-    },
     nodeClick(data) {
       this.treeDeptId = data.id;
       this.page.currentPage = 1;
@@ -270,6 +233,15 @@ export default {
         query: { id: JSON.stringify(row.id) }
       });
     },
+    //单个下架触发
+    lowerShelf(i,row){
+      underCommodity({
+        flag:i,
+        ids:row.id
+      }).then(res=>{
+        console.log(res)
+      })
+    },
     //删除触发
     rowDel(row, index, done) {
       this.$confirm("确定将选择数据删除?", {