xiaohaizhao 4 месяцев назад
Родитель
Сommit
2011e396b7

+ 12 - 0
pages.json

@@ -47,6 +47,18 @@
 			"style": {
 				"navigationBarTitleText": "选择配件"
 			}
+		},
+		{
+			"path": "pages/generalServices/index",
+			"style": {
+				"navigationBarTitleText": "待受理"
+			}
+		},
+		{
+			"path": "pages/generalServices/detail",
+			"style": {
+				"navigationBarTitleText": "服务申请单详情"
+			}
 		}
 	],
 	"globalStyle": {

+ 272 - 0
pages/generalServices/detail.vue

@@ -0,0 +1,272 @@
+<template>
+    <view class="main" v-if="time">
+        <view class="billno" style="margin-bottom: -24rpx;">
+            服务单编号:{{ detail.billno }}
+        </view>
+        <view class="row">
+            <view class="label col-center">服务类型</view>
+            <view class="servicetype" :style="{
+                'background': { '安装': '#E8F8D5', '维修': '#FFE2E5', '清洁': '#E2EBFF', '清洗': '#E2EBFF' }[detail.servicetype] || '#F0F0F0',
+                'color': { '安装': '#4B8E00', '维修': '#B00016', '清洁': '#2A5AD9', '清洗': '#2A5AD9' }[detail.servicetype] || '#333333'
+            }">
+                {{ detail.servicetype || '--' }}</view>
+        </view>
+        <view class="row">
+            <view class="label">产品品类</view>
+            <view class="value">{{ detail.class1 || '--' }}</view>
+        </view>
+        <view class="row" v-if="detail.servicetype == '维修'">
+            <view class="label">故障类型</view>
+            <view class="value">{{ detail.class2 || '--' }}</view>
+        </view>
+        <view class="row">
+            <view class="label">服务地址</view>
+            <view class="value">{{ detail.province + detail.city + detail.county + detail.address || '--' }}</view>
+        </view>
+        <view class="row" style="align-items: center;">
+            <view class="label justify">联系人</view>
+            <view class="value phonenumber">{{ detail.scenecontact || '--' }}
+                <block v-if="detail.scenecontactphonenumber">
+                    <text style="margin: 0 20rpx 0 10rpx;">
+                        {{ detail.scenecontactphonenumber }}
+                    </text>
+                    <My-button :customStyle="{
+                        width: '142rpx',
+                        height: '48rpx',
+                        'background-color': '#FFFFFF',
+                        'color': '#3874F6',
+                        borderRadius: '10rpx'
+                    }" :frontIconStyle="{
+                        marginRight: '6rpx',
+                    }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="detail.scenecontactphonenumber" />
+                </block>
+            </view>
+        </view>
+        <view class="row">
+            <view class="label">派单日期</view>
+            <view class="value">{{ detail.createdate || '--' }}</view>
+        </view>
+        <view class="row">
+            <view class="label">服务需求</view>
+            <view class="value">{{ detail.remarks || '--' }}</view>
+        </view>
+        <view class="transition">
+            <up-divider />
+            <view class="row" v-if="detail.enterprisename">
+                <view class="label justify">销售商</view>
+                <view class="value">{{ detail.enterprisename || '--' }}</view>
+            </view>
+            <view class="row" v-if="detail.sku">
+                <view class="label justify">序列号</view>
+                <view class="value">{{ detail.sku || '--' }}</view>
+            </view>
+            <view class="row" v-if="detail.itemname">
+                <view class="label">产品品名</view>
+                <view class="value">{{ detail.itemname || '--' }}</view>
+            </view>
+            <view class="row" v-if="detail.itemno">
+                <view class="label">产品编号</view>
+                <view class="value">{{ detail.itemno || '--' }}</view>
+            </view>
+            <view class="row" v-if="detail.model">
+                <view class="label">产品型号</view>
+                <view class="value">{{ detail.model || '--' }}</view>
+            </view>
+            <view class="row" v-if="detail.name || detail.phonenumber" style="align-items: center;">
+                <view class="label justify">客户信息</view>
+                <view class="value phonenumber">{{ detail.name || '' }}
+                    <block v-if="detail.phonenumber">
+                        <text style="margin: 0 20rpx 0 10rpx;">
+                            {{ detail.phonenumber }}
+                        </text>
+                        <My-button :customStyle="{
+                            width: '142rpx',
+                            height: '48rpx',
+                            'background-color': '#FFFFFF',
+                            'color': '#3874F6',
+                            borderRadius: '10rpx'
+                        }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="detail.phonenumber" />
+                    </block>
+                </view>
+            </view>
+            <view class="row" v-if="detail.servicetype !== '安装' && detail.cardno">
+                <view class="label">保修信息</view>
+                <view class="value">
+                    <text :style="{ color: detail.inqualityguaranteeperiod ? '#70B603' : '#D9001B' }"
+                        style="margin-right: 0rpx;">
+                        {{ detail.inqualityguaranteeperiod ? '在保' : '已过保' }}
+                    </text>
+                    {{ detail.cardno || '' }}
+                    <view v-if="detail.cardno && detail.cardbegdate" style="margin-top: 20rpx;">
+                        {{ detail.cardbegdate || '' }} - {{ detail.cardenddate || '' }}
+                    </view>
+                </view>
+            </view>
+        </view>
+        <!-- 底部按钮 -->
+        <view class="but-box">
+            <view class="but-box-item">
+                <My-button :customStyle="{
+                    'background-color': '#FFFFFF',
+                    'color': '#3874F6',
+                }" text="拒绝受理" />
+            </view>
+            <view class="but-box-item">
+                <My-button text="转工单" />
+            </view>
+        </view>
+    </view>
+    <view style="height: 50px;" />
+</template>
+
+<script setup>
+import { ref, reactive, getCurrentInstance } from 'vue';
+const { $Http } = getCurrentInstance().proxy;
+import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
+
+let sa_serviceorderid = 0;
+onLoad((options) => {
+    sa_serviceorderid = options.id;
+});
+
+onShow(() => {
+    getDetail()
+})
+
+let detail = reactive({
+    itemsText: [],
+    servicetype: ""
+}),
+    time = ref(new Date().getTime());
+
+function getDetail() {
+    $Http.basic({ "id": "20230206091603", "content": { "nocache": true, sa_serviceorderid } }).then(res => {
+        console.log("服务申请单详情", res)
+        if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
+        detail = reactive(res.data);
+        time.value = new Date().getTime();
+        console.log("detail", detail)
+    })
+}
+
+defineExpose({ detail })
+</script>
+
+<style lang="scss" scoped>
+.main {
+    position: relative;
+    width: 690rpx;
+    background: #FFFFFF;
+    box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 40rpx;
+    margin: 40rpx auto 0;
+    overflow: hidden;
+
+    .changeTransition {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        color: #3874F6;
+        font-size: 28rpx;
+        position: absolute;
+        bottom: 0;
+        left: 0;
+        width: 100%;
+        height: 60rpx;
+        background: #EDF4FF;
+
+        .icon-dianjizhankai {
+            font-size: 20rpx;
+            margin-left: 16rpx;
+            transform: rotate(-90deg);
+            transition: transform 0.3s ease;
+        }
+
+        .shrink {
+            transform: rotate(90deg);
+        }
+    }
+
+    .row {
+        display: flex;
+        font-size: 28rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        line-height: 32rpx;
+        margin-top: 20rpx;
+
+        .label {
+            position: relative;
+            width: 108rpx;
+            color: #999999;
+            box-sizing: border-box;
+            flex-shrink: 0;
+            margin-right: 30rpx;
+            white-space: nowrap;
+        }
+
+        .label::after {
+            position: absolute;
+            top: 0;
+            right: -12rpx;
+            content: ':';
+        }
+
+        .value {
+            color: #333333;
+        }
+
+        .phonenumber {
+            width: 100%;
+            display: flex;
+            align-items: center;
+        }
+
+        .servicetype {
+            border-radius: 8rpx;
+            padding: 8rpx 16rpx;
+            font-weight: bold;
+        }
+    }
+
+    .col-center {
+        display: flex;
+        align-items: center;
+    }
+
+    .col-center::after {
+        top: 50% !important;
+        transform: translateY(-50%);
+    }
+
+    .justify {
+        text-align: justify;
+        text-align-last: justify;
+    }
+
+    .billno {
+        position: relative;
+        width: 400rpx;
+        top: -40rpx;
+        left: -40rpx;
+        background: #3874F6;
+        border-radius: 0 0rpx 24rpx 0rpx;
+        padding: 10rpx 52rpx 10rpx 20rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 26rpx;
+        color: #FFFFFF;
+    }
+}
+
+.but-box {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    margin-top: 40rpx;
+
+    .but-box-item {
+        width: 45%;
+    }
+}
+</style>

+ 154 - 0
pages/generalServices/index.vue

@@ -0,0 +1,154 @@
+<template>
+    <My_listbox ref="listBox" :empty="!list.length" @getlist="getList">
+        <view style="height: 18rpx;" />
+        <navigator class="item" v-for="item in list" :key="item.sa_serviceorderid"
+            :url="'/pages/generalServices/detail?id=' + item.sa_serviceorderid" hover-class="navigator-hover">
+            <view class="head">
+                <view class="tag" :style="{
+                    'background': { '安装': '#E8F8D5', '维修': '#FFE2E5', '清洁': '#E2EBFF', '清洗': '#E2EBFF' }[item.servicetype] || '#F0F0F0',
+                    'color': { '安装': '#4B8E00', '维修': '#B00016', '清洁': '#2A5AD9', '清洗': '#2A5AD9' }[item.servicetype] || '#333333'
+                }">
+                    {{ item.servicetype }}
+                </view>
+                <view class="time">
+                    {{ item.createdate }}
+                </view>
+            </view>
+            <view class="address">
+                产品:{{ item.itemname }}
+            </view>
+            <view class="address">
+                型号:{{ item.model }}
+            </view>
+            <view class="address">
+                备注:{{ item.remarks || '--' }}
+            </view>
+            <view class="address">
+                地址:{{ item.county + item.address }}
+            </view>
+            <view class="user">
+                {{ item.name + ' ' + item.phonenumber }}
+            </view>
+            <view class="but-box" @click.stop>
+                <view class="but-box-item">
+                    <My-button :customStyle="{
+                        'background-color': '#FFFFFF',
+                        'color': '#3874F6',
+                        height: '70rpx',
+                    }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="item.phonenumber" />
+                </view>
+            </view>
+        </navigator>
+    </My_listbox>
+</template>
+
+<script setup>
+import { ref, reactive, getCurrentInstance } from 'vue';
+const { $Http } = getCurrentInstance().proxy;
+import { onLoad, onShow } from '@dcloudio/uni-app';
+
+const listBox = ref(null);
+const content = reactive({
+    "nocache": true,
+    loading: false,
+    isadmin: 0,
+    "pageNumber": 1,
+    "pageSize": 20,
+    "where": {
+        "status": '待受理',
+        "condition": ""
+    }
+});
+const list = ref([])
+
+onLoad((options) => {
+    getList();
+});
+
+onShow(() => {
+    if (content.pageNumber != 1) $Http.updateList(content, getList)
+})
+
+function getList(init = false) {
+    if (content.loading) return;
+    if (init) content.pageNumber = 1;
+    content.loading = true;
+    $Http.basic({
+        "id": "20230206101303",
+        content
+    }).then(res => {
+        console.log("获取列表", res)
+        content.loading = false;
+        listBox.value.refreshToComplete();
+        listBox.value.setHeight();
+        if (res.code == 1) {
+            list.value = reactive(res.firstPage ? res.data : list.value.concat(res.data));
+            content.pageTotal = res.pageTotal;
+            content.pageNumber = res.pageNumber;
+        } else {
+            if (res.msg) uni.showToast({
+                title: res.msg,
+                icon: 'none'
+            });
+        }
+    })
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    width: 690rpx;
+    background: #FFFFFF;
+    box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    margin: 0 auto 20rpx;
+    padding: 20rpx 40rpx;
+    box-sizing: border-box;
+    border-radius: 16rpx;
+
+    .head {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .tag {
+            font-family: PingFang SC, PingFang SC;
+            font-size: 24rpx;
+            padding: 8rpx 20rpx;
+            border-radius: 8rpx;
+        }
+
+        .time {
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-size: 24rpx;
+            color: #999999;
+        }
+    }
+
+    .address {
+        line-height: 38rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 28rpx;
+        color: #333333;
+        margin-top: 20rpx;
+    }
+
+    .user {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+        margin-top: 20rpx;
+    }
+
+    .but-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+        margin-top: 20rpx;
+
+        .but-box-item {
+            width: 40%;
+        }
+    }
+}
+</style>

+ 34 - 24
pages/index/home.vue

@@ -31,7 +31,6 @@
 <script setup>
 import { ref, getCurrentInstance, computed } from 'vue'
 import { onLoad, onShow } from '@dcloudio/uni-app';
-import { promise } from '../../uni_modules/uview-plus/libs/function/test';
 const { $Http } = getCurrentInstance().proxy;
 const banner = ref([]);
 const enterprisename = ref('');
@@ -56,8 +55,39 @@ function getTimeGreeting() {
 		return '晚上好';
 	}
 }
+const itemList = ref([{
+	label: '抢单中心',
+	icon: '/static/image/djd.png',
+	text: "专业守护",
+	path: "/pages/workOrder/snatchingOrders",
+}, {
+	label: '待接单',
+	icon: '/static/image/djd.png',
+	text: "故障维修排除",
+	path: "/pages/workOrder/index?type=待接单",
+}, {
+	label: '进行中',
+	icon: '/static/image/jxz.png',
+	text: "专业上门安装",
+	path: "/pages/workOrder/index?type=进行中",
+}, {
+	label: '已完工',
+	icon: '/static/image/ywj.png',
+	text: "精心维护保养",
+	path: "/pages/workOrder/index?type=已完工",
+}]);
 
 onLoad(() => {
+	let userMsg = uni.getStorageSync('userMsg');
+	if (userMsg.usertype == 21) {
+		itemList.value.splice(1, 0, {
+			label: '待受理',
+			icon: '/static/image/djd.png',
+			text: "故障登记审核",
+			path: "/pages/generalServices/index",
+		})
+		uploadNumber();
+	}
 	$Http.basic({
 		"classname": "common.adspace.adspace",
 		"method": "query_adspacelist", //查询轮播图
@@ -79,7 +109,6 @@ onLoad(() => {
 				return v
 			}) || [];
 		}
-		console.log("banner.value", banner.value)
 		if (banner.value.length == 0) {
 			banner.value = [{
 				imageUrl: "/static/banners/2、390x115-1.png"
@@ -125,9 +154,10 @@ function uploadNumber() {
 			})
 		} else {
 			$Http.basic({
-				"id": "20230208140203", "content":
+				"id": item.label == '待受理' ? 20230206101303 : "20230208140203", "content":
 					{ "pageNumber": 1, "pageSize": 0, "nocache": true, isadmin: item.label == '抢单中心' ? '1' : '', "where": { "status": item.label == '抢单中心' ? '待接单' : item.label, "condition": "", ispublic: item.label == '抢单中心' ? '1' : '' } }
 			}).then(res => {
+				console.log(item.label, res)
 				if (res.code !== 0) {
 					item.badge = res.total;
 				} else {
@@ -158,27 +188,7 @@ function onClickSwiper(e) {
 		})
 	}
 }
-const itemList = ref([{
-	label: '抢单中心',
-	icon: '/static/image/djd.png',
-	text: "专业守护",
-	path: "/pages/workOrder/snatchingOrders",
-}, {
-	label: '待接单',
-	icon: '/static/image/djd.png',
-	text: "故障维修排除",
-	path: "/pages/workOrder/index?type=待接单",
-}, {
-	label: '进行中',
-	icon: '/static/image/jxz.png',
-	text: "专业上门安装",
-	path: "/pages/workOrder/index?type=进行中",
-}, {
-	label: '已完工',
-	icon: '/static/image/ywj.png',
-	text: "精心维护保养",
-	path: "/pages/workOrder/index?type=已完工",
-}]);
+
 </script>
 
 <style lang="scss" scoped>

+ 130 - 28
pages/login/login.vue

@@ -3,27 +3,72 @@
         <view class="head-image">
             <image src="/static/image/logo1.png" mode="heightFix" />
         </view>
-        <view class="input-box">
-            <view class="content">
-                <picker class="picker" mode="selector" :range="countryCodes" range-key="name" :value="countryCode"
-                    @change="changeCountryCode">
-                    {{ countryCode }}
-                </picker>
-                <input type="number" :value="phonenumber" :focus="focused == 'phonenumber'"
-                    @input="onInput($event, 'phonenumber')" placeholder="请输入手机号" class="input" />
-            </view>
+
+        <view style="padding: 20rpx;padding-top: 0;margin-bottom: 20rpx;">
+            <up-tabs :current="current" :activeStyle="{
+                color: '#2979FF',
+                fontWeight: 'bold',
+                lineColor: '#2979FF',
+                transform: 'scale(1.05)'
+            }" :list="list1" @change="changeTabs"></up-tabs>
+
         </view>
-        <view class="input-box" style="margin-top:70rpx;">
-            <view class="content">
-                <input type="number" :value="password" :focus="focused == 'password'"
-                    @input="onInput($event, 'password')" placeholder="请输入验证码" class="input" />
-                <view class="auth-code" @click="getAuthCode">
-                    {{ downTime == 0 ? '获取验证码' : downTime + "S" }}
+
+        <block v-if="current == 0">
+            <view class="input-box">
+                <view class="content">
+                    <picker class="picker" mode="selector" :range="countryCodes" range-key="name" :value="countryCode"
+                        @change="changeCountryCode">
+                        {{ countryCode }}
+                    </picker>
+                    <input type="number" :value="phonenumber" :focus="focused == 'phonenumber'"
+                        @input="onInput($event, 'phonenumber')" placeholder="请输入手机号" class="input" />
                 </view>
             </view>
-        </view>
-        <My-button :customStyle="customStyle" class="my-but" :loading="loading" :disabled="disabled" text="登录"
-            @onClick="logIn" />
+            <view class="input-box" style="margin-top:70rpx;">
+                <view class="content">
+                    <input type="number" :value="password" :focus="focused == 'password'"
+                        @input="onInput($event, 'password')" placeholder="请输入验证码" class="input" />
+                    <view class="auth-code" @click="getAuthCode">
+                        {{ downTime == 0 ? '获取验证码' : downTime + "S" }}
+                    </view>
+                </view>
+            </view>
+            <My-button :customStyle="customStyle" class="my-but" :loading="loading" :disabled="disabled" text="登录"
+                @onClick="logIn" />
+        </block>
+
+        <block v-else>
+            <view class="input-box">
+                <view class="content">
+                    <view class="iconfont icon-zhanghao" style="margin-right: 30rpx;" />
+                    <input type="text" :value="accountno" @input="onInput($event, 'accountno')" placeholder="账号"
+                        class="input" />
+                </view>
+            </view>
+            <view class="input-box" style="margin-top:40rpx;">
+                <view class="content">
+                    <view class="iconfont icon-mima" style="margin-right: 30rpx;" />
+                    <input type="password" :value="password1" @input="onInput($event, 'password1')" placeholder="密码"
+                        class="input" />
+                </view>
+            </view>
+            <view class="input-box" style="margin-top:40rpx;">
+                <view class="content">
+                    <view class="iconfont icon-duanxinyanzheng" style="margin-right: 30rpx;" />
+                    <input type="text" :value="imagecaptcha" @input="onInput($event, 'imagecaptcha')"
+                        placeholder="登录验证码" class="input" />
+                    <image v-if="timestamp" style="width: 200rpx;"
+                        :src="`https://crm.meida.com:16691/yos/rest/index/imagecaptcha?timestamp=${timestamp}`"
+                        @click="changeTimestamp" mode="widthFix" />
+                </view>
+            </view>
+            <My-button :customStyle="customStyle" class="my-but" :loading="loading" :disabled="disabled2" text="登录"
+                @onClick="accLogIn" />
+        </block>
+
+
+
         <view class="agreement-box">
             <up-checkbox label="已阅读并同意" name="agree" usedAlone v-model:checked="isAgreement" />
             <view @click="checkTheAgreement" style="color: #3874F6;">
@@ -47,8 +92,29 @@ import { ref, reactive, getCurrentInstance, computed } from 'vue'
 import { onLoad } from '@dcloudio/uni-app';
 const { $Http } = getCurrentInstance().proxy;
 
+let list1 = reactive([
+    { name: '手机号登录' },
+    { name: '账号登录' },
+]),
+    current = ref(0);
+
+function changeTabs({ index }) {
+    current.value = index
+}
+
+// 表单相关
+const focused = ref('');
+const countryCode = ref('+86');
+const phonenumber = ref('');
+const password = ref('');
+const accountno = ref('');
+const password1 = ref('');
+const imagecaptcha = ref('');
+
 onLoad(() => {
     const storedPhone = uni.getStorageSync('phonenumber');
+    const accountno1 = uni.getStorageSync('accountno');
+    accountno.value = accountno1;
     if (storedPhone) {
         phonenumber.value = storedPhone;
         isAgreement.value = true;
@@ -60,28 +126,39 @@ const loading = ref(false);
 const disabled = computed(() => {
     return !(phonenumber.value.length > 0 && password.value.length >= 4);
 });
+const disabled2 = computed(() => {
+    return !(accountno.value.length > 0 && password1.value.length >= 4 && imagecaptcha.value.length > 0);
+});
+
 const customStyle = ref({
     width: '380rpx',
     margin: '120rpx auto 0',
 });
-// 表单相关
-const focused = ref('');
-const countryCode = ref('+86');
-const phonenumber = ref('');
-const password = ref('');
+
 const countryCodes = reactive([
     { code: '+86', name: '中国 +86', regex: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/ }, // 中国手机号验证规则
     { code: '+1', name: '美国 +1', regex: /^[2-9]\d{2}[2-9](?!11)\d{6}$/ }, // 美国手机号验证规则
     { code: '+44', name: '英国 +44', regex: /^7\d{9}$/ }, // 英国手机号验证规则
 ]);
 function onInput(e, name) {
-    if (name == 'phonenumber') {
-        phonenumber.value = e.detail.value;
-    } else if (name == 'password') {
-        password.value = e.detail.value;
+    const inputMap = {
+        phonenumber: phonenumber,
+        accountno: accountno,
+        password: password,
+        password1: password1,
+        imagecaptcha: imagecaptcha,
+    };
+
+    if (inputMap[name]) {
+        inputMap[name].value = e.detail.value;
     }
+}
+let timestamp = ref(Date.now());
 
+function changeTimestamp() {
+    timestamp.value = Date.now();
 }
+
 function validatephonenumber() {
     const selectedCountry = countryCodes.find(country => country.code === countryCode.value);
     if (!selectedCountry || !selectedCountry.regex.test(phonenumber.value)) {
@@ -155,6 +232,28 @@ function logIn() {
     })
 }
 
+function accLogIn() {
+    if (isAgreement.value == false) return showModal.value = true;
+    loading.value = true;
+    $Http.login({ "accountno": accountno.value, "imagecaptcha": imagecaptcha.value, "password": hexMD5(password1.value), "systemclient": "wechatsaletool" }).then(res => {
+        if (res.code == 1) {
+            if (res.account_list.length == 1) {
+                handleLogin(res.account_list[0]);
+            } else {
+                account_list = reactive([res.account_list]);
+            }
+        } else {
+            loading.value = false;
+            imagecaptcha.value = '';
+            changeTimestamp();
+            uni.showToast({
+                title: res.msg,
+                icon: 'none',
+            });
+        }
+    })
+}
+
 function onCancel() {
     account_list = reactive([]);
 
@@ -178,6 +277,9 @@ function handleLogin(data) {
             uni.setStorageSync('userMsg', data);
             uni.removeStorageSync('phonenumber');
             uni.setStorageSync('phonenumber', phonenumber.value);
+            uni.removeStorageSync('accountno');
+            uni.setStorageSync('accountno', accountno.value);
+
             uni.redirectTo({
                 url: '/pages/index/index',
             });
@@ -389,7 +491,7 @@ function str2binl(str) {
     display: flex;
     justify-content: center;
     height: 148rpx;
-    margin-bottom: 120rpx;
+    margin-bottom: 60rpx;
 
     image {
         height: 100%;

+ 2 - 2
pages/workOrder/changeMsg.vue

@@ -296,7 +296,7 @@ function skuConfirm() {
             ["customername", 'customerphonenumber', 'sa_customersid', 'phonenumber', 'enterprisename', 'cardno', 'itemid', 'itemname', 'itemno', 'model', 'unitname', 'spec'].forEach(key => {
                 form[key] = res.data[0][key] || '';
             });
-            uni.showToast({ title: '已填充表单', icon: 'none' });
+            uni.showToast({ title: '已将产品信息写入', icon: 'none' });
         })
     } else {
         form.sku = '';
@@ -328,7 +328,7 @@ function changeItem(item) {
         ['enterprisename', "customername", 'customerphonenumber', 'sa_customersid', 'sku', 'cardno', 'itemid', 'itemname', 'itemno', 'model', 'phonenumber', 'unitname', 'spec'].forEach(key => {
             form[key] = item[key] || '';
         });
-        uni.showToast({ title: '已填充表单', icon: 'none' });
+        uni.showToast({ title: '已将产品信息写入', icon: 'none' });
         querySku.value = true;
         closePopup();
     }

+ 28 - 20
pages/workOrder/detail.vue

@@ -63,20 +63,22 @@
                         <view class="label justify">销售商</view>
                         <view class="value">{{ detail.enterprisename || '--' }}</view>
                     </view>
-                    <view class="row" v-if="detail.itemsText.length">
-                        <view class="label">产品信息</view>
-                        <view class="value">
-                            <view class="col-center" v-for="(item, index) in detail.itemsText" :key="index">
-                                <view class="value"><text v-if="detail.itemsText.length != 1">{{ index + 1 }}. </text>{{
-                                    item }}
-                                </view>
-                            </view>
-                        </view>
-                    </view>
                     <view class="row" v-if="detail.sku">
                         <view class="label justify">序列号</view>
                         <view class="value">{{ detail.sku || '--' }}</view>
                     </view>
+                    <view class="row" v-if="detail.itemname">
+                        <view class="label">产品品名</view>
+                        <view class="value">{{ detail.itemname || '--' }}</view>
+                    </view>
+                    <view class="row" v-if="detail.itemno">
+                        <view class="label">产品编号</view>
+                        <view class="value">{{ detail.itemno || '--' }}</view>
+                    </view>
+                    <view class="row" v-if="detail.model">
+                        <view class="label">产品型号</view>
+                        <view class="value">{{ detail.model || '--' }}</view>
+                    </view>
                     <view class="row" v-if="detail.customername || detail.customerphonenumber"
                         style="align-items: center;">
                         <view class="label justify">客户信息</view>
@@ -148,8 +150,9 @@
                 </view>
                 <view class="but-box-item" @click="!detail.sku ? toCMTips() : confirmStartShow = true">
                     <My-button text="确认开始" />
-                    <up-modal negativeTop="100" :show="confirmStartShow" showCancelButton @confirm="confirmStart"
-                        @cancel="confirmStartShow = false" ref="uModal" :asyncClose="true">
+                    <up-modal negativeTop="100" cancelText="信息修改" confirmText="确认开始" :show="confirmStartShow"
+                        showCancelButton @confirm="confirmStart" @cancel="confirmCancel" ref="uModal"
+                        :asyncClose="true">
                         <view class="slot-content">
                             <view>
                                 请仔细核对服务信息和客户信息
@@ -163,14 +166,15 @@
             </view>
         </view>
         <view class="main" v-if="current >= 2 && detail.nodes.length" style="padding: 30rpx;">
-            <nodes ref="Nodes" :nodes="detail.nodes" />
-            <view v-if="detail.status == '提交' && detail.needcode"
-                style='width: 60%;margin: 40rpx auto 0;padding-bottom: 30rpx;' @click="openModal">
-                <My-button text="完工验证码" />
-            </view>
-            <view v-if="detail.status == '进行中'" style='width: 60%;margin: 40rpx auto 0;padding-bottom: 30rpx;'
-                @click="submit">
-                <My-button text="完工提交" />
+            <nodes ref="Nodes" :status="detail.status" :nodes="detail.nodes" />
+            <view class="but-box">
+                <view class="but-box-item">
+                    <My-button :disabled="detail.status == '提交'" @onClick="submit" text="完工提交" />
+                </view>
+                <view class="but-box-item">
+                    <My-button v-if="detail.needcode" @onClick="openModal" :disabled="detail.status == '进行中'"
+                        text="完工验证码" />
+                </view>
             </view>
         </view>
     </view>
@@ -405,6 +409,10 @@ function confirmStart() {
         }
     })
 }
+function confirmCancel() {
+    confirmStartShow.value = false;
+    toChangeMsg();
+}
 
 defineExpose({ detail })
 

+ 5 - 2
pages/workOrder/modules/nodes.vue

@@ -9,7 +9,7 @@
             <view class="label">
                 {{ item.workpresetjson.workname }}
             </view>
-            <node v-if="!prefix && item.child.length" :nodes="item.child"
+            <node v-if="!prefix && item.child.length" :status='status' :nodes="item.child"
                 :prefix="(prefix ? prefix + '-' : '') + item.rowindex" />
 
             <block v-else>
@@ -41,6 +41,9 @@ const props = defineProps({
     },
     prefix: {
         type: [String, Number],
+    },
+    status: {
+        type: String,
     }
 });
 function toWork(item) {
@@ -51,8 +54,8 @@ function toWork(item) {
     }
     if (item.child.length) return;
     item.title = (props.prefix ? props.prefix + '-' : '') + item.rowindex + '. ' + item.workpresetjson.workname;
+    item.status1 = props.status;
     $Http.data = item;
-
     uni.navigateTo({
         url: '/pages/workOrder/work',
     })

+ 59 - 130
pages/workOrder/work.vue

@@ -1,5 +1,11 @@
 <template>
     <view class="content">
+        <view class="title">
+            {{ data.title1 }}
+        </view>
+        <view class="remarks" style="padding-left: 30rpx;" v-if="data.workpresetjson.remarks">
+            — {{ data.workpresetjson.remarks }}
+        </view>
         <up-form :model="form" labelWidth="70" ref="uFormRef" disabled>
             <block v-if="workpresetjson.questionedit != 0">
                 <up-form-item label="故障类型" prop="itemtype" :required="workpresetjson.questionedit == 11">
@@ -12,7 +18,7 @@
                     </view>
                 </up-form-item>
                 <up-form-item label="问题编辑" prop="questionedit" :required="workpresetjson.questionedit == 11">
-                    <up-textarea maxlength="499" :disabled="data.status == 1" v-model="form.questionedit"
+                    <up-textarea maxlength="499" :disabled="data.status1 != '进行中'" v-model="form.questionedit"
                         placeholder="问题编辑" autoHeight height="20" />
                 </up-form-item>
             </block>
@@ -48,7 +54,7 @@
                             </view>
                         </view>
                     </up-form-item>
-                    <accList :list="data.newtitems" :disabled="data.status == 1"
+                    <accList :list="data.newtitems" :disabled="data.status1 != '进行中'"
                         @deleteItem="deleteItem($event, 'newtitems')" />
 
                     <up-form-item :label="`旧配件(${data.oldtitems.length})`">
@@ -58,7 +64,7 @@
                             </view>
                         </view>
                     </up-form-item>
-                    <accList :list="data.oldtitems" :disabled="data.status == 1"
+                    <accList :list="data.oldtitems" :disabled="data.status1 != '进行中'"
                         @deleteItem="deleteItem($event, 'oldtitems')" />
                 </block>
             </view>
@@ -76,7 +82,7 @@
 
             <up-form-item v-if="workpresetjson.amountpay != 0" label="费用支付" prop="amountpay"
                 :required="workpresetjson.amountpay == 11">
-                <up-input :disabled="data.status == 1" v-model="form.amountpay" type="number" placeholder="费用支付">
+                <up-input :disabled="data.status1 != '进行中'" v-model="form.amountpay" type="number" placeholder="费用支付">
                     <template #suffix>
                     </template>
@@ -85,36 +91,29 @@
 
             <up-form-item v-if="workpresetjson.fileupload != 0" label="拍照" prop="fileupload"
                 :required="rules.fileupload[0].required">
-                <My_upload :disabled="data.status == 1" ref="upload" :fileList="data.attinfos"
+                <My_upload :disabled="data.status1 != '进行中'" ref="upload" :fileList="data.attinfos"
                     @uploadCallback="uploadCallback" />
-                <up-image v-if="data.status == 1 && data.attinfos.length == 0" :show-loading="true" src="" width="80px"
-                    height="80px" @click="click"></up-image>
+                <up-image v-if="data.status1 != '进行中' && data.attinfos.length == 0" :show-loading="true" src=""
+                    width="80px" height="80px" @click="click"></up-image>
             </up-form-item>
 
             <up-form-item v-if="workpresetjson.textedit != 0" label="文字说明" prop="textedit"
                 :required="rules.textedit[0].required">
-                <up-textarea maxlength="499" :disabled="data.status == 1" v-model="form.textedit" placeholder="文字说明"
-                    autoHeight height="20" />
+                <up-textarea maxlength="499" :disabled="data.status1 != '进行中'" v-model="form.textedit"
+                    placeholder="文字说明" autoHeight height="20" />
             </up-form-item>
         </up-form>
 
-        <view class="but-box" v-if="data.status != '1'">
+        <view class="but-box" v-if="data.status1 == '进行中'">
             <view class="but-box-item" @click="save">
                 <My-button :customStyle="{
                     'background-color': '#FFFFFF',
                     'color': '#3874F6',
                     height: '80rpx',
-                }" text="保存" :disabled="loading" :loading="loading1" />
-            </view>
-            <view class="but-box-item" @click="submit">
-                <My-button :customStyle="{
-                    height: '80rpx',
-                }" text="完成" :disabled="loading1" :loading="loading" />
+                }" text="保存" :disabled="loading" :loading="loading" />
             </view>
         </view>
         <view style="height: 50px;" />
-
-
         <page-container :show="true" :overlay="false" @beforeleave="beforeleave" />
     </view>
 </template>
@@ -131,7 +130,7 @@ const upload = ref(null);
 let formModified = ref(false);
 
 function beforeleave(e) {
-    if (formModified.value && data.status != '1') {
+    if (formModified.value && data.status1 == '进行中') {
         uni.showModal({
             title: '提示',
             content: '是否保存当前编辑内容?',
@@ -140,9 +139,6 @@ function beforeleave(e) {
             success: function (res) {
                 if (res.confirm) {
                     save()
-                    setTimeout(() => {
-                        uni.navigateBack()
-                    }, 500);
                 } else if (res.cancel) {
                     uni.navigateBack()
                 }
@@ -155,7 +151,7 @@ function beforeleave(e) {
 
 // 去添加配件
 function toAddItem(key = 'oldtitems') {
-    if (data.status == '1') return;
+    if (data.status1 != '进行中') return;
     $Http.basicsData = {
         selected: key,
         newtitems: deepCloneArray(data.newtitems) || [],
@@ -175,7 +171,7 @@ function toAddItem(key = 'oldtitems') {
     }
 }
 
-// 帮我写一个[{},{}] 深拷贝的方法
+// [{},{}] 深拷贝的方法
 function deepCloneArray(arr) {
     return arr.map(item => {
         return { ...item };
@@ -184,6 +180,7 @@ function deepCloneArray(arr) {
 
 // 删除配件
 function deleteItem(item, key = 'oldtitems') {
+    if (data.status1 != '进行中') return;
     data[key] = data[key].filter(v => v.itemid !== item.itemid);
     if (key == 'newtitems') form.newtitems = data.newtitems.length ? '1' : '';
 }
@@ -225,7 +222,11 @@ let formToContent = (form) => {
 }
 
 let data = {
-    attinfos: []
+    attinfos: [],
+    title1: '',
+    workpresetjson: {
+        remarks: ''
+    },
 };
 let workpresetjson = reactive({});
 
@@ -240,9 +241,9 @@ let rules = reactive({
 const questionoption = ref([]);
 
 onLoad(() => {
+    $Http.data.title1 = $Http.data.title.split('.')[1] || '';
     data = reactive($Http.data);
     delete $Http.data;
-    console.log("data", data)
 
     form.fileupload = data.attinfos.length ? '1' : '';
     uni.setNavigationBarTitle({
@@ -330,12 +331,9 @@ onLoad(() => {
 
 // 保存
 const loading = ref(false);
-const loading1 = ref(false);
-
-function submit() {
+async function save() {
     if (loading.value) return;
     if (upload.value.isUploading()) return;
-
     let traintitem = []
     try {
         if (form.additem == 1) {
@@ -363,118 +361,43 @@ function submit() {
     } catch (error) {
 
     }
-
-
-    uFormRef.value.validate().then(valid => {
-        if (valid) {
-            let content = {
-                "sa_workorderid": data.sa_workorderid,
-                "sa_workorder_nodeid": data.sa_workorder_nodeid,
-                isconfirm: 1,
-                ...formToContent(form),
-                traintitem
-            };
-            uni.showModal({
-                title: '提示',
-                content: '是否确定完成工序?完成后将无法再次编辑。',
-                confirmText: '完成',
-                success: function (res) {
-                    if (res.confirm) {
-                        loading.value = true;
-                        $Http.basic({
-                            "id": "20230209094203",
-                            "sa_workorderid": data.sa_workorderid,
-                            "sa_workorder_nodeid": data.sa_workorder_nodeid,
-                            content
-                        }).then(res => {
-                            loading.value = false;
-                            console.log("提交工单", res);
-                            if (res.code == 1) {
-                                loading.value = true;
-                                upload.value.saveFileLinks('sa_workorder_node', data.sa_workorder_nodeid).then((s) => {
-                                    loading.value = false;
-                                    formModified.value = false;
-                                    setTimeout(() => {
-                                        uni.navigateBack()
-                                    }, 300);
-                                })
-                            }
-                            uni.showToast({ title: res.code !== 1 ? res.msg : "提交成功", icon: 'none', mask: res.code == 1 });
-                        }).catch(err => {
-                            loading.value = false;
-                            console.error("提交工单失败", err);
-                            uni.showToast({ title: '提交失败,请稍后重试', icon: 'none' });
-                        });
-                    }
-                }
-            });
-        }
-    })
-}
-
-function save() {
-    if (loading1.value) return;
-    if (upload.value.isUploading()) return;
-
-    let traintitem = []
+    loading.value = true;
+    let valid = false;
     try {
-        if (form.additem == 1) {
-            traintitem = data.oldtitems.map(v => {
-                return {
-                    itemid: v.itemid,
-                    itemname: v.itemname,
-                    model: v.model,
-                    price: v.price,
-                    qty: v.qty || v.packageqty || 1,
-                }
-            }).concat(data.newtitems.map(v => {
-                return {
-                    itemid: v.itemid,
-                    itemname: v.itemname,
-                    model: v.model,
-                    price: v.price,
-                    qty: v.qty || v.packageqty || 1,
-                    isnew: 1
-                }
-            }))
-        } else {
-            traintitem = []
-        }
+        valid = await uFormRef.value.validate();
     } catch (error) {
-
+        valid = false;
     }
-
-
-    let content = {
-        "sa_workorderid": data.sa_workorderid,
-        "sa_workorder_nodeid": data.sa_workorder_nodeid,
-        isconfirm: 0,
-        ...formToContent(form),
-        traintitem
-    };
-
-    loading1.value = true;
     $Http.basic({
         "id": "20230209094203",
         "sa_workorderid": data.sa_workorderid,
         "sa_workorder_nodeid": data.sa_workorder_nodeid,
-        content
+        content: {
+            "sa_workorderid": data.sa_workorderid,
+            "sa_workorder_nodeid": data.sa_workorder_nodeid,
+            isconfirm: valid ? 1 : 0,
+            ...formToContent(form),
+            traintitem
+        }
     }).then(res => {
-        loading1.value = false;
+        loading.value = false;
         console.log("保存工单", res);
         if (res.code == 1) {
-            loading1.value = true;
+            loading.value = true;
             upload.value.saveFileLinks('sa_workorder_node', data.sa_workorder_nodeid).then((s) => {
-                loading1.value = false;
+                loading.value = false;
             })
             formModified.value = false;
+            uni.navigateBack()
         }
-        uni.showToast({ title: res.code !== 1 ? res.msg : "保存成功", icon: 'none' });
+        setTimeout(() => {
+            uni.showToast({ title: res.code !== 1 ? res.msg : "保存成功", icon: 'none', mask: res.code == 1 });
+        }, 500);
     })
 }
 
 function clickRadio(value, key) {
-    if (data.status == '1') return;
+    if (data.status1 != '进行中') return;
     form[key] = form[key] == value ? "" : value;
     if (key == 'passcheck') {
         if (form[key] == '0') {
@@ -495,13 +418,12 @@ function clickRadio(value, key) {
         form.newtitems = data.newtitems.length ? '1' : '';
         uFormRef.value.setRules(rules);
     }
-    console.log("form", form)
 }
 
 function uploadCallback(list) {
     console.log("上传回调", list);
     form.fileupload = list.fileList.length ? '1' : '';
-    console.log("form", form)
+    formModified.value = true;
 }
 
 
@@ -525,13 +447,20 @@ function uploadCallback(list) {
         border-radius: 8rpx;
     }
 
-    .title {
-        font-size: 34rpx;
-        color: #4773EE;
-        margin: 20rpx 0;
+    .title{
+        font-size: 36rpx;
         font-weight: bold;
+        color: #333333;
     }
 
+    .remarks{
+        font-size: 28rpx;
+        color: #999999;
+        margin-top: 10rpx;
+        margin-bottom: 20rpx;
+    }
+
+
     .options-box {
         position: relative;
         top: -6rpx;

+ 19 - 3
static/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4985326 */
-  src: url('//at.alicdn.com/t/c/font_4985326_k6gds60jjxi.woff2?t=1756186335629') format('woff2'),
-       url('//at.alicdn.com/t/c/font_4985326_k6gds60jjxi.woff?t=1756186335629') format('woff'),
-       url('//at.alicdn.com/t/c/font_4985326_k6gds60jjxi.ttf?t=1756186335629') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_4985326_runr5gj2ube.woff2?t=1763537070108') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4985326_runr5gj2ube.woff?t=1763537070108') format('woff'),
+       url('//at.alicdn.com/t/c/font_4985326_runr5gj2ube.ttf?t=1763537070108') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,22 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-duanxinyanzheng:before {
+  content: "\e69e";
+}
+
+.icon-mima:before {
+  content: "\e6a0";
+}
+
+.icon-zhanghao:before {
+  content: "\e6a1";
+}
+
+.icon-yishouli:before {
+  content: "\e707";
+}
+
 .icon-a-wodetiaozhuan:before {
   content: "\e647";
 }