需求提交

test
zhangdi 1 year ago
parent 9d6ba51fed
commit 8b6d3c8d02
  1. 11
      App.vue
  2. 20
      api/api.js
  3. 39
      common/betone_components/betone-new-input.vue
  4. 44
      common/betone_components/betone-upload.vue
  5. 106
      pages/register/index.vue
  6. 15
      pages/register/registerSuccess.vue
  7. 12
      pages/submission/components/subForm.vue
  8. 1
      pages/submission/index.vue
  9. 5
      pages/submission/recordsdetails.vue
  10. 104
      pages/submission/sendOrders.vue
  11. 22
      utils/request.js
  12. 2
      utils/tabbar.js
  13. 45
      utils/website.js

@ -2,11 +2,6 @@
export default {
onLaunch: function (options) {
uni.hideTabBar()
},
onReady() {
},
onShow: function () {
console.log("App Show");
const value = uni.getStorageSync("token");
console.log("App Launch", !value);
@ -22,6 +17,12 @@ export default {
//
this.$store.dispatch("changeTabbar", userInfo.role_id);
}
},
onReady() {
},
onShow: function () {
},
onHide: function () {

@ -9,7 +9,17 @@ const install = (Vue, vm) => {
let login = (params) => http.post('/blade-auth/oauth/token?' + params)
// 退出
let logout = () => http.get('/blade-auth/oauth/logout')
let register = (params, config = {}) => http.post('/blade-auth/oauth/token', params, config)
// 注册
let registerUser = (params) => http.post('/blade-system/user/register/save-user', params, {
authorization: false,
isparams: true
})
// 发送验证码 /
let sendVerify = (params) => http.get('/blade-system/user/register/send-verify-code', params, {
authorization: false,
isparams: true
})
// 首页
let getworkbench = () => http.post('/blade-auth/oauth/token', params, config)
@ -133,23 +143,23 @@ const install = (Vue, vm) => {
})
// 需求编辑 editData
let editData = (params) => http.post('/workOrder/update', params, {
let editData = (params) => http.post('/workOrder/update', params, {
authorization: false,
isparams: false
})
// 维修人员驳回 /
let repairReject = (params) => http.post('/workOrder/repairReject', params, {
let repairReject = (params) => http.post('/workOrder/repairReject', params, {
authorization: false,
isparams: false
})
// 申领单提交 /
let applySave = (params) => http.post('/apply/save', params, {
let applySave = (params) => http.post('/apply/save', params, {
authorization: false,
isparams: false
})
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList,upkeepStat,pieStat,getUserInfo,overview,sendOrders,cloneOrder,editData,repairReject,applySave };
vm.$u.api = { getTenantInfo, login, logout, registerUser, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList, upkeepStat, pieStat, getUserInfo, overview, sendOrders, cloneOrder, editData, repairReject, applySave,sendVerify };
}
export default {

@ -144,18 +144,19 @@ export default {
},
getCode() {
if (this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: "正在获取验证码",
});
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$u.toast("验证码已发送");
this.$emit("ch");
//
this.$refs.uCode.start();
}, 2000);
this.$emit("ch");
// //
// uni.showLoading({
// title: "",
// });
// setTimeout(() => {
// uni.hideLoading();
// // this.start()
// uni.$u.toast("");
// //
// this.$refs.uCode.start();
// }, 2000);
} else {
uni.$u.toast("倒计时结束后再发送");
}
@ -164,8 +165,22 @@ export default {
// uni.$u.toast("");
},
start() {
// this.$refs.uCode.start();
// uni.$u.toast("");
},
sendSuceess(){
uni.showLoading({
title: "正在获取验证码",
});
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$u.toast("验证码已发送");
//
this.$refs.uCode.start();
}, 2000);
},
//
ch(e) {
this.$emit("changevalue", e);

@ -8,7 +8,7 @@
<image class="video-img" v-if="isVideo(item)" @click="previewVideo(item)" src="@/static/images/submit/video.svg"
mode="aspectFill"></image>
</view>
<view class="upload" @click="chooseFile" v-if="!disabled">
<view class="upload" @click="chooseFile" v-if="!disabled && (fileList.length < 3)">
<u-icon size="28" name="plus" color="rgba(139,146,155,1)"></u-icon>
</view>
@ -79,7 +79,15 @@ export default {
success: (res) => {
this.$refs.BetLoading.show()
//
this.uploadFile(res.tempFilePaths[0]);
const tempFilePaths = res.tempFilePaths;
uni.compressImage({
src: tempFilePaths[0], //
quality: 50, // 0 - 100100
success: (compressRes) => {
const compressedFilePath = compressRes.tempFilePath;
this.uploadFile(compressedFilePath);
}
})
},
});
},
@ -89,20 +97,28 @@ export default {
sourceType: ["album", "camera"],
success: (res) => {
this.$refs.BetLoading.show()
const tempFilePaths = res.tempFilePaths;
//
this.uploadFile(res.tempFilePath);
// this.uploadFile(res.tempFilePath);
uni.compressVideo({ //
src:tempFilePaths,
quality:1,
success:(compressRes)=>{
this.uploadFile(compressRes.tempFilePath);
},
})
},
});
},
uploadFile(filePath) {
uni.uploadFile({
url: website.baseUrl+"/blade-resource/oss/endpoint/put-file", //
url: website.baseUrl + "/blade-resource/oss/endpoint/put-file", //
filePath: filePath,
name: "file", //
formData: {},
success: (res) => {
let info = JSON.parse(res.data);
// console.log("", info); //
console.log("上传成功", info); //
this.fileList.push({
'link': info.data.link,
@ -157,14 +173,16 @@ export default {
overflow: hidden;
margin-right: 30rpx;
position: relative;
// margin-top: 32rpx;
margin-bottom: 32rpx;
background: #fff;
border: 1px solid rgba(217, 217, 217, 1);
image {
width: 100%;
height: 100%;
}
.video-img{
.video-img {
width: 50%;
height: 50%;
margin: auto;
@ -174,6 +192,7 @@ export default {
right: 0;
bottom: 0;
}
.del-icon {
position: absolute;
top: 8rpx;
@ -197,10 +216,11 @@ export default {
border-radius: 10rpx;
margin-bottom: 32rpx;
}
.icon-close{
position: absolute;
top: 40rpx;
right: 40rpx;
}
.icon-close {
position: absolute;
top: 40rpx;
right: 40rpx;
}
}
</style>

@ -3,41 +3,42 @@
<view class="container">
<betone-header-top :title="title" />
<u-form labelPosition="left" :model="registerInfo" :rules="rules" ref="registerForm">
<u-form-item prop="businessName" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="businessName" :border-bottom="false" label-width="0">
<betone-new-input label="企业名称" v-model="registerInfo.businessName" placeholder="请输入" :isRequire="true" />
</u-form-item>
<u-form-item prop="area" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="area" :border-bottom="false" label-width="0">
<view @click.stop="addMap()" style="width: 100%;height: 100%;">
<betone-new-input label="实验室地址" v-model="registerInfo.area" placeholder="请选择" :isRequire="true"
type="select" />
</view>
</u-form-item>
<u-form-item prop="personName" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="personName" :border-bottom="false" label-width="0">
<betone-new-input label="负责人姓名" v-model="registerInfo.personName" placeholder="请输入" :isRequire="true" />
</u-form-item>
<u-form-item prop="phoneNumber" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="phoneNumber" :border-bottom="false" label-width="0">
<betone-new-input label="手机号" v-model="registerInfo.phoneNumber" placeholder="请输入" :isRequire="true" />
</u-form-item>
<u-form-item prop="password" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="verificationCode" :border-bottom="false" label-width="0">
<betone-new-input label="手机验证码" v-model="registerInfo.verificationCode" placeholder="请输入手机6位数验证码"
:isSms="true" @ch="sendCode" :isRequire="true" ref="verificationCode" />
</u-form-item>
<u-form-item prop="password" :border-bottom="false" label-width="0">
<betone-new-input label="设置密码" v-model="registerInfo.password" placeholder="请输入8-16位数字与字母的组合"
:isRequire="true" type="password" />
</u-form-item>
<u-form-item prop="confirmPassword" ref="item1" :border-bottom="false" label-width="0">
<u-form-item prop="confirmPassword" :border-bottom="false" label-width="0">
<betone-new-input label="确认密码" v-model="registerInfo.confirmPassword" placeholder="请再次输入密码" :isRequire="true"
type="password" />
</u-form-item>
<u-form-item prop="verificationCode" ref="item1" :border-bottom="false" label-width="0">
<betone-new-input label="手机验证码" v-model="registerInfo.verificationCode" placeholder="请输入手机6位数验证码"
:isSms="true" @ch="sendCode" :isRequire="true" />
</u-form-item>
<u-form-item prop="checked" ref="item1" :border-bottom="false">
<u-form-item prop="checked" :border-bottom="false">
<u-checkbox-group style="margin-bottom: 16rpx" shape="square">
<u-checkbox v-model="registerInfo.checked" key="index" labelSize="24"
name="我已阅读并接受《注册服务协议》及《隐私权政策》">我已阅读并接受注册服务协议隐私权政策</u-checkbox>
</u-checkbox-group>
</u-form-item>
</u-form>
<u-button class="item-bottom" type="primary" @click="formSubmit">
<u-button class="item-bottom" type="primary" @click="formSubmit()">
注册
</u-button>
</view>
@ -46,7 +47,7 @@
:showResetting='mapInfo.showResetting' :listIco='mapInfo.listIco' :orientationIco='mapInfo.orientationIco'
:resettingIco='mapInfo.resettingIco'></map-Point>
</betone-dialog>
<betone-loading ref="BetLoading"></betone-loading>
</view>
</template>
<script>
@ -129,6 +130,7 @@ export default {
if (value != this.registerInfo.password) {
callback(new Error('两次密码校验不一致'))
}
callback()
},
message: '两次密码校验不一致',
trigger: ["blur"]
@ -156,8 +158,8 @@ export default {
resettingIco: "/uni_modules/map-Point/static/position.png",
showResetting: true,
Radius: '',
}
},
selectMap: {},//
};
},
@ -180,28 +182,66 @@ export default {
},
formSubmit() {
// uni.navigateTo({
// url: "/pages/register/registerSuccess",
// });
this.$refs.registerForm.validate(valid => {
if (valid) {
if (this.registerInfo.checked.length <= 0) {
uni.$u.toast("请勾选《注册服务协议》及《隐私权政策》");
return false;
this.$nextTick(() => {
// uni.navigateTo({
// url: "/pages/register/registerSuccess?account=" + this.registerInfo.phoneNumber + '&pwd=' + this.registerInfo.password,
// });
this.$refs.registerForm.validate(valid => {
if (valid) {
if (this.registerInfo.checked.length <= 0) {
uni.$u.toast("请勾选《注册服务协议》及《隐私权政策》");
return false;
}
this.$refs.BetLoading.show();
let query_ = {
"deptName": this.registerInfo.businessName,//
"address": this.registerInfo.area,//
"name": this.registerInfo.personName,//
"phone": this.registerInfo.phoneNumber,//
"password": this.registerInfo.password,//
"addressLon": this.selectMap.location.split(',')[0],//
"addressLat": this.selectMap.location.split(',')[1],//
"verifyCode": this.registerInfo.verificationCode,//
}
this.$u.api.registerUser(query_).then(res => {
this.$refs.BetLoading.hide();
if (res.code == 200) {
setTimeout(() => {
uni.navigateTo({
url: "/pages/register/registerSuccess?account=" + this.registerInfo.phoneNumber + '&pwd=' + this.registerInfo.password,
});
}, 1000)
} else {
uni.$u.toast(res.msg);
}
}).finally(err => {
this.$refs.BetLoading.hide();
uni.$u.toast(err.data.msg);
})
} else {
this.$refs.BetLoading.hide();
console.log('验证失败');
}
console.log('验证通过');
} else {
console.log('验证失败');
}
});
});
})
},
//
sendCode() {
setTimeout(() => {
// this.isCanSms = true;
uni.$u.toast("发送成功");
}, 1500);
if (this.registerInfo.phoneNumber == '') {
uni.$u.toast("请先输入手机号");
return false;
}
let query = {
phone: this.registerInfo.phoneNumber
}
this.$u.api.sendVerify(query).then(res => {
if (res.code == 200) {
this.$refs.verificationCode.sendSuceess()
}
})
},
//
addMap() {
@ -209,6 +249,8 @@ export default {
},
commitCheck(e) {
if (e) {
this.selectMap = e
console.log('选中地点', e)
uni.$emit('commitCheck', e);
this.registerInfo.area = e.name
}

@ -8,8 +8,9 @@
></u-icon>
</view>
<view class="suc-title">恭喜您成功注册账号</view>
<view class="suc-txt">请等待客服进行审核</view>
<view class="suc-txt">您的账号信息为</view>
<view class="suc-txt"> 账号<i>222222222</i> </view>
<view class="suc-txt"> 账号<i>{{ account }}</i> </view>
<view class="suc-txt" style="margin-bottom: 128rpx">
密码<i v-if="!isView">{{ password | maskText }}</i
><i v-if="isView">{{ password }}</i>
@ -30,7 +31,8 @@ export default {
data() {
return {
isView: false,
password: "999999",
password: "",//
account:'',//
};
},
// Vue
@ -38,10 +40,17 @@ export default {
maskText(value) {
return value.replace(/./g, "*");
},
},
onLoad(option){
this.account = option.account
this.password = option.pwd
},
onShow(){
},
methods: {
linkLogin() {
uni.navigateTo({
uni.redirectTo({
url: "/pages/login/login",
});
},

@ -1,5 +1,5 @@
<template>
<view class="page-css">
<view class="">
<view class="container">
<view v-for="(item, index) in breakdownInfo" :key="index">
<betone-header-top :titleMin="'故障信息'" />
@ -209,10 +209,10 @@ export default {
</script>
<style lang="scss" scoped>
.page-css {
background: #efefef;
display: flex;
flex-direction: column;
// .page-css {
// background: #efefef;
// display: flex;
// flex-direction: column;
.container {
flex: 1;
@ -232,5 +232,5 @@ export default {
font-size: 30rpx;
color: #000000;
}
}
// }
</style>

@ -37,5 +37,6 @@ export default {
background: #efefef;
display: flex;
flex-direction: column;
}
</style>

@ -384,6 +384,11 @@ export default {
uni.showToast({ title: "请选择需要申领的物料信息", icon: "none" });
return false
}
//
if (this.selectGoodsList.find(item => item.goodsNum == 0)) {
uni.showToast({ title: "申领数量不能为0", icon: "none" });
return false
}
this.selectGoodsList.forEach((item, index) => {
data.push({
orderId: this.detailForm.id,

@ -105,7 +105,8 @@
<u-select v-model="sendOrdersShow" :list="sendOrdersList" @confirm="sendOrdersConfirm" :isShowsearch="true"
value-name="id" title="选择维修人员"></u-select>
<!-- 选择时间 -->
<u-calendar v-model="calendarShow" mode="date" @change="calendarChange"></u-calendar>
<u-calendar v-model="calendarShow" mode="date" @change="calendarChange" :disabled-dates="disabledDates"
:min-date="minDate" :max-date="maxDate"></u-calendar>
<!-- 维修人员物料选择 -->
<betone-dialog v-model="aterialShow" height="900rpx">
@ -166,7 +167,12 @@ export default {
data() {
return {
userInfo:{},//
disabledDates: {
to: new Date() //
},
minDate: null,
maxDate: null,
userInfo: {},//
orderId: '',//id
detailForm: {},//
rules: {},
@ -232,11 +238,12 @@ export default {
this.getRepairPersons()//
this.orderId = this.$route.query.id
this.getDtails()
this.userInfo = uni.getStorageSync("userinfo");
this.userInfo = uni.getStorageSync("userinfo");
//
if (this.dataTypes == 4) {
this.getGoodsList()
}
this.initDate()
},
methods: {
getDtails() {
@ -394,35 +401,39 @@ export default {
customerOpinion: this.detailForm.customerOpinion
}
//
if (this.sendOrder.isNeedMaterials == 1) {
//
// if (this.sendOrder.materialsData.find(item => item.goodsNum == 0)) {
// uni.showToast({ title: "0", icon: "none" });
// }
let data = []
console.log('this.materialsData', this.sendOrder.materialsData)
this.sendOrder.materialsData.map(item => {
data.push({
productId: item.productName,//id
productName: item.name, //
brand: item.brand,//
xh: item.xh,//
rule: item.rule,//
applyNum: item.applyNum,//
})
})
let query1 = {
details: data,
applyUserId: this.userInfo.user_id, //Id
applyUser: this.userInfo.user_name, //
applyTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//(yyyy-MM-dd HH:mm:ss)
status: 0,
workId: this.orderId,
}
this.$u.api.applySave(query1).then(res => {
if (this.sendOrder.isNeedMaterials == 1 && this.sendOrder.materialsData.length <= 0) {
uni.showToast({ title: "请选择需要的申领材料", icon: "none" });
return false
}
//
if (this.sendOrder.materialsData.find(item => item.goodsNum == 0)) {
uni.showToast({ title: "申领数量不能为0", icon: "none" });
return false
}
let data = []
console.log('this.materialsData', this.sendOrder.materialsData)
this.sendOrder.materialsData.map(item => {
data.push({
productId: item.productName,//id
productName: item.name, //
brand: item.brand,//
xh: item.xh,//
rule: item.rule,//
applyNum: item.applyNum,//
})
})
let query1 = {
details: data,
applyUserId: this.userInfo.user_id, //Id
applyUser: this.userInfo.user_name, //
applyTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//(yyyy-MM-dd HH:mm:ss)
status: 0,
workId: this.orderId,
}
this.$u.api.applySave(query1).then(res => {
})
this.$u.api.editData(query).then(res => {
if (res.code == 200) {
uni.showToast({ title: "派单成功", icon: "none" });
@ -454,6 +465,39 @@ export default {
})
},
initDate() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (month < 10) {
month = "0" + month;
}
if (day < 10) {
day = "0" + day;
}
let minyear = year - 1;
this.minDate = minyear + "-" + month + "-" + day;
//let maxyear = year + 1;
this.maxDate = year + 1 + "-" + month + "-" + day; //
//this.maxDate = year  + '-'+ month +'-' + day; //
},
}
}
</script>

@ -56,9 +56,11 @@ const install = (Vue, vm) => {
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
const data = res.data
let status = res.data ? res.data.code : (res.error_code ? res.error_code : '');
const message = res.data ? res.data.msg || res.error_description || '未知错误' : '';
console.log('接口返回拦截',res)
const data = res
let status = res.code || res.status;
const message = res.msg || res.error_description || '未知错误';
if (!!res.error_code) {
uni.showToast({
title: res.error_description,
@ -81,13 +83,13 @@ const install = (Vue, vm) => {
// return false;
// }
// // 如果请求为非200否者默认统一处理
// if (status !== 200) {
// uni.showToast({
// title: message,
// icon: 'none'
// });
// return false;
// }
if (status !== 200) {
uni.showToast({
title: message,
icon: 'none'
});
return false;
}
return res;
// if(res.code == 200) {
// // res为服务端返回值,可能有code,result等字段

@ -55,7 +55,7 @@ const repair = [{
}, {
iconPath: "setting",
selectedIconPath: "setting-fill",
text: "维任务",
text: "维任务",
pagePath: "/pages/inspection/quest",
}, {
iconPath: "account",

@ -2,51 +2,12 @@
* 全局配置文件
*/
export default {
baseUrl:'http://124.221.142.15:8088/lab',
title: "",
logo: "S",
key: "saber", //配置主键,目前用于存储
// baseUrl: 'http://124.221.142.15:8088/lab',
baseUrl:'http://192.168.0.111:80',
indexTitle: "科研医疗建筑运维平台",
clientId: "saber", // 客户端id
clientSecret: "saber_secret", // 客户端密钥
tenantMode: true, // 是否开启租户模式
tenantId: "000000", // 管理组租户编号
captchaMode: true, // 是否开启验证码模式
switchMode: false, // 是否开启部门切换模式
lockPage: "/lock",
tokenTime: 3000,
tokenHeader: "Blade-Auth",
//http的status默认放行列表
statusWhiteList: [],
//配置首页不可关闭
isFirstPage: false,
fistPage: {
label: "首页",
value: "/wel/index",
params: {},
query: {},
meta: {
i18n: "dashboard",
},
group: [],
close: false,
},
//配置菜单的属性
menu: {
iconDefault: "iconfont icon-caidan",
props: {
label: "name",
path: "path",
icon: "source",
children: "children",
},
},
// 第三方系统授权地址
authUrl: "http://localhost/blade-auth/oauth/render",
// 报表设计器地址(cloud端口为8108,boot端口为80)
reportUrl: "http://localhost:8108/ureport",
// 单点登录系统认证(blade-auth服务的地)
ssoUrl: "http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=",
// 单点登录回调地址(Saber服务的地址)
redirectUri: "http://localhost:1888",
};
Loading…
Cancel
Save