shish 4 years ago
parent
commit
d0e78ce192

+ 7 - 7
ghsApp/src/admin/billing/toPay.vue

@@ -29,16 +29,16 @@
           <view style="margin-bottom:20upx;">
               <button @click="changePayWay(0)" class="admin-button-com middle" :class="payWay == 0 ? 'blue' : 'default'">微信</button>
               <button @click="changePayWay(1)" style="margin-left:40upx;" class="admin-button-com middle" :class="payWay == 1 ? 'blue' : 'default'">支付宝</button>
-              <button @click="changePayWay(2)" style="margin-left:40upx;" class="admin-button-com middle" :class="payWay == 2 ? 'blue' : 'default'">欠款</button>
+              <button @click="changePayWay(2)" style="margin-left:40upx;" class="admin-button-com middle" :class="payWay == 2 ? 'blue' : 'default'">欠款</button>
           </view>
           <image mode="widthFix" style="width:350upx;margin:0 auto;" :src="payQrCodeUrl"></image>
           </view>
         </view>
         <view style="margin-top:35upx;">
-            <button style="width:25vh;" @click="goBack()" class="admin-button-com big default">返回首页</button>
+            <button style="width:28vh;" @click="goBack()" class="admin-button-com big default">返回首页</button>
         </view>
-        <view v-if="orderInfo.orderType == 1" style="color:#CCCCCC;margin-top:20upx;">10分钟后,订单状态将自动变成欠款 <text @click="cancelOrder()" style="color:#666666;margin-left:10upx;text-decoration:underline;">取消订单</text></view>
-        <view v-else style="color:#CCCCCC;margin-top:20upx;">客户下单,10分钟后未付款自动取消</view>
+        <view v-if="orderInfo.orderType == 1" style="color:#CCCCCC;margin-top:20upx;">10分钟后未付款,订单自动变成欠款 <text @click="cancelOrder()" style="color:#666666;margin-left:10upx;text-decoration:underline;">取消订单</text></view>
+        <view v-else style="color:#CCCCCC;margin-top:20upx;">客户下单,10分钟后未付款自动取消</view>
       </view>
     </view>
   </view>
@@ -230,7 +230,7 @@ export default {
       // 使用icon
       .icon {
         .iconfont {
-          font-size: 170upx;
+          font-size: 130upx;
         }
       }
       // 一个按钮
@@ -265,13 +265,13 @@ export default {
 }
 .wait {
   color: #ffa92e;
-  font-size: 40upx;
+  font-size: 30upx;
   font-weight: 700;
   margin: 20upx 0;
 }
 .balance{
   margin-top:30upx;
-  font-size:33upx;
+  font-size:28upx;
   font-weight: bold;
 }
 </style>

+ 662 - 0
ghsApp/src/admin/item/add.vue

@@ -0,0 +1,662 @@
+<template>
+  <div class="app-content">
+    <!-- 花材基本信息 -->
+    <form @submit="formSubmit">
+      <div class="module-com input-line-wrap">
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">花材名称</div>
+          <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请填写名称" @input="fillName($event)" maxlength="50" type="text" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">花材品种</div>
+          <view style="color:red;width:450upx;height:45upx;" @click.stop="notModify">{{form.name}}</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">拼音缩写</div>
+          <input
+            v-model="form.py"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="py"
+            placeholder="请填写拼音首字母缩写"
+            maxlength="50"
+            type="text"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">售价</div>
+          <input
+            v-model="form.price"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="price"
+            @focus="form.price=''"
+            placeholder="请填写售价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">今日特价</div>
+          <input
+            v-model="form.discountPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="discountPrice"
+            @focus="form.discountPrice=''"
+            placeholder="没有特价填0"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">库存</div>
+          <input v-model="form.stock" style="width:340upx;" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" type="digit"/>
+          <button v-if="productData.id > 0" class="admin-button-com blue small" @click="goStockDetail(productData.id)">库存明细</button>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :arrow="true">
+          <div class="tui-title">分类</div>
+          <picker
+            mode="selector"
+            :value="form.classId"
+            :range="itemClassData"
+            range-key="name"
+            @change="changeItemClassFn"
+            class="tui-input"
+          >
+            <input v-model="form.classId" name="classId" type="text" hidden />
+            <div v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</div>
+            <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
+          </picker>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :arrow="true">
+          <div class="tui-title">大单位</div>
+          <picker
+            mode="selector"
+            :value="form.bigUnitId"
+            :range="unitData"
+            range-key="name"
+            @change="changeBigUnitFn"
+            class="tui-input"
+          >
+            <input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
+            <div v-if="form.bigUnitId">{{ bigUnitSelectedData.name }}</div>
+            <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
+          </picker>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :arrow="true">
+          <div class="tui-title">小单位</div>
+          <picker
+            mode="selector"
+            :value="form.smallUnitId"
+            :range="unitData"
+            range-key="name"
+            @change="changeSmallUnitFn"
+            class="tui-input"
+          >
+            <input v-model="form.smallUnitId" name="smallUnitId" type="text" hidden />
+            <div v-if="form.smallUnitId">{{ smallUnitSelectedData.name }}</div>
+            <div class="tui-placeholder" v-else>请选择</div>
+          </picker>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">散客加价</div>
+          <input
+            v-model="form.skAddPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="skAddPrice"
+            @focus="form.skAddPrice=''"
+            placeholder="请填写散客加价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">普店加价</div>
+          <input
+            v-model="form.addPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="addPrice"
+            @focus="form.addPrice=''"
+            placeholder="请填写普店加价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">银店加价</div>
+          <input
+            v-model="form.hjAddPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="hjAddPrice"
+            @focus="form.hjAddPrice=''"
+            placeholder="请填写银店加价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">金店加价</div>
+          <input
+            v-model="form.zsAddPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="zsAddPrice"
+            @focus="form.zsAddPrice=''"
+            placeholder="请填写金店加价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">单位比</div>
+          <input
+            v-model="form.ratio"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="ratio"
+            placeholder="如:1扎=20支,请填写20"
+            maxlength="50"
+            type="number"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">每扎重量</div>
+          <input
+            v-model="form.weight"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="weight"
+            placeholder="单位:公斤"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">库存预警值</div>
+          <input
+            v-model="form.stockWarning"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="stockWarning"
+            placeholder="请填写"
+            maxlength="50"
+            type="number"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">上架状态</div>
+          <div class="switch_bx">
+            <switch :checked="form.status == 2 ? false : true" @change="statusChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.status == 1">上架</text>
+            <text v-else>下架</text>
+          </div>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">状态</div>
+          <div class="switch_bx">
+            <switch :checked="form.delStatus == 0 ? true : false" @change="delStatusChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.delStatus == 0">启用</text>
+            <text v-else>停用</text>
+          </div>
+        </tui-list-cell>
+
+      </div>
+
+      <div class="module-com input-line-wrap goods-wrap">
+        <div class="module-tit">
+          <span>花材图片</span>
+          <span class="app-color-3">(建议比例 600X600)</span>
+        </div>
+        <view class="module-det">
+          <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers"
+           @uploadSuccess="imgUploadSuccess" @imgDelete="imgDeleteFn" :action="getLoginInfo.imgUploadApi">
+          </htz-image-upload>
+        </view>
+      </div>
+
+      <div class="app-footer">
+        <button class="admin-button-com big default" @click="goBack()">取消</button>
+        <button v-if="option.ptItemId" class="admin-button-com big blue" formType="submit" @click="status = 1">添加</button>
+        <button v-else class="admin-button-com big blue" formType="submit" @click="status = 1">确认</button>
+      </div>
+
+    </form>
+  </div>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+const form = require("@/utils/formValidation.js");
+import { getAllItemClass } from "@/api/item-class";
+import { getAllUnit } from "@/api/unit";
+import { addProduct,updateProduct,getProductDetail,py } from "@/api/product";
+import { getPtItemDetail } from "@/api/pt-item";
+import { mapGetters } from "vuex"
+//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
+import htzImageUpload from './components/htz-image-upload/htz-image-upload.vue'
+export default {
+  name: "item-detail",
+  components: {
+    TuiListCell,
+    htzImageUpload
+  },
+  data() {
+    return {
+      status: 1,
+      currentImgData: [],
+      form: {
+        id:0,
+        name:"",
+        py:"",
+        stock:'',
+        ratio:'',
+        bigUnitId:1,
+        smallUnitId:2,
+        classId:'',
+        price:'',
+        skAddPrice:'',
+        addPrice:'',
+        hjAddPrice:'',
+        zsAddPrice:'',
+        discountPrice:'',
+        weight:'',
+        cover:[],
+        stockWarning:'',
+        status:2,
+        delStatus:0,
+        itemId:0,
+      },
+      itemClassSelectedData:{},
+      itemClassData:[],
+      unitData:[],
+      smallUnitSelectedData:{},
+      bigUnitSelectedData:{},
+      hasRequest:0,
+      productData:{id:0},
+      headers:{token:''}
+    };
+  },
+	computed:{
+		...mapGetters(["getLoginInfo","getDictionariesInfo"]),
+	},
+  onLoad(option) {
+    if(option.id){
+      this.form.id = this.option.id
+    }
+    const token = uni.getStorageSync('token')
+    this.headers.token = token
+  },
+  watch:{
+  },
+  methods: {
+    notModify(){
+      this.$msg('不可修改')
+    },
+    goStockDetail(id){
+				this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})
+		},
+    statusChange(e){
+      this.form.status = e.detail.value ? 1 : 2;
+    },
+    delStatusChange(e){
+      this.form.delStatus = e.detail.value ? 0 : 1;
+    },
+    //如果库存被修改则花材状态变化
+    changeStock(event){
+      let num = Number(event.target.value)
+      if(num > 0){
+        this.form.status = 1
+      }else{
+        this.form.status = 2
+      }
+    },
+    //获取拼音首字母 shish 20210707
+    fillName(event){
+      let val = event.target.value
+      py({
+        name:val
+      }).then(res => {
+        if(res.data.py){
+          this.form.py = res.data.py
+        }
+      });
+    },
+    goBack(){
+      uni.navigateBack({
+						delta: 1
+					});
+    },
+    changeBigUnitFn(e){
+      this.bigUnitSelectedData = this.unitData[e.detail.value];
+      this.form.bigUnitId = this.bigUnitSelectedData.id;
+    },
+    changeSmallUnitFn(e){
+      this.smallUnitSelectedData = this.unitData[e.detail.value];
+      this.form.smallUnitId = this.smallUnitSelectedData.id;
+    },
+    changeItemClassFn(e) {
+        this.itemClassSelectedData = this.itemClassData[e.detail.value];
+        this.form.classId = this.itemClassSelectedData.id;
+    },
+    //从平台导入花材 shish 20210826
+    getPtItemInfo(ptItemId){
+      getPtItemDetail({id:ptItemId}).then(res=>{
+
+        if (this.$util.isEmpty(res.data)) {
+          return;
+        }
+        Object.keys(this.form).forEach((i, index) => {
+          this.form[i] = res.data[i];
+        });
+
+        this.currentImgData.push(res.data.cover)
+        this.form.cover = [res.data.shortCover]
+
+        this.form.stock = ''
+        this.form.itemId = ptItemId
+        this.form.classId = ''
+        this.form.status = 1
+        this.form.delStatus = 0
+        this.form.id = 0
+        this.form.price = ''
+        this.form.skAddPrice =''
+        this.form.addPrice =''
+        this.form.hjAddPrice =''
+        this.form.zsAddPrice =''
+        this.form.discountPrice = ''
+      })
+    },
+    getDetail() {
+      return getProductDetail({ id: this.option.id }).then(res => {
+        if (this.$util.isEmpty(res.data)) {
+          return;
+        }
+        Object.keys(this.form).forEach((i, index) => {
+          this.form[i] = res.data[i];
+        });
+
+        this.currentImgData.push(res.data.cover)
+        this.form.cover = [res.data.shortCover]
+
+        this.form.price = res.data.prePrice
+
+        this.itemClassSelectedData = this.itemClassData.filter(
+          e => this.form.classId == e.id
+        )[0];
+        this.smallUnitSelectedData = this.unitData.filter(
+          e => this.form.smallUnitId == e.id
+        )[0];
+       this.bigUnitSelectedData = this.unitData.filter(
+          e => this.form.bigUnitId == e.id
+        )[0];
+        this.productData = res.data
+      });
+    },
+    imgUploadSuccess(res) {
+      var _res = JSON.parse(res.data)
+      if(_res.code == 1){
+        this.currentImgData.push(_res.data.smallUrl)
+        this.form.cover.push(_res.data.shortUrl)
+      }
+    },
+    imgDeleteFn(res){
+      const index = res.index
+      this.form.cover.splice(index,1)
+    },
+    init() {
+      //从平台导入花材
+      if(!this.$util.isEmpty(this.option.ptItemId)){
+        uni.setNavigationBarTitle({title: "确认花材信息"})
+      }
+
+      if(this.hasRequest == 1){
+        return 
+      }
+      this._getAllUnit().then(res=>{
+        this._getAllItemClass().then(res => {
+          if(this.form.id == 0){
+            this.smallUnitSelectedData = this.unitData.filter(e => 2 == e.id)[0];
+            this.bigUnitSelectedData = this.unitData.filter(e => 1 == e.id)[0];
+            //从平台导入花材
+            if(!this.$util.isEmpty(this.option.ptItemId)){
+              this.getPtItemInfo(this.option.ptItemId)
+            }
+          }else{
+            this.getDetail();
+          }
+        });
+      })
+      this.hasRequest = 1
+    },
+    async _getAllUnit() {
+      await getAllUnit().then(res => {
+        if (this.$util.isEmpty(res.data)){
+          return false;
+        }
+        this.unitData = res.data.list;
+      });
+    },
+    async _getAllItemClass() {
+      await getAllItemClass().then(res => {
+        if (this.$util.isEmpty(res.data)){
+          return false;
+        }
+        this.itemClassData = res.data;
+      });
+    },
+    // 确认
+    confirmFn() {
+      if (this.$util.isEmpty(this.form.cover)) {
+        this.$msg("请上传图片")
+        return false
+      }
+
+      this.form.cover = this.form.cover[0]
+
+      let requestHost = addProduct
+      if(this.form.id && this.form.id != 0){
+        requestHost = updateProduct;
+      }else{
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.stock) == false){
+					uni.showToast({title:"请填写库存,没有请填0",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.discountPrice) == false){
+					uni.showToast({title:"请填写特价,没有特价请填0",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.price) == false){
+					uni.showToast({title:"请填写售价",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skAddPrice) == false){
+					uni.showToast({title:"请填写散客加价",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
+					uni.showToast({title:"请填写普店加价",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjAddPrice) == false){
+					uni.showToast({title:"请填写银店加价",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.zsAddPrice) == false){
+					uni.showToast({title:"请填写金店加价",icon:"none"})
+					return;
+				}
+      }
+      let form = JSON.parse(JSON.stringify(this.form));
+      form.cover = this.$util.imgSubstr(form.cover);
+      requestHost({...form}).then(res => {
+
+        this.$msg("操作成功!");
+
+        //返回上一页带参数
+        let pages = getCurrentPages();
+        let prevPage = pages[ pages.length - 2 ];
+        let hidden = 0
+        if(this.form.stock > this.form.stockWarning){
+          hidden = 1
+        }
+        prevPage.$vm.modifyStock = {id:this.form.id,stock:this.form.stock,hidden:hidden};
+
+        uni.navigateBack({});
+      });
+    },
+    // 表单验证
+    formSubmit(e) {
+      // 表单规则
+      let rules = [
+        {
+          name: "name",
+          rule: ["required"],
+          msg: ["请填写名称"]
+        },
+        {
+          name: "py",
+          rule: ["required"],
+          msg: ["请填写拼音缩写"]
+        },{
+          name: "stock",
+          rule: ["required"],
+          msg: ["请填写库存,没有填0"]
+        },
+        {
+          name: "bigUnitId",
+          rule: ["required"],
+          msg: ["请选择大单位"]
+        },
+        {
+          name: "smallUnitId",
+          rule: ["required"],
+          msg: ["请选择小单位"]
+        },
+        {
+          name: "ratio",
+          rule: ["required"],
+          msg: ["请填写单位比"]
+        },
+        {
+          name: "price",
+          rule: ["required"],
+          msg: ["请填写售价"]
+        },
+        {
+          name: "skAddPrice",
+          rule: ["required"],
+          msg: ["请填写散客加价"]
+        },
+        {
+          name: "addPrice",
+          rule: ["required"],
+          msg: ["请填写普店加价"]
+        },
+        {
+          name: "hjAddPrice",
+          rule: ["required"],
+          msg: ["请填写银店加价"]
+        },
+        {
+          name: "zsAddPrice",
+          rule: ["required"],
+          msg: ["请填写金店加价"]
+        },
+        {
+          name: "discountPrice",
+          rule: ["required"],
+          msg: ["不做特价请填0"]
+        },
+        {
+          name: "weight",
+          rule: ["required"],
+          msg: ["请填写重量"]
+        },
+        {
+          name: "classId",
+          rule: ["required"],
+          msg: ["请选择分类"]
+        },
+        {
+          name: "stockWarning",
+          rule: ["required"],
+          msg: ["请填写库存预警值"]
+        }
+      ];
+      // 进行表单检查
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      // 验证通过!
+      if (!checkRes) {
+          this.confirmFn()
+      } else {
+        this.$msg(checkRes);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 100upx);
+  padding-bottom: 150upx;
+}
+// 公共模块
+.module-com {
+  margin-bottom: 20upx;
+  background-color: #fff;
+  color: $fontColor2;
+  .module-tit {
+    padding: 20upx 30upx;
+    font-size: 28upx;
+  }
+  .module-det {
+    padding: 0 30upx;
+  }
+}
+.category-wrap {
+  align-items: flex-start;
+  padding-bottom: 0 !important;
+  .tui-input {
+    @include disFlex(center, flex-start);
+    flex-wrap: wrap;
+    .admin-button-com {
+      margin-right: 20upx;
+      margin-bottom: 20upx;
+      position: relative;
+      z-index: 9999;
+    }
+  }
+}
+.summary-wrap {
+  .goods-summary {
+    height: 400upx;
+  }
+}
+.app-footer {
+  justify-content: space-evenly;
+  z-index: 9999;
+  .admin-button-com {
+    width: 46%;
+  }
+}
+</style>

+ 17 - 16
ghsApp/src/admin/item/detail.vue

@@ -3,18 +3,15 @@
     <!-- 花材基本信息 -->
     <form @submit="formSubmit">
       <div class="module-com input-line-wrap">
+
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">名称</div>
-          <input
-            v-model="form.name"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="name"
-            placeholder="请填写名称"
-            @input="fillName($event)"
-            maxlength="50"
-            type="text"
-          />
+          <div class="tui-title">花材名称</div>
+          <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请填写名称" @input="fillName($event)" maxlength="50" type="text" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">花材品种</div>
+          <view style="color:red;width:450upx;height:45upx;" @click.stop="notModify">{{productData.ptItemInfo.name}}</view>
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
@@ -311,6 +308,9 @@ export default {
   watch:{
   },
   methods: {
+    notModify(){
+      this.$msg('不可修改')
+    },
     goStockDetail(id){
 				this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})
 		},
@@ -469,8 +469,9 @@ export default {
         this.$msg("请上传图片")
         return false
       }
-
-      this.form.cover = this.form.cover[0]
+      if(Array.isArray(this.form.cover)){
+        this.form.cover = this.form.cover[0]
+      }
 
       let requestHost = addProduct
       if(this.form.id && this.form.id != 0){
@@ -505,11 +506,11 @@ export default {
 					return;
 				}
       }
-      let form = JSON.parse(JSON.stringify(this.form));
-      form.cover = this.$util.imgSubstr(form.cover);
+      let form = JSON.parse(JSON.stringify(this.form))
+      uni.showLoading({mask:true})
       requestHost({...form}).then(res => {
 
-        this.$msg("操作成功");
+        this.$msg("操作成功");
 
         //返回上一页带参数
         let pages = getCurrentPages();

+ 1 - 1
ghsApp/src/admin/ptItem/itemList.vue

@@ -6,7 +6,7 @@
 				<app-search-module v-model="py" placeholder="输入英文字母搜索" @input="searchFnContrapose"/>
 			</view>
 			<view style="padding:0 0upx 0 20upx;" >
-				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/detail',type:2 })">自定义</button>
+				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/add',type:2 })">自定义</button>
 			</view>
 		</view>
 		<view class="scroll-middle_bx">

+ 26 - 4
ghsApp/src/components/module/dateSelect.vue

@@ -12,7 +12,7 @@
         <view v-if="dropdownShow" :style="{top}" class="select-fixed_bx">
             <slot>
                 <view class="select-item-box">
-                    <view class="title">时间</view>
+                    <view class="title">快捷</view>
                     <view class="item-child_box">
                         <button
                             v-for="(item,index) in getDictionariesInfo.dateDefaultOption"
@@ -23,14 +23,27 @@
                         </button>
                     </view>
                 </view>
+
+
                 <view class="select-item-box">
-                    <view class="title">时间段</view>
+                    <view class="title">按月份</view>
+                    <picker mode="date" :value="date" :start="startDate" :end="endDate" fields="month" @change="bindMonthChange" >
+                        <view class="item-child_box">
+                            <view class="admin-button-com mini-btn default custom" >{{showMonth||'选择月份'}}</view>
+                        </view>
+                    </picker>
+                </view>
+
+
+                <view class="select-item-box">
+                    <view class="title">自定义</view>
                     <view class="item-child_box" >
                         <view class="admin-button-com mini-btn default custom" @click="showDatePicker(0)">{{startDate || '选择开始日期'}}</view>
                         <view class="admin-button-com mini-btn default custom" @click="showDatePicker(1)">{{endDate || '选择结束日期'}}</view>
                         <view class="admin-button-com mini-btn blue custom" @click="customDateConfirm()">确认</view>
                     </view>
                 </view>
+
             </slot>
         </view>
         <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="cancelPicker" />
@@ -80,7 +93,8 @@ export default {
             startDate:'',
             endDate:'',
             dateIndex:0,
-            defaultDateName:'今天'
+            defaultDateName:'今天',
+            showMonth:null
         }
     },
 	watch:{
@@ -102,6 +116,14 @@ export default {
     onLoad(){
     },
     methods:{
+        bindMonthChange(e){
+            this.dropdownShow = !this.dropdownShow
+            this.dropdownShow = false;
+            let currentMonth = e.target.value
+            this.defaultDateName = currentMonth
+            this.showMonth = currentMonth
+            this.$emit('selectDateFn',{searchTime:'byMonth',startTime:currentMonth})
+        },
         showDatePicker(index){//显示
             this.showPicker = true;
             this.dateIndex = index
@@ -124,7 +146,7 @@ export default {
                 return false
             }
             this.dropdownShow = false
-            this.defaultDateName = '时间段'
+            this.defaultDateName = '自定义'
             this.$emit('selectDateFn',{searchTime:'custom',startTime:this.startDate,endTime:this.endDate})
         },
         cancelPicker(){

+ 1 - 0
ghsApp/src/pages.json

@@ -322,6 +322,7 @@
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "花材列表"}},
 				{"path": "detail","style": {"navigationBarTitleText": "花材详情"}},
+				{"path": "add","style": {"navigationBarTitleText": "添加花材"}},
 				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
 				{"path": "xjSelect","style": {"navigationBarTitleText": "小菊颜色选择"}},
 				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值活动"}}

+ 1 - 2
ghsApp/src/pagesArrears/details.vue

@@ -229,9 +229,8 @@ export default {
 
 			} catch (error) {}
 		},
-		// 支付成功
 		async paySuccess(parameter) {
-			await clearOrderApi({...parameter,modifyPrice:this.modifyPrice});
+			await clearOrderApi({...parameter,modifyPrice:this.modifyPrice,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime});
 			this.pageTo({url:'/common/success', type: 2,query:{titleType:3}});
 		},
 		payFail() {

+ 20 - 1
hdApp/src/components/module/dateSelect.vue

@@ -23,6 +23,16 @@
                         </button>
                     </view>
                 </view>
+
+                <view class="select-item-box">
+                    <view class="title">按月份</view>
+                    <picker mode="date" :value="date" :start="startDate" :end="endDate" fields="month" @change="bindMonthChange" >
+                        <view class="item-child_box">
+                            <view class="admin-button-com mini-btn default custom" >{{showMonth||'选择月份'}}</view>
+                        </view>
+                    </picker>
+                </view>
+
                 <view class="select-item-box">
                     <view class="title">时间段</view>
                     <view class="item-child_box" >
@@ -80,7 +90,8 @@ export default {
             startDate:'',
             endDate:'',
             dateIndex:0,
-            defaultDateName:'今天'
+            defaultDateName:'今天',
+            showMonth:null
         }
     },
 	watch:{
@@ -102,6 +113,14 @@ export default {
     onLoad(){
     },
     methods:{
+        bindMonthChange(e){
+            this.dropdownShow = !this.dropdownShow
+            this.dropdownShow = false;
+            let currentMonth = e.target.value
+            this.defaultDateName = currentMonth
+            this.showMonth = currentMonth
+            this.$emit('selectDateFn',{searchTime:'byMonth',startTime:currentMonth})
+        },
         showDatePicker(index){//显示
             this.showPicker = true;
             this.dateIndex = index

+ 18 - 13
hdApp/src/pagesPurchase/gathering.vue

@@ -162,21 +162,26 @@ export default {
     },
     //批量收款
     batchConfirm () {
+      if(this.searchTime == ''){
+        this.$msg('请选择月份')
+        return false
+      }
       let arr = []
-      if (this.selectList.length > 0) {
-        this.selectList.forEach(item => {
-          arr.push(item.id)
-        })
-        purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:this.option.id }).then(res => {
-          if(res.code == 1) {
-            this.pageTo({
-              url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond,
-              type: 2
-            })
-          }
-        }).catch(err => {
-        })
+      if (this.$util.isEmpty(this.selectList)) {
+        this.$msg('请选择订单')
+        return false
       }
+      this.selectList.forEach(item => {
+        arr.push(item.id)
+      })
+      purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:this.option.id }).then(res => {
+        if(res.code == 1) {
+          this.pageTo({
+            url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond,
+            type: 2
+          })
+        }
+      })
     },
     back () {
       uni.navigateBack({})

+ 1 - 1
hdApp/src/pagesPurchase/order.vue

@@ -79,7 +79,7 @@ export default {
 		},
     enterShop(item) {
       const { id } = item
-      this.pageTo({url: '/pagesPurchase/ghsProduct',query:{id:id},type: 2})
+      this.pageTo({url: '/pagesPurchase/ghsProduct',query:{id:id}})
     },
     init() {
       this.getGHSList()

+ 2 - 2
hdApp/src/pagesPurchase/wechatPay.vue

@@ -31,7 +31,7 @@
               <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" v-if="Number(balance) >0" @click="balancePay">余额支付</button>
             </view>
 
-            <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">记欠</button>
+            <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">记欠</button>
 
           </div>
 
@@ -112,7 +112,7 @@ export default {
       let that = this
       uni.showModal({
 				title: '提示',
-				content: '确认记欠?',
+				content: '确认记欠?',
 				success: function (res) {
 					if (res.confirm) {