diff --git a/pages/components/pages/business/add.vue b/pages/components/pages/business/add.vue
index ac44d86..0a8ce40 100644
--- a/pages/components/pages/business/add.vue
+++ b/pages/components/pages/business/add.vue
@@ -373,7 +373,7 @@
// if(selectList.value.length <= 0){
// uni.showToast({
// icon: 'error',
- // title: '请选择商品'
+ // title: '请选择产品'
// })
// return
@@ -384,7 +384,7 @@
// 修确认提交
const onSubmit = async () => {
- // 已选商品数据处理
+ // 已选产品数据处理
let newArr = []
selectList.value.forEach((item, index) => {
let obj = {}
diff --git a/pages/components/pages/business/businessDetails.vue b/pages/components/pages/business/businessDetails.vue
index c7e613a..a36060c 100644
--- a/pages/components/pages/business/businessDetails.vue
+++ b/pages/components/pages/business/businessDetails.vue
@@ -144,7 +144,7 @@
name: '跟进'
},
{
- name: '意向商品'
+ name: '意向产品'
},
{
name: '客户信息',
diff --git a/pages/components/pages/business/selectProduct.vue b/pages/components/pages/business/selectProduct.vue
index 26f6e7b..3be17e0 100644
--- a/pages/components/pages/business/selectProduct.vue
+++ b/pages/components/pages/business/selectProduct.vue
@@ -1,180 +1,180 @@
-
-
-
-
-
-
- {{title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.storeName}}
-
-
-
-
-
-
- 规格:{{item.sku}}
-
-
- 编号:{{item.id}}
-
-
- 库存:{{item.stock}}
- 价格:{{item.price}}
-
-
-
- 添加时间: {{formatDateTime(item.createTime)}}
-
- {{item.checked ? '取消':'选择'}}
-
-
-
-
-
-
-
-
-
-
-
- 查看已选
-
-
- 选好了
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+})
+
+
+// 选中一个
+const selectShowRef = ref()
+const onSelect = (val,i)=> {
+ if(!val.sku){
+ uni.showToast({
+ title: '请先选择产品规格',
+ icon: 'error',
+ duration: 2000
+ })
+
+ return
+ }
+ list.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = item.checked ? !item.checked : true
+ }
+ })
+ // 添加已选
+ if(list.value[i].checked == true) {
+ // 添加已选中
+ selectList.value.push(list.value[i])
+ } else {
+ // 删除取消选中
+ selectList.value.forEach((item,i) => {
+ if(item.id == val.id) {
+ selectList.value.splice(i, 1)
+ }
+ })
+ }
+
+ console.log('selectList:',selectList.value)
+}
+
+const selectSku = async(val,index) => {
+ thisIndex.value = index
+ skuList.value = await getProductsSku({id:val})
+ unref(selectShowRef).open()
+}
+
+const selectShowClose = () => {
+ unref(selectShowRef).close()
+}
+
+const selectedRef = ref()
+const selectedShow = () => {
+ unref(selectedRef).open()
+}
+
+const selectedClose = () => {
+ unref(selectedRef).close()
+}
+
+// 选择客户
+const onItem = (val,i) => {
+ skuList.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = true
+ } else {
+ item.checked = false
+ }
+ })
+
+ list.value[thisIndex.value].sku = val.sku
+ list.value[thisIndex.value].productAttrUnique = val.unique
+
+ selectShowClose()
+}
+
+//移除已选产品
+const remove = (val,index)=> {
+ list.value.forEach((i,index) => {
+ if(val.id == i.id) {
+ i.checked = false
+ }
+ })
+ selectList.value.splice(index, 1)
+}
+// 选好了
+const chosen = () => {
+ // 储存
+ main.SET_SELECT_PRODUCT(selectList.value)
+ uni.navigateBack();
+}
+
+// 页面数据
+const getProductList = async(isNextPage,pages) => {
+ await getProducts({
+ pageNo: page.value,
+ pageSize: pageSize.value,
+ storeName:keyword.value,
+ isShow: 1
+ }).then(res => {
+ if(res) {
+ res.list.forEach((item,index)=>{
+ //item.create_time = this.timeFormats(item.create_time)
+ item.checked = false
+ // 设置默认数据
+ item.nums = 1
+ item.remarks = ''
+ selectList.value.forEach((i,index) => {
+ if(i.id == item.id) {
+ item.checked = true
+ }
+ })
+ })
+ if (res.list.length < 10) {
+ listStatus.value = 'nomore'
+ }
+ if(res.list.length == 0) {
+ lastPage.value = true
+ }
+ // 第二页开始
+ if(isNextPage) {
+ list.value = list.value.concat(res.list)
+ return
+ }
+ list.value = res.list
+ }
+ })
+}
+// scroll 滚动记录
+const scroll = (e) => {
+ oldScrollTop.value = e.detail.scrollTop
+}
+
+
+// 滚动到底部
+const reachBottom = () => {
+ if(lastPage.value || listStatus.value == 'loading') return ;
+ this.listStatus = 'loading'
+ setTimeout(() => {
+ if(lastPage.value) return ;
+ getProductList(true,++page.value)
+ if(list.value.length >= 10) {
+ listStatus.value = 'loadmore'
+ }else {
+ listStatus.value = 'loading'
+ }
+ }, 1200)
+}
+// 点击搜索
+const onSearch = () => {
+ page.value = 1
+ getProductList()
+}
+
+
+
+
+
diff --git a/pages/components/pages/contract/add.vue b/pages/components/pages/contract/add.vue
index 1ff54e8..fdec133 100644
--- a/pages/components/pages/contract/add.vue
+++ b/pages/components/pages/contract/add.vue
@@ -1,481 +1,481 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 产品关联
-
- 选择产品
-
-
-
-
-
-
- 序号: {{index+1}}
-
-
-
- {{item.storeName ? item.storeName : item.name}}({{item.sku}})
-
- ¥
-
-
-
-
- 备注:
-
-
-
-
-
-
-
-
-
-
-
- 优惠率%:
-
-
-
- 总额:
-
-
-
- 确定提交
-
-
-
- 审核
-
-
- 拒绝
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+// 滚动到底部加载更多
+const reachBottom = () => {
+ if(lastPage.value || listStatus.value == 'loading') return
+ listStatus .value= 'loading'
+ setTimeout(() => {
+ getCustomerList(true,++page.value)
+ if(customerList.value.length >= 10) {
+ listStatus.value = 'loadmore';
+ }else{
+ listStatus.values = 'loading';
+ }
+ }, 1200)
+}
+
+const reachBottom3 = () => {
+ if(lastPage3.value || listStatus3.value == 'loading') return
+ listStatus3 .value= 'loading'
+ setTimeout(() => {
+ getUserList(true,++page3.value)
+ if(userList.value.length >= 10) {
+ listStatus3.value = 'loadmore';
+ }else{
+ listStatus3.values = 'loading';
+ }
+ }, 1200)
+}
+// 选择客户
+const onItem = async(val,i) => {
+ customerList.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = true
+ val.name=val.name?val.name:item.name;
+ } else {
+ item.checked = false
+ }
+ })
+ form.value.customerId = val.id
+ //customerId.value = val.id
+ form.value.customerName = val.name ? val.name : ''
+ //选择了客户 返回客户联系人
+ let data = await getContactsPage({customerId:val.id})
+ customerContacts.value = data.list
+ //根据客户查找商机
+ let data2 = await getBusinessPage({customerId:val.id})
+ businessList.value = data2.list
+ selectShowClose()
+}
+
+const selectShowRef2 = ref()
+const selectShow2 = () => {
+ unref(selectShowRef2).open()
+}
+const selectShowClose2 = () => {
+ unref(selectShowRef2).close()
+}
+
+const onItem2 = async(val,i) => {
+ customerContacts.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = true
+ val.name=val.name?val.name:item.name;
+ } else {
+ item.checked = false
+ }
+ })
+ form.value.contactsId = val.id
+ //customerId.value = val.id
+ form.value.contactsName = val.name ? val.name : ''
+ selectShowClose2()
+}
+
+
+const selectShowRef3 = ref()
+const selectShow3 = async() => {
+ unref(selectShowRef3).open()
+}
+const selectShowClose3 = () => {
+ unref(selectShowRef3).close()
+}
+
+const onItem3 = async(val,i) => {
+ userList.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = true
+ val.username=val.username?val.username:item.username;
+ } else {
+ item.checked = false
+ }
+ })
+ form.value.orderAdminId = val.id
+ //customerId.value = val.id
+ form.value.orderAdminName = val.username ? val.username : ''
+ selectShowClose3()
+}
+
+const selectShowRef4 = ref()
+const selectShow4 = async() => {
+ unref(selectShowRef4).open()
+}
+const selectShowClose4 = () => {
+ unref(selectShowRef4).close()
+}
+
+const onItem4 = async(val,i) => {
+ businessList.value.forEach((item,index) => {
+ if(val.id == item.id) {
+ item.checked = true
+ val.name=val.name?val.name:item.name;
+ } else {
+ item.checked = false
+ }
+ })
+ form.value.businessId = val.id
+ //customerId.value = val.id
+ form.value.businessName = val.name ? val.name : ''
+
+ selectList.value = await getBusinessProductListByBusinessId({businessId:val.id})
+
+ selectShowClose4()
+}
+
+const selectShowRef5 = ref()
+const selectShow5 = async() => {
+ unref(selectShowRef5).open()
+}
+const selectShowClose5 = () => {
+ unref(selectShowRef5).close()
+}
+
+// 产品数量增加
+const valChange = () =>{
+ count_price()
+}
+// 优惠率改变
+const inputChang =() => {
+ count_price()
+}
+// 移除已选产品
+const remove = (i) => {
+ selectList.value.splice(i, 1)
+ count_price()
+}
+// 计算价格
+const count_price = () => {
+ let total = 0;
+ setTimeout(() => {
+ for (let i = 0; i < selectList.value.length; i++) {
+ total += selectList.value[i].nums * selectList.value[i].price
+ }
+ if(form.value.discountRate > 0) {
+ total = total - (form.value.discountRate/100) * total
+ }
+ form.value.totalPrice = total.toFixed(2)
+ }, 500)
+
+}
+
+const submitCheck = async(type) => {
+ if(type == 2 && form2.value.remark == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请填写驳回理由'
+ })
+
+ return
+ }
+ form2.value.id = contractId.value
+ form2.value.type
+ await check(form2.value)
+
+ uni.showToast({
+ title: '审核成功',
+ icon: 'success',
+ duration: 2000
+ })
+ prePage().$vm.isRefresh = true
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1000);
+}
+
+// 提交跟进
+const uForm = ref()
+const submit = () => {
+ if(form.value.name == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请填写合同名称'
+ })
+
+ return
+ }
+ if(form.value.customerId == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请选择客户'
+ })
+
+ return
+ }
+
+ if(form.value.money == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请填写合同金额'
+ })
+
+ return
+ }
+
+ if(form.value.contactsName == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请选择客户签约人'
+ })
+
+ return
+ }
+ if(form.value.orderAdminIdName == ''){
+ uni.showToast({
+ icon: 'error',
+ title: '请选择公司签约人'
+ })
+
+ return
+ }
+
+ if(selectList.value.length <= 0){
+ uni.showToast({
+ icon: 'error',
+ title: '请选择产品'
+ })
+
+ return
+ }
+ onSubmit()
+
+}
+
+
+// 修确认提交
+const onSubmit = async() => {
+ let newArr = []
+ selectList.value.forEach((item,index)=>{
+ let obj = {}
+ obj.name = item.storeName ? item.storeName : item.name
+ obj.nums = item.nums
+ obj.price = item.price
+ obj.productAttrUnique = item.productAttrUnique
+ obj.productId = item.productId ? item.productId : item.id
+ obj.sku = item.sku
+ obj.remarks = item.remarks
+ obj.subtotal = item.nums * item.price
+ newArr[index] = obj
+ })
+ if(type.value == 'add'){
+
+ form.value.contractProducts = newArr
+ await createContract(form.value)
+
+ uni.showToast({
+ title: '添加成功',
+ icon: 'success',
+ duration: 2000
+ })
+ prePage().$vm.isRefresh = true
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1000);
+ }else{
+ // selectList.value.forEach((item,index)=>{
+ // item.subtotal = item.nums * item.price
+ // })
+ form.value.contractProducts = newArr
+ await updateContract(form.value)
+ uni.showToast({
+ title: '修改成功',
+ icon: 'success',
+ duration: 2000
+ })
+ prePage().$vm.isRefresh = true
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1000);
+ }
+
+}
+
+
+
+
+
diff --git a/pages/components/pages/product/detail.vue b/pages/components/pages/product/detail.vue
index 83b7c2f..8fe590f 100644
--- a/pages/components/pages/product/detail.vue
+++ b/pages/components/pages/product/detail.vue
@@ -4,7 +4,7 @@
- 商品详情
+ 产品详情
@@ -25,10 +25,6 @@
{{state.productInfo.cate_id}}
- 产品价格
-
- {{state.productInfo.price || 0}}
-
产品简介
{{state.productInfo.store_info || '暂无'}}
diff --git a/pages/components/pages/product/good-waterfall.vue b/pages/components/pages/product/good-waterfall.vue
index a56a099..00c1266 100644
--- a/pages/components/pages/product/good-waterfall.vue
+++ b/pages/components/pages/product/good-waterfall.vue
@@ -12,7 +12,7 @@
名称:{{ item.storeName }}
- 价格:{{ item.price }}
+
@@ -27,7 +27,7 @@
名称:{{ item.storeName }}
- 价格:{{ item.price }}
+
@@ -111,14 +111,14 @@
}
.info {
- padding: 10rpx 12rpx 20rpx 16rpx;
+ padding: 14rpx 16rpx 24rpx 16rpx;
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
- font-size: 28rpx;
+ font-size: 30rpx;
color: #333;
}
diff --git a/pages/components/pages/product/index.vue b/pages/components/pages/product/index.vue
index 657a0af..ebeb15e 100644
--- a/pages/components/pages/product/index.vue
+++ b/pages/components/pages/product/index.vue
@@ -9,7 +9,7 @@
-
@@ -52,7 +52,7 @@
storeToRefs
} from 'pinia'
const main = useMainStore()
- const title = ref('商品')
+ const title = ref('产品')
const keyword = ref('')
const listStatus = ref('loadmore')
const total = ref(-1)