shish 3 лет назад
Родитель
Сommit
3eb6be2ad0

+ 1 - 1
hdApp/src/admin/goods/list.vue

@@ -151,7 +151,7 @@ export default {
       this.$msg('开发中')
     },
     getStockChange(item){
-      this.$util.pageTo({url: "/admin/goods/stockChange?id="+item.id})
+      this.$util.pageTo({url: "/admin/goods/stockChange?id="+item.id+'&name='+item.name})
     },
     goBottom(){
       if (!this.list.finished) {

+ 2 - 19
hdApp/src/admin/goods/stockChange.vue

@@ -49,21 +49,7 @@ export default {
      },
 	data() {
 		return {
-			isShow:false,
-			customizationTime:'',
-			menuTimeObj:'',
-			menuShopObj:'',
-			selectTimeId:'',
-			shopId:'',
-			itemId:'',
-			nowTime: "",
-			showTimeDropdown: false,
-			nowShop: "",
-			showShopDropdown: false,
-			dataList: [],
-			params:{
-				id: '',
-			},
+
 		};
 	},
 	onPullDownRefresh() {
@@ -73,12 +59,9 @@ export default {
 		});
 	},
 	onLoad(e) {
-		this.params.id = e.id
-
 		if(this.option.name){
 			uni.setNavigationBarTitle({ title: this.option.name+' 库存变动' })
 		}
-
 	},
 	onReachBottom() {
 		if (!this.list.finished) {
@@ -95,7 +78,7 @@ export default {
 			this.getChangeList();
 		},
 		getChangeList() {
-			return goodsStockChange({...this.params,page: this.list.page}).then(res => {
+			return goodsStockChange({id:this.option.id,page: this.list.page}).then(res => {
 				this.completes(res);
 			});
 		}

+ 21 - 26
hdApp/src/admin/order/workOrder.vue

@@ -6,16 +6,11 @@
 
        <view class="module-com input-line-wrap">
 
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">名称</view>
-          <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" @focus="form.name=''" placeholder="请填写" maxlength="50" type="text" />
-        </tui-list-cell>
-
         <tui-list-cell class="line-cell" :arrow="true">
-          <view class="tui-title">类</view>
-          <picker mode="selector" :value="form.catId" :range="plantClassData" range-key="categoryName" @change="changePlantClassFn" class="tui-input" >
-            <input v-model="form.catId" name="catId" type="text" hidden />
-            <view v-if="form.catId" style="height:45upx;" >{{ categorySelectedData.categoryName }}</view>
+          <view class="tui-title">种类</view>
+          <picker mode="selector" :value="form.kindId" :range="kindListData" range-key="name" @change="changeKindFn" class="tui-input" >
+            <input v-model="form.kindId" name="kindId" type="text" hidden />
+            <view v-if="form.kindId" style="height:45upx;" >{{ kindSelectedData.name }}</view>
             <view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
           </picker>
         </tui-list-cell>
@@ -83,7 +78,7 @@ import AppDeliveryModule from "@/components/app-delivery";
 import { createOrder } from "@/api/order";
 import { mapGetters } from "vuex";
 import { getUserDistance } from "@/api/express";
-import { getClass } from "@/api/category";
+import { getAllKind } from "@/api/kind";
 //图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
 import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
 export default {
@@ -101,8 +96,7 @@ export default {
         hasPay:1,
         payWay:0,
         sendCost:'',
-        catId:'',
-        name:"花束",
+        kindId:'',
         cover:[],
         num:1,
         flowerNum:''
@@ -110,8 +104,8 @@ export default {
       goodsPrice:'',
 			payWayindex:0,
 			payWayList:[{name:"本机微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
-      plantClassData:[],
-      categorySelectedData:{},
+      kindListData:[],
+      kindSelectedData:{},
       currentImgData:[],
       dj:''
     };
@@ -157,24 +151,24 @@ export default {
       this.form.cover.splice(index,1)
     },
     init() {
-      this.getPlantCategory()
+      this.getKindDataFn()
     },
-    async getPlantCategory() {
-      await getClass({flower:1}).then(res => {
+    async getKindDataFn() {
+      await getAllKind({flower:1}).then(res => {
         if (this.$util.isEmpty(res.data)){
           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}
+        this.kindListData = res.data.list ? res.data.list : []
+        if(this.kindListData && this.kindListData[0] && this.kindListData[0].id){
+          this.form.kindId = this.kindListData[0].id||''
+          let name = this.kindListData[0].name||''
+          this.kindSelectedData = {name}
         }
       });
     },
-    changePlantClassFn(e) {
-        this.categorySelectedData = this.plantClassData[e.detail.value];
-        this.form.catId = this.categorySelectedData.id;
+    changeKindFn(e) {
+        this.kindSelectedData = this.kindListData[e.detail.value];
+        this.form.kindId = this.kindSelectedData.id;
     },
 		payWayChange(e){
 			let index = e.detail.value
@@ -228,7 +222,8 @@ export default {
       // }
       that.$util.confirmModal({content:'确认提交?'},() => {
           uni.showLoading({mask:true})
-          createOrder({...that.form,unitGoodsPrice:this.goodsPrice,modifyPrice:modifyPrice,dj:this.dj}).then((res) => {
+          let name = that.kindSelectedData.name ? that.kindSelectedData.name : ''
+          createOrder({...that.form,unitGoodsPrice:this.goodsPrice,modifyPrice:modifyPrice,dj:this.dj,name:name}).then((res) => {
             uni.hideLoading()
             that.pageTo({url: '/admin/order/workOrderResult',type:2,query:{id:res.data.id}})
           })

+ 3 - 0
hdApp/src/admin/order/workOrderResult.vue

@@ -32,6 +32,9 @@ export default {
 		})
 	},
 	methods: {
+		init(){
+
+		},
 		goBackHome() {
 			uni.navigateBack({})
 		}

+ 4 - 0
hdApp/src/api/kind/index.js

@@ -2,4 +2,8 @@ import https from '@/plugins/luch-request_0.0.7/request'
 
 export const getKindList = data => {
 	return https.get('/kind/list', data)
+}
+
+export const getAllKind = data => {
+	return https.get('/kind/get-all-kind', data)
 }