Commit f44a64fd by 李伟康

commit 增加车型

1 parent 8fe36f42
...@@ -113,7 +113,6 @@ ...@@ -113,7 +113,6 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import env from '../../../env'
export default { export default {
props: { props: {
views: Array, views: Array,
...@@ -158,10 +157,8 @@ export default { ...@@ -158,10 +157,8 @@ export default {
} }
}, },
mounted () { mounted () {
let userInfo = uni.$storage.get('userInfo') let userInfo = uni.$storage.get('userInfo')
uni.$api.commonApi.getMerchantCarBrandList([userInfo.shopMerchantId]).then(({ data }) => { uni.$api.commonApi.getMerchantCarBrandList([userInfo.shopMerchantId]).then(({ data }) => {
console.log(data, '123')
let list = data[0].carBrandList, let list = data[0].carBrandList,
carBrandList = [] carBrandList = []
list.map(e => { list.map(e => {
...@@ -193,7 +190,6 @@ export default { ...@@ -193,7 +190,6 @@ export default {
this.carlist = res this.carlist = res
this.$refs.carBoxVisible.open() this.$refs.carBoxVisible.open()
}).catch(() => uni.hideLoading()) }).catch(() => uni.hideLoading())
}, },
handleSelect (item, popkey) { handleSelect (item, popkey) {
this.$refs[popkey].close() this.$refs[popkey].close()
......
...@@ -95,11 +95,29 @@ ...@@ -95,11 +95,29 @@
confirmBtnText="是" confirmBtnText="是"
></MessageBox> ></MessageBox>
<MessageBox <MessageBox
ref="carBrandListVisible"
position="bottom"
:isFooter="false"
title="请选择车品牌"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked:carBrand == item.name }"
@click="selectCar(item)"
v-for="(item, index) in carBrandList"
:key="index"
>
{{ item.name }}
</view>
</view>
</MessageBox>
<MessageBox
ref="carBoxVisible" ref="carBoxVisible"
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="请选择车型" title="请选择车型"
@cancel="carBoxVisible = false" :maxHeight="1000"
> >
<view class="select-box"> <view class="select-box">
<view <view
...@@ -153,7 +171,6 @@ const INFO_LIST = [ ...@@ -153,7 +171,6 @@ const INFO_LIST = [
}, },
]; ];
import myClick from "@/mixin/click"; import myClick from "@/mixin/click";
import env from "../../env";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
export default { export default {
mixins: [myClick], mixins: [myClick],
...@@ -179,7 +196,7 @@ export default { ...@@ -179,7 +196,7 @@ export default {
label: "车型", label: "车型",
key: "carModel", key: "carModel",
type: "select", type: "select",
popKey: "carBoxVisible", popKey: "carBrandListVisible",
}, },
{ {
label: "销售姓名", label: "销售姓名",
...@@ -195,15 +212,14 @@ export default { ...@@ -195,15 +212,14 @@ export default {
salesUuid: "", salesUuid: "",
staffName: "", staffName: "",
}, },
carBoxVisible: false,
previewImg: "", previewImg: "",
isPass: false, isPass: false,
carBoxVisible: false,
employeeBoxVisible: false,
carlist: [], carlist: [],
employeeList: [], employeeList: [],
f_key: Date.now(), f_key: Date.now(),
errorTip: false, errorTip: false,
carBrand: '',
carBrandList: []
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -250,14 +266,17 @@ export default { ...@@ -250,14 +266,17 @@ export default {
this.infoList = INFO_LIST.map((item) => delete item.imgUrl); this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
} else { } else {
let userInfo = uni.$storage.get("userInfo"); let userInfo = uni.$storage.get("userInfo");
uni.$api.commonApi uni.$api.commonApi.getMerchantCarBrandList([userInfo.shopMerchantId]).then(({ data }) => {
.getCarBrandsList({ let list = data[0].carBrandList,
brandId: env.index == 3 ? 2365 : 2978, carBrandList = []
childBrandId: env.index == 3 ? 2695 : 3454, list.map(e => {
e.childs.map(i => {
i.brandId = e.id
carBrandList.push(i)
})
})
this.carBrandList = carBrandList
}) })
.then((res) => {
this.carlist = res;
});
uni.$api.commonApi uni.$api.commonApi
.getEmployeeList({ .getEmployeeList({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
...@@ -319,7 +338,10 @@ export default { ...@@ -319,7 +338,10 @@ export default {
if (popkey == "employeeBoxVisible") { if (popkey == "employeeBoxVisible") {
this.formData.salesUuid = item.uuid; this.formData.salesUuid = item.uuid;
this.formData.staffName = item.staffName; this.formData.staffName = item.staffName;
} else this.formData.carModel = item.name; } else {
this.$refs.carBrandListVisible.close()
this.formData.carModel = item.name;
}
this.$store.dispatch("setCustomerInfo", this.formData); this.$store.dispatch("setCustomerInfo", this.formData);
console.log(this.formData); console.log(this.formData);
this.formObject.map((item) => (item.error = false)); this.formObject.map((item) => (item.error = false));
...@@ -335,6 +357,18 @@ export default { ...@@ -335,6 +357,18 @@ export default {
this.f_key = Date.now(); this.f_key = Date.now();
this.errorTip = false; this.errorTip = false;
}, },
selectCar (e) {
uni.showLoading()
this.carBrand = e.name
uni.$api.commonApi.getCarBrandsList({
brandId: e.brandId,
childBrandId: e.id
}).then(res => {
uni.hideLoading()
this.carlist = res
this.$refs.carBoxVisible.open()
}).catch(() => uni.hideLoading())
},
}, },
}; };
</script> </script>
...@@ -506,7 +540,8 @@ export default { ...@@ -506,7 +540,8 @@ export default {
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 20rpx; gap: 20rpx;
overflow-y: scroll; overflow-y: scroll;
height: 100%; max-height: 50vh;
padding-bottom: 60rpx;
.select-item { .select-item {
text-align: center; text-align: center;
height: 68rpx; height: 68rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!