Commit f44a64fd by 李伟康

commit 增加车型

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