|
|
@@ -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}})
|
|
|
})
|