shish 4 лет назад
Родитель
Сommit
fdae181a04

+ 12 - 24
hdApp/src/admin/work/add.vue

@@ -56,7 +56,7 @@
 import TuiListCell from "@/components/plugin/list-cell";
 const form = require("@/utils/formValidation.js");
 import { getClass } from "@/api/category";
-import { cgPlant } from "@/api/goods/index";
+import { addWork } from "@/api/work/index";
 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'
@@ -72,7 +72,7 @@ export default {
       form: {
         name:"花束",
         catId:'',
-        shopImg:[],
+        cover:[],
         num:'',
         remark:''
       },
@@ -108,12 +108,12 @@ export default {
       var imgReturn = JSON.parse(res.data)
       if(imgReturn.code == 1){
         this.currentImgData.push(imgReturn.data.smallUrl)
-        this.form.shopImg.push(imgReturn.data.shortUrl)
+        this.form.cover.push(imgReturn.data.shortUrl)
       }
     },
     imgDeleteFn(res){
       const index = res.index
-      this.form.shopImg.splice(index,1)
+      this.form.cover.splice(index,1)
     },
     init() {
       this.getPlantCategory()
@@ -124,23 +124,21 @@ export default {
           return false;
         }
         this.plantClassData = res.data;
+        if(this.plantClassData && this.plantClassData[0] && this.plantClassData[0].id){
+          this.form.catId = this.plantClassData[0].id||''
+          let categoryName = this.plantClassData[0].categoryName||''
+          this.categorySelectedData = {categoryName}
+        }
       });
     },
     confirmFn() {
-      if (this.$util.isEmpty(this.form.shopImg)) {
+      if (this.$util.isEmpty(this.form.cover)) {
         this.$msg("请上传图片")
         return false
       }
-      if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.cgPrice) == 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.salePrice) == false){
-        uni.showToast({title:"请填写销售单价哦",icon:"none"})
-        return;
-      }
+      this.form.cover = this.form.cover[0]
       let form = JSON.parse(JSON.stringify(this.form))
-      cgPlant({...form}).then(res => {
+      addWork({...form}).then(res => {
         if(res.code == 1){
           this.pageTo({url: '/admin/work/addResult',type:2})
         }
@@ -162,16 +160,6 @@ export default {
           name: "num",
           rule: ["required"],
           msg: ["请选择数量"]
-        },
-        {
-          name: "cgPrice",
-          rule: ["required"],
-          msg: ["请填写进货单价"]
-        },
-        {
-          name: "salePrice",
-          rule: ["required"],
-          msg: ["请填写销售单价"]
         }
       ];
       let formData = e.detail.value;

+ 1 - 5
hdApp/src/admin/work/components/workItem.vue

@@ -7,11 +7,7 @@
          mode="widthFix" :src="`${constant.imgUrl}/icon/codePay8.png`"></image>
 
         <image style="width: 38upx;height:38upx;border-radius:38upx;" mode="aspectFit" :src="item.customAvatarUrl"></image>
-          <view class="tit"> {{ item.customName || "" }}</view>
-
-          <view class="other-refund" v-if="item.refund==2">有退款</view>
-          <view class="other-status" v-if="item.debt == 1">欠款</view>
-          <text class="other-book" v-if="item.book == 1" >预订单</text>
+          <view class="tit"> {{ item.name || "" }}</view>
           <view :class="['status',item.status == '3' ? 'buleColor' : item.status == '6' ? 'defColor' : '']">{{ statusFormat(item.status) }}</view>
         </view>
         <view class="order-list_info">

+ 12 - 35
hdApp/src/admin/work/list.vue

@@ -14,11 +14,11 @@
       </view>
     </view>
     <view class="app-tabs">
-      <app-tabs :tabs="tabs" :isFixed="false" :top="50" :currentTab="tabIndex" :height="100" @change="change" itemWidth="20%" />
+      <app-tabs :tabs="tabs" :isFixed="false" :top="50" :currentTab="tabIndex" :height="100" @change="change" itemWidth="33%" />
     </view>
     <div class="list-wrap">
       <block v-if="!$util.isEmpty(list.data)">
-        <div class="list" v-for="(item, index) in list.data" :key="index">
+        <div class="list" v-for="(item, index) in list.data.list" :key="index">
 
           <workItem :item="item" @orderEventBtn="orderEventBtn"></workItem>
 
@@ -32,8 +32,6 @@
       </block>
     </div>
 
-    <NotLogin></NotLogin>
-
   </view>
 </template>
 <script>
@@ -43,7 +41,7 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
-import { getListB} from "@/api/order";
+import { getWorkList} from "@/api/work";
 import AppSearchModule from "@/components/module/app-search";
 import DropShopSelect from "@/components/module/shopSelect";
 import workItem from "./components/workItem";
@@ -74,40 +72,28 @@ export default {
         {
           name: "全部",
           value: 0,
-          id: 0,
-        },
-        {
-          name: "待付款",
-          value: 0,
-          id: 1,
-        },
-        {
-          name: "待配送",
-          value: 0,
-          id: 2,
+          id: -1,
         },
         {
-          name: "配送中",
+          name: "待完成",
           value: 0,
-          id: 3,
+          id: 0,
         },
         {
           name: "已完成",
           value: 0,
-          id: 4,
-        },
+          id: 1,
+        }
       ],
       selectItemId: "",
       operateIndex: null,
       operateData: {},
-      // 免发货
-      freeShipModal: false,
       classifyForm: {
         categoryId: "",
         usageId: "",
       },
       searchType:0,
-      searchTypeName:'客户',
+      searchTypeName:'名称',
       searchTime:'',
       startTime:'',
       endTime:''
@@ -144,14 +130,14 @@ export default {
     setSearchType(){
       let that = this
       uni.showActionSheet({
-        itemList: ['搜索类型:', '客户', '编号'],
+        itemList: ['搜索类型:', '名称', '编号'],
         success: function (respond) {
           let currentIndex = respond.tapIndex
           if(currentIndex == 0){
             return false
           }
           that.searchType = Number(currentIndex) - 1
-          that.searchTypeName = that.searchType == 0 ? '客户' : '编号'
+          that.searchTypeName = that.searchType == 0 ? '名称' : '编号'
           that.searchFn()
         }
       })
@@ -169,7 +155,7 @@ export default {
       this._list()
     },
     _list() {
-      return getListB({
+      return getWorkList({
         searchTime: this.searchTime,
         startTime: this.startTime,
         endTime: this.endTime,
@@ -182,11 +168,6 @@ export default {
         if (this.$util.isEmpty(res.data)){
           return false
         }
-        this.tabs[0].value = res.data.totalNum || 0;
-        this.tabs[1].value = res.data.shop.unPayOrder || 0;
-        this.tabs[2].value = res.data.shop.unSendOrder || 0;
-        this.tabs[3].value = res.data.shop.sendingOrder || 0;
-        this.tabs[4].value = res.data.shop.finishOrder || 0;
       });
     },
     change(e) {
@@ -198,10 +179,6 @@ export default {
         this._list();
       }
     },
-    // 关闭弹窗
-    modalCancel() {
-      this.freeShipModal = false;
-    },
     classifyOrder(id) {
       this.currentOrderId = id;
     },

+ 9 - 0
hdApp/src/api/work/index.js

@@ -0,0 +1,9 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const addWork = data => {
+	return https.get('/work/create', data)
+}
+
+export const getWorkList = data => {
+	return https.get('/work/list', data)
+}

+ 0 - 1
hdApp/src/store/modules/login.js

@@ -23,7 +23,6 @@ export default {
 			state.loginInfo.payPassword = payload
 		},
 		setDictionariesInfo(state, payload) {
-			console.log('payload',payload)
 			state.dictionariesInfo = payload
 		},
 		setMyShopInfo(state, payload) {