Browse Source

修复部分bug

master
qb 9 months ago
parent
commit
5848261585
  1. 6
      compoment/BasicContainer/BasicContainer.vue
  2. 4
      compoment/MyDrawer/MyDrawer.vue
  3. 7
      compoment/PopUp/PopUp.vue
  4. 52
      compoment/ShowImgBox/ShowImgBox.vue
  5. 4
      config/host.js
  6. 4
      main.js
  7. 19
      pages.json
  8. 488
      pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue
  9. 10
      pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue
  10. 16
      pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue
  11. 15
      pagesHome/pages/addInfo/addInfo.vue
  12. 6
      pagesHome/pages/afterSalesDetails/afterSalesDetails.vue
  13. 167
      pagesHome/pages/checkAndAccept/checkAndAccept.vue
  14. 2
      pagesHome/pages/taskDetails/clientInfo.vue
  15. 14
      pagesHome/pages/taskDetails/nodeInfo.vue
  16. 14
      pagesHome/pages/taskDetails/serviceContent.vue
  17. 1526
      pagesUser/pages/InstallAfterSalesTaskList/InstallAfterSalesTaskList.vue
  18. 1503
      pagesUser/pages/InstallTaskList/InstallTaskList.vue

6
compoment/BasicContainer/BasicContainer.vue

@ -44,7 +44,9 @@
option: {
type: Object,
default: {
pageLoading: false
pageLoading: false,
/** 是否执行触底函数 */
haveReachBottom: true
}
},
title: {
@ -81,6 +83,8 @@
let antiShake : any = null
//
onReachBottom(() => {
if (props.option.haveReachBottom === false) return
// ,
if (props.option.isEnd) {
return uni.showToast({

4
compoment/MyDrawer/MyDrawer.vue

@ -220,7 +220,7 @@
.buttonContainer {
width: 100%;
padding: 20upx 0;
padding: 20upx 0 60upx;
flex: 1;
display: flex;
justify-content: space-around;
@ -228,7 +228,7 @@
zoom: 0.9;
>view {
padding: 20upx 80upx;
padding: 25upx 100upx;
border-radius: 10upx;
background: var(--subjectColor);
color: #fff;

7
compoment/PopUp/PopUp.vue

@ -116,17 +116,15 @@
.buttonContainer {
width: 100%;
// height: 12vh;
padding: 20upx 0;
padding: 20upx 0 60upx;
flex: 1;
display: flex;
justify-content: space-around;
align-items: center;
zoom: 0.9;
// padding: 20upx;
>view {
padding: 20upx 80upx;
padding: 25upx 100upx;
border-radius: 10upx;
background: var(--subjectColor);
color: #fff;
@ -135,7 +133,6 @@
.closeButton {
color: #000;
background: #F5F5F6;
// border: 2upx solid var(--subjectColor);
}
}

52
compoment/ShowImgBox/ShowImgBox.vue

@ -0,0 +1,52 @@
<template>
<!-- 蒙层 -->
<view v-if="modelValue" @click="modelValue = false" class="mask flex-c-c" @touchmove.stop>
<image :src="props.imgUrl" mode="widthFix"></image>
</view>
</template>
<script setup lang="ts">
import { defineProps, defineEmits, computed } from 'vue';
const props = defineProps({
//
modelValue: {
type: Boolean,
requird: true
},
//
imgUrl: {
type: String,
requird: true
}
})
const $emit = defineEmits(['update:modelValue'])
const modelValue = computed({
get() {
return props.modelValue
},
set(value) {
$emit('update:modelValue', value)
}
})
</script>
<style lang="scss" scoped>
@import url(@/utils/style/common.scss);
.mask {
position: fixed;
top: 0;
left: 0;
z-index: 99999;
background-color: rgba(0, 0, 0, 0.6);
width: 100vw;
height: 100vh;
image {
width: 100%;
}
}
</style>

4
config/host.js

@ -23,8 +23,8 @@
// cg
// const devhost = 'http://192.168.10.200:13000/'
// lg
const devhost = 'http://192.168.3.16:9922/'
// const devhost = 'http://192.168.5.34:9922/'
// const devhost = 'http://192.168.3.16:9922/'
const devhost = 'http://192.168.5.34:9922/'
/**
* 正式域名
* */

4
main.js

@ -34,8 +34,9 @@ import saomiao2 from '@/compoment/saomiao2.vue'
/** 输入框组件 */
import MyInput from '@/compoment/MyInput/MyInput.vue';
/** 抽屉组件 */
/** 输入框组件 */
import MyDrawer from '@/compoment/MyDrawer/MyDrawer';
/** 图片显示组件 */
import ShowImgBox from '@/compoment/ShowImgBox/ShowImgBox';
import utils from '@/utils/utils.js'
import Store from '@/store/index.js'
@ -62,6 +63,7 @@ export function createApp() {
.component('CheckBox', CheckBox)
.component('MyInput', MyInput)
.component('MyDrawer', MyDrawer)
.component('ShowImgBox', ShowImgBox)
uni.$u.config.unit = 'rpx'
return {

19
pages.json

@ -343,6 +343,25 @@
}
}
},
{
"path": "pages/ArrivalConfirmation/ArrivalConfirmation",
"style": {
"navigationBarTitleText": "指派",
"enablePullDownRefresh": true,
"onReachBottomDistance": 1,
"navigationStyle": "custom",
"app-plus": {
"animationDuration": 300,
"animationType": "zoom-fade-out",
"pullToRefresh": {
"support": true,
"color": "#d3832a", //
"style": "circle" //
}
}
}
}
]
},

488
pagesHome/pages/ArrivalConfirmation/ArrivalConfirmation.vue

@ -0,0 +1,488 @@
<template>
<BasicContainer ref="basicContainer" :option="option">
<!-- 头部 -->
<template #head></template>
<!-- 主体 -->
<template #body></template>
</BasicContainer>
<view class="">
<view class="main_container">
<!-- 到货信息 -->
<view class="info_item border_bottom">
<view class="info_item_title flex-c-sb" @click="details.popUpObj.afterSalesType = true">
<view class="">
</view>
</view>
</view>
<!-- -- 售后类型 -->
<view class="info_item border_bottom">
<view class="info_item_title flex-c-sb" @click="details.popUpObj.afterSalesType = true">
<view class="">
</view>
<view>
<text class="mr10 fwn info">
{{ installSales.status >= 3? '已到货':'未到货' }}
</text>
</view>
</view>
</view>
<!-- -- 售后类型 -->
<view class="info_item border_bottom">
<view class="info_item_title flex-c-sb">
<view class="">
</view>
<!-- 新增售后包件 -->
<view class="flex addBtn" @click="handleAddPackage">
<view class="addButton">
<u-icon name="close-circle" color="#2F8DFF" size="36"></u-icon>
</view>
<text class="ml10 fwn">
添加
</text>
</view>
</view>
</view>
<scroll-view class="scvmabx" :style="{height: details.scrollheight}" @scrolltolower="()=>{}" scroll-y="true"
@touchmove.stop>
<!-- 售后包件列表 -->
<view :class="{packageList: true, pd20: details.packageList.length > 0}"
:style="{height: (details.packageList.length > 0 ?(40 * details.packageList.length) + ((details.packageList.length - 1) * 10): 0) + 'px'}">
<block v-for="(item, index) in details.packageList">
<view :class="{'packageItem': true, 'flex-c-sb': true, 'mt20': index !== 0}">
<view class="inputBox flex1 flex">
<input class="packageInput flex1" v-model="details.packageList[index]" placeholder="请输入包条码" />
<view class="scanIcon flex-c-c" @click.stop="()=> handleScan(item)">
<u-icon name="scan" color="#2F8DFF" size="60"></u-icon>
</view>
</view>
<view class="ml20 flex-c-c" @click="()=> handleRemovePackage(index)">
<u-icon name="trash" color="#8792AA" size="36"></u-icon>
<text class="ml10 info">
删除
</text>
</view>
</view>
</block>
</view>
</scroll-view>
<view class="felx-c-c mb20">
<view class="button subColor" @click="handleArrivalNotice">
到货确认
</view>
</view>
</view>
<MyDrawer ref="myDrawer">
<template #content>
<picker-view v-if="details.visible" :indicator-style="details.indicatorStyle" :immediate-change="true"
:value="details.value" @change="bindChange" class="picker-view">
<picker-view-column>
<view class="item" v-for="(item, index) in details.pickerArr" :key="index">
{{ item.label }}
</view>
</picker-view-column>
</picker-view>
</template>
</MyDrawer>
</view>
<tips ref="tip" />
</template>
<script lang="ts" setup>
import {
postInstallAfterUpdate,
postCenterInstallSalesTheArrival
} from '@/api/user.js'
import {
onLoad,
onShow,
onHide,
} from '@dcloudio/uni-app'
import { nextTick, reactive, ref, toRefs, computed, defineExpose } from "vue";
import utils from '@/utils/utils.js'
import type { PropType } from 'vue';
//
const option = reactive({
//
title: '确认到货',
//
async pullDownRefreshInitPage() {
return null
},
//
reachBottomInitPage: async () => {
return null
},
haveData: true,
isEnd: false,
pageLoading: false,
haveReachBottom: false
})
const props = defineProps({
/** 页面路由数据 */
pageInfo: {
type: Object as PropType<Object>,
required: true,
},
/** 页面数据 */
info: {
type: Object as PropType<Object>,
required: true,
},
/** 开启loading */
handleSetLoading: {
type: Function as PropType<Function>,
required: true
},
/** 刷新数据 */
handleRefresh: {
type: Function as PropType<Function>,
required: true
},
/** */
})
const pageInfo = computed(() => {
console.log('props.pageInfo :>> ', props.pageInfo);
if (props.pageInfo) return props.pageInfo
else return {}
})
const installSales = computed(() => {
console.log('props.info :>> ', props.info);
if (props.info && props.info.installSales) return props.info.installSales
else return {}
})
const myDrawer = ref()
const tip = ref()
let details = reactive({
/** 主页面高度 */
scrollheight: '80vh',
/** 表单数据 */
form: {
type: '',
typeName: '',
/** 备注 */
remark: ''
},
/** 售后包件列表 */
packageList: [],
/** 售后图片列表 */
imgList: [],
/** 扫描码值 */
scancode: '',
/** 是否显示弹窗 */
popUpObj: {
/** 异常类型 */
afterSalesType: false
},
/** picker行高度 */
indicatorStyle: `height: 40px;`,
visible: false,
value: [0],
pickerArr: [
{
label: '调试',
value: '1'
},
{
label: '维修',
value: '2'
},
{
label: '理赔',
value: '3'
},
{
label: '待确认',
value: '4'
}, {
label: '换货',
value: '5'
},
{
label: '工厂补单',
value: '6'
},
],
/** 页面信息 */
pageInfo: {
id: ''
}
})
onLoad((e) => {
details.pageInfo.id = e.id
})
onShow(async () => {
// #ifdef APP
//
uni.$off('scancodedate')
// init()
uni.$on('scancodedate', function (code) {
console.log('code :>> ', code);
if (code) {
console.log(code);
details.scancode = code
scandata()
}
})
// #endif
await nextTick()
// basicContainer.value.startPullDownRefresh()
const _height = await utils.getViewDistanceFormTop('.scvmabx')
details.scrollheight = Number(_height.replace('px', '')) - 100 + 'px'
})
const scandata = () => { }
const initpage = () => { }
/** 显示扫描 */
const handleScan = (value) => {
console.log('value :>> ', value);
// #ifdef MP-WEIXIN
//
uni.scanCode({
success(res) {
console.log('res :>> ', res);
console.log('res.result :>> ', res.result);
for (let i = 0; i < details.packageList.length; i++) {
const value = details.packageList[i]
if (value === res.result) return utils.handleToast('码值已存在')
}
value = res.result
// scandata()
}
})
return
// #endif
}
/** 新增售后包件 */
const handleAddPackage = () => {
details.packageList.push('')
}
/** 删除售后包件 */
const handleRemovePackage = (index : number) => {
details.packageList.splice(index, 1)
}
/** picker切换时执行 */
const bindChange = function (e, type) {
console.log('type :>> ', type);
console.log('e :>> ', e);
details.value = e.detail.value
}
/** 到货 */
const handleArrivalNotice = () => {
// postCenterInstallSalesTheArrival
console.log('details.packageList :>> ', details.packageList);
tip.value.setdetails({
isshow: true,
content: '确认到货',
cancelTxt: '部分到货',
confirmTxt: '确认到货',
async success() {
try {
props.handleSetLoading(true)
const submitData = {
install_sales_id: pageInfo.value.id,
status: 0,
packages: details.packageList.filter(val => val)
}
const res = await postCenterInstallSalesTheArrival(submitData)
const { code, data } = res
if (code !== 200) return
props.handleRefresh()
} catch (err) {
console.log('err :>> ', err);
//TODO handle the exception
} finally {
props.handleSetLoading(false)
//
tip.value.setdetails({ isshow: false })
}
},
cancel() {
//
tip.value.setdetails({ isshow: false })
}
})
}
defineExpose({ details })
</script>
<style lang="scss" scoped>
@import url("@/utils/style/common.scss");
.info {
color: #AFB4BA;
}
.main_container {
// padding: 0 20upx;
background-color: #fff;
}
//
.info_item {
margin: 0 20upx;
padding: 20upx;
.info_item_title {
// padding: 0 0 20upx;
font-weight: bold;
height: 40upx;
line-height: 40upx;
}
&.border_bottom {
border-bottom: 2upx solid #eee;
}
:deep(.u-textarea) {
background-color: #f5f5f6;
border: none;
height: 200upx;
}
//
.addBtn {
color: #2F8DFF;
.addButton {
transform: rotate(45deg);
}
}
}
//
.packageList {
background: #f5f5f6;
transition: all 0.3s;
overflow: hidden;
.packageItem {
$inputHeight: 80upx;
.inputBox {
position: relative;
border-radius: calc($inputHeight / 2);
overflow: hidden;
background: #fff;
.packageInput {
height: $inputHeight;
padding: 0 40upx;
}
.scanIcon {
padding: 0 20upx;
// position: absolute;
// right: 40upx;
// top: 50%;
// transform: translateY(-50%);
}
}
}
}
//
.imgList {
flex-wrap: wrap;
.image_conatiner {
position: relative;
.removeIcon {
position: absolute;
top: 0;
right: 0;
transform: translate(40%, -40%);
opacity: 0.9;
}
}
.addImg {
width: 160upx;
height: 160upx;
border-radius: 20upx;
box-sizing: border-box;
border: 2upx solid #eee;
}
image {
width: 160upx;
height: 160upx;
border-radius: 20upx;
}
}
.button {
height: 80upx;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
// margin: 10upx;
// border: 2upx solid #b5babf;
border-radius: 80upx;
margin: 0 10upx;
padding: 0 10upx;
// font-size: 0.75rem;
&.subColor {
background-color: var(--subjectColor);
color: #fff;
}
}
</style>

10
pagesHome/pages/InitiateAfterSalesService/InitiateAfterSalesService.vue

@ -405,11 +405,11 @@
try {
option.pageLoading = true
const submitData = { type: details.form.type, install_id: details.pageInfo.id, remark: details.form.remark, images: details.imgList }
// for (let i = 0; i < details.packageList.length; i++) {
// const _item = details.packageList[i]
// _item && submitData.images.push(_item)
// }
const submitData = { type: details.form.type, install_id: details.pageInfo.id, remark: details.form.remark, images: details.imgList, packages: [] }
for (let i = 0; i < details.packageList.length; i++) {
const _item = details.packageList[i]
_item.code && submitData.packages.push(_item.code)
}
const res = await postInstallAfterSales(submitData)

16
pagesHome/pages/ParticularsOfCompletion/ParticularsOfCompletion.vue

@ -269,12 +269,18 @@
// // #endif
await nextTick()
initpage()
// basicContainer.value.startPullDownRefresh()
const _height = await utils.getViewDistanceFormTop('.scvmabx')
details.scrollheight = Number(_height.replace('px', '')) - 100 + 'px'
})
onLoad(async (e) => {
details.pageInfo.install_id = e.id
await initpage()
// basicContainer.value.startPullDownRefresh()
await nextTick()
if (utils.getObjType(imgPullDownRefList.value) !== 'array') return
for (let i = 0; i < imgPullDownRefList.value.length; i++) {
@ -283,10 +289,6 @@
}
})
onLoad((e) => {
details.pageInfo.install_id = e.id
})
const scandata = () => { }
const initpage = async () => {

15
pagesHome/pages/addInfo/addInfo.vue

@ -84,11 +84,16 @@
</view>
</view>
<!-- 站位容器 -->
<!-- 提交按钮 -->
<view class="submitButton" @click="handleSubmit">
</view>
</view>
<view class="footer_container">
</view>
</template>
</BasicContainer>
@ -144,7 +149,8 @@
const option = reactive({
title: '添加信息',
haveData: true,
pageLoading: false
pageLoading: false,
haveReachBottom: false
})
const details = reactive({
@ -667,8 +673,13 @@
color: #fff;
border-radius: 60upx;
position: fixed;
bottom: 10upx;
bottom: 60upx;
left: 50%;
transform: translateX(-50%);
}
//
.footer_container {
height: 140upx;
}
</style>

6
pagesHome/pages/afterSalesDetails/afterSalesDetails.vue

@ -87,9 +87,9 @@
确认完工
</view>
<!-- <view class="button errColor" @click="handleConfirmCompletion">
驳回
</view> -->
<view class="button primaryColor" @click="handleConfirmCompletion">
确认到货
</view>
<view class="button primaryColor" v-if="details.buttonPermissionObj.confirmSignfor"
@click="handleCheckAndAccept">

167
pagesHome/pages/checkAndAccept/checkAndAccept.vue

@ -98,6 +98,31 @@
<PopUp ref="checkPopUpRef">
<view class="pd20 mt20 row">
<!-- 验收图片 -->
<view class="mb20">
验收图片
</view>
<view class="flex imgList mb20">
<!-- 单个图片 -->
<block v-for="(item, index) in details.checkAndAcceptImgList" :key="item">
<view class="image_conatiner mr20 pd20">
<image :src="item.url" mode=""></image>
<!-- 删除 -->
<view class="removeIcon" @click="()=> handleRmove(index)">
<u-icon name="close-circle-fill" color="#666" size="50"></u-icon>
</view>
</view>
</block>
<!-- 添加图片 -->
<view class="image_conatiner addImg flex-c-c" @click="handleUploadFile">
<u-icon name="photo-fill" color="#999" size="100"></u-icon>
</view>
</view>
<!-- 备注 -->
<view class="mb20">验收备注</view>
<u-textarea v-model="details.form.reason" placeholder="请输入"></u-textarea>
@ -192,6 +217,8 @@
],
imgList: [],
renderArr: [],
/** 验收图片 */
checkAndAcceptImgList: []
})
//
@ -255,6 +282,7 @@
const scandata = () => { }
/** 初始化获取数据 */
const initpage = async () => {
try {
option.pageLoading = true
@ -317,6 +345,46 @@
}
}
/** 上传验收图片 */
/** 上传文件 */
const handleUploadFile = () => {
const successByUpload = (res) => {
console.log('res :>> ', res);
const { data } = res
const _data = JSON.parse(data)
console.log('_data :>> ', _data);
const { code, data: img } = _data
details.checkAndAcceptImgList.push({ url: img, name: img })
}
utils.handleUploadFile({
successByUpload
})
}
/** 移除图片 */
const handleRmove = (index) => {
tip.value.setdetails({
isshow: true,
content: '确认移除',
cancelTxt: '取消',
confirmTxt: '确认',
success() {
details.imgList.splice(index, 1)
//
tip.value.setdetails({ isshow: false })
},
cancel() {
//
tip.value.setdetails({ isshow: false })
}
})
}
/**
* 提交
* @param {number} result 结果 1 -- 通过, 0 -- 驳回
@ -328,6 +396,7 @@
showPopUp: true,
title: '确认' + (result === 0 ? '驳回' : '通过'),
async success() {
if (result === 0 && details.checkAndAcceptImgList.length === 0) return utils.handleToast('最少上传一张驳回图片')
if (result === 0 && !details.form.reason) return utils.handleToast('请输入驳回原因')
try {
@ -341,9 +410,12 @@
install_id ?: string
// id
install_sales_id ?: string
//
images : { url : string, name : string }[]
} = {
result,
reason: details.form.reason,
images: details.checkAndAcceptImgList
}
details.pageType === 'install'
@ -372,58 +444,6 @@
}
},
})
// tip.value.setdetails({
// isshow: true,
// content: '' + (result === 0 ? '' : ''),
// cancelTxt: ' ',
// confirmTxt: ' ',
// async success() {
// try {
// option.pageLoading = true
// const submitData : {
// //
// result : number
// //
// reason : string
// // id
// install_id ?: string
// // id
// install_sales_id ?: string
// } = {
// result,
// reason: details.form.reason,
// }
// details.pageType === 'install'
// ? (submitData.install_id = details.pageInfo.install_id)
// : (submitData.install_sales_id = details.pageInfo.install_sales_id)
// const res =
// details.pageType === 'install'
// ? //
// await postInstallAcceptance(submitData)
// : //
// await postInstallSalesAcceptance(submitData)
// const { code, data } = res
// if (code !== 200) return
// uni.navigateBack()
// } catch (err) {
// console.log('err :>> ', err)
// //TODO handle the exception
// } finally {
// option.pageLoading = false
// //
// tip.value.setdetails({ isshow: false })
// }
// },
// cancel() {
// tip.value.setdetails({ isshow: false })
// },
// })
}
</script>
@ -477,15 +497,46 @@
}
//
.imgList {
flex-wrap: wrap;
// .imgList {
// flex-wrap: wrap;
// image {
// width: 160upx;
// height: 160upx;
// border-radius: 20upx;
// }
// }
}
image {
width: 160upx;
height: 160upx;
border-radius: 20upx;
//
.imgList {
flex-wrap: wrap;
.image_conatiner {
position: relative;
.removeIcon {
position: absolute;
top: 0;
right: 0;
transform: translate(40%, -40%);
opacity: 0.9;
}
}
.addImg {
width: 160upx;
height: 160upx;
border-radius: 20upx;
box-sizing: border-box;
border: 2upx solid #eee;
}
image {
width: 160upx;
height: 160upx;
border-radius: 20upx;
}
}
//

2
pagesHome/pages/taskDetails/clientInfo.vue

@ -144,7 +144,7 @@
/** 打电话 */
const handleCallPhone = () => {
uni.makePhoneCall({
phoneNumber: '13208366016'
phoneNumber: info.value.tel
})
}
</script>

14
pagesHome/pages/taskDetails/nodeInfo.vue

@ -32,6 +32,14 @@
<view class="time" v-if="item.remark">
{{item.remark}}
</view>
<view v-if="item.images && item.images.length > 0" class="mt10 flex flex-wrap">
<block v-for="val in item.images">
<view class="pd10">
<image :src="val.url" mode=""></image>
</view>
</block>
</view>
</view>
</view>
</block>
@ -123,4 +131,10 @@
}
}
}
image {
width: 160upx;
height: 160upx;
border-radius: 10upx;
}
</style>

14
pagesHome/pages/taskDetails/serviceContent.vue

@ -97,7 +97,7 @@
<view class="title">图片</view>
<view class="mt10 flex flex-wrap">
<block v-for="item in value.images">
<view class="mb20 mr20">
<view class="mb20 mr20" @click="()=> handleShowImg(item)">
<image :src="item.url" mode=""></image>
</view>
</block>
@ -111,6 +111,8 @@
</PullDownBox>
</view>
</block>
<ShowImgBox v-model="details.showImg" :imgUrl="details.showImgUrl" />
</view>
</template>
@ -227,6 +229,11 @@
} else return []
})
const details = reactive({
showImg: false,
showImgUrl: ''
})
/** 新增服务内容 */
const handleAdd = item => {
console.log('item :>> ', item)
@ -251,6 +258,11 @@
props.pageInfo.id,
})
}
const handleShowImg = (item) => {
details.showImg = true
details.showImgUrl = item.url
}
</script>
<style scoped lang="scss">

1526
pagesUser/pages/InstallAfterSalesTaskList/InstallAfterSalesTaskList.vue

File diff suppressed because it is too large Load Diff

1503
pagesUser/pages/InstallTaskList/InstallTaskList.vue

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save