Compare commits

...

3 Commits

Author SHA1 Message Date
许允枞
23ce4633a9 更新检测员工相关 2025-02-06 10:03:16 +08:00
许允枞
e738661bdc Merge remote-tracking branch 'origin/master'
# Conflicts:
#	pages.json
#	pages/index/orderdetails.vue
#	pages/staff/staff.vue
2025-01-22 10:33:51 +08:00
许允枞
e9f63a1fff 更新 2024-11-27 17:55:42 +08:00
7 changed files with 1000 additions and 105 deletions

View File

@ -0,0 +1,181 @@
<template>
<view>
<u-popup :show="show" @close="cancel">
<view class="title">{{ popupTitle }}</view>
<view style="padding: 20rpx;">
<u-search v-if="showSearch" @custom="search" @search="search" :placeholder="placeholder"
v-model="keyword"></u-search>
<u-gap v-if="showSearch" height="15"></u-gap>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="$emit('lower')">
<!--单选-->
<u-radio-group v-if="type == 'radio'" :borderBottom="true" iconPlacement="right" placement="column"
@change="groupChange" v-model="radioValue">
<u-radio :customStyle="{marginBottom: '12px'}" v-for="(item, index) in dataLists" :key="index"
:label="item[name]" :name="index">
</u-radio>
</u-radio-group>
<!--多选-->
<u-checkbox-group v-if="type == 'checkbox'" :borderBottom="true" placement="column"
iconPlacement="right" @change="checkboxChange" v-model="checkboxValue">
<u-checkbox :customStyle="{marginBottom: '12px',paddingBottom:'12px'}"
v-for="(item, index) in dataLists" :key="index" :label="item[name]" :name="index">
</u-checkbox>
</u-checkbox-group>
</scroll-view>
<u-gap height="45"></u-gap>
<view class="bottons">
<u-row>
<u-col customStyle="padding:0 10rpx 20rpx 20rpx" span="6">
<u-button @click="cancel">取消</u-button>
</u-col>
<u-col customStyle="padding:0 20rpx 20rpx 10rpx" span="6">
<u-button @click="submit" type="primary" throttleTime="1000"
:disabled="(JSON.stringify(radioData) === '{}') && (checkboxData.length === 0)">确认
</u-button>
</u-col>
</u-row>
</view>
</view>
</u-popup>
</view>
</template>
<script>
/**
* 公共选择下拉框基于uview支持下拉加载列表搜索单选多选
* @author qianziyu
* @description 弹出层选择器基于uview中u-popup实现
* @property {Array} dataLists 数据列表
* @property {String} name 列表显示的字段名
* @property {Boolean} show 是否展示弹窗 (默认 false )
* @property {String} type 选择类型 单选多选 (默认 单选 )
* @property {Boolean} showSearch 是否显示搜索框 (默认 true )
* @property {String} popupTitle 列表标题
* @property {String} placeholder 搜索框placeholder
* @event {Function} search 搜索事件返回keyword
* @event {Function} lower 滑动到底部触发用于下拉加载新数据
* @event {Function} cancel 组件关闭事件
* @event {Function} submit 提交按钮,返回选中的列表数据
* @example <common-select :show="show" :popupTitle="popupTitle" @cancel="show=false" @search="selectSearch" name="cworkStationName" @submit="onsubmit"
:dataLists="dataLists" placeholder="输入工站名称搜索"></common-select>
*/
export default {
name: "qianziyu-select",
props: {
dataLists: {
default: {},
type: Array
},
name: {
default: 'name',
},
show: {
default: false,
type: Boolean
},
type: {
default: 'radio',
type: String
},
showSearch: {
default: true,
type: Boolean
},
popupTitle: {
default: '列表选择',
type: String
},
placeholder: {
default: '请输入搜索内容'
},
checkboxData: { // prop
default: () => [], //
type: Array
}
},
data() {
return {
keyword: '',
scrollTop: 0,
checkboxValue: [],
radioData: {},
radioValue: '',
// checkboxData: this.checkboxData, // checkboxData
};
},
watch: {
checkboxData(newVal) {
// checkboxData checkboxValue使
this.checkboxValue = newVal.map(item => {
return this.dataLists.findIndex(listItem => listItem[this.name] === item[this.name]);
});
}
},
methods: {
checkboxChange(n) {
const newCheckboxData = [];
n.forEach(key => {
newCheckboxData.push(this.dataLists[key]);
});
this.$emit('update:checkboxData', newCheckboxData); // checkboxData
},
//
groupChange(n) {
this.radioData = this.dataLists[n]
},
//
search() {
this.$emit('search', this.keyword)
},
//
cancel() {
this.$emit('cancel')
},
//
submit() {
if (this.type == 'radio') {
if (JSON.stringify(this.radioData) == '{}') {
uni.$u.toast('请选择数据')
return;
}
this.$emit('submit', this.radioData)
} else if (this.type == 'checkbox') {
if (this.checkboxData.length == 0) {
uni.$u.toast('请选择数据')
return;
}
this.$emit('submit', this.checkboxData)
}
}
}
}
</script>
<style lang="scss" scoped>
.u-popup {
.title {
border-bottom: 1px solid #f7f7f7;
padding: 20rpx;
text-align: center;
font-weight: bold;
}
}
.scroll-Y {
height: 650rpx;
}
.bottons {
background-color: white;
position: fixed;
left: 0;
bottom: 0;
right: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
}
</style>

View File

@ -96,7 +96,7 @@
</view>
<view class="on-input">
<view class="s-huix">身份证号</view>
<view class=""><input v-model="idNumber" type="text" placeholder="请输入身份证号"></view>
<view class=""><input v-model="idCard" type="text" placeholder="请输入身份证号"></view>
</view>
<view class="on-input">
<view class="s-huix">入职时间</view>
@ -113,6 +113,13 @@
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
placeholder="请选择购买保险时间"></view>
</view>
<view class="on-input">
<view class="s-huix">驾照类型</view>
<view class="" @click="showDriveType = true">
<input disabled :value="driverLicenseTypeArrStr" type="text"
placeholder="请选择驾照类型">
</view>
</view>
<view class="on-input">
<view class="s-huix">附件</view>
<view class="" @click="addFile"><input disabled type="text" placeholder="添加附件"></view>
@ -160,7 +167,7 @@
<u-datetime-picker
:show="showJoinedDate"
v-model="joinedDate"
v-model="joinDate"
@cancel="showJoinedDate = false"
@confirm="chooseJoinDate"
mode="date"
@ -168,7 +175,7 @@
></u-datetime-picker>
<u-datetime-picker
:show="showFormalDate"
v-model="formalDate"
v-model="probationPeriod"
@cancel="showFormalDate = false"
@confirm="chooseFormalDate"
mode="date"
@ -176,12 +183,24 @@
></u-datetime-picker>
<u-datetime-picker
:show="showSafeDate"
v-model="safeDate"
v-model="socialSecurityBuyDate"
@cancel="showSafeDate = false"
@confirm="chooseSafeDate"
mode="date"
return-type='string'
></u-datetime-picker>
<qianziyu-select
:show="showDriveType"
type="checkbox"
name="id"
:dataLists="driverLicenseType"
:showSearch=false
@cancel="showDriveType = false"
:checkboxData="driverLicenseTypeArr"
@submit="onsubmit"
@update:checkboxData="driverLicenseTypeArr = $event"
>
</qianziyu-select>
</view>
</template>
@ -218,7 +237,6 @@ export default {
show: false,
realName: "",
phoneNum: "",
idCard: "",
workName: "",
workids: [],
postid: '',
@ -228,20 +246,25 @@ export default {
addRoleId: undefined,
education: null,
educationText: null,
idNumber: null,
joinedDate: null,
formalDate: null,
safeDate: null,
idCard: null,
joinDate: null,
probationPeriod: null,
socialSecurityBuyDate: null,
educations: [],
showEducation: false,
showJoinedDate: false,
showFormalDate: false,
showSafeDate: false,
files: []
files: [],
showDriveType: false,
driverLicenseType: [],
driverLicenseTypeArr: [],
driverLicenseTypeArrStr: null
}
},
onLoad() {
this.getDriveType()
this.gettab()
},
onPullDownRefresh() {
uni.showLoading()
@ -262,23 +285,22 @@ export default {
}
},
onShow() {
this.gettab()
// this.baseUrl = this.$baseUrl
this.partnerId = uni.getStorageSync('partnerId')
// this.getindex()
},
computed: {
formattedJoinedDate() {
if (!this.joinedDate) return '';
return formatDate(this.joinedDate); // formatDate'yyyy-MM-dd'
if (!this.joinDate) return '';
return formatDate(this.joinDate); // formatDate'yyyy-MM-dd'
},
formattedFormalDate() {
if (!this.formalDate) return '';
return formatDate(this.formalDate); // formatDate'yyyy-MM-dd'
if (!this.probationPeriod) return '';
return formatDate(this.probationPeriod); // formatDate'yyyy-MM-dd'
},
formattedSafeDate() {
if (!this.safeDate) return '';
return formatDate(this.safeDate); // formatDate'yyyy-MM-dd'
if (!this.socialSecurityBuyDate) return '';
return formatDate(this.socialSecurityBuyDate); // formatDate'yyyy-MM-dd'
},
},
methods: {
@ -291,6 +313,15 @@ export default {
this.files[index].fileUrl = config.baseImageUrl + "/" + res.data.url
})
},
getDriveType() {
return request({
url: '/common/down/getDriverLicenseType',
method: 'get'
}).then(res => {
//id
this.driverLicenseType = res.data
})
},
deletedUrl(index) {
this.files.splice(index, 1)
},
@ -303,15 +334,15 @@ export default {
}
},
chooseJoinDate(e) {
this.joinedDate = formatDate(e.value)
this.joinDate = formatDate(e.value)
this.showJoinedDate = false
},
chooseFormalDate(e) {
this.formalDate = formatDate(e.value)
this.probationPeriod = formatDate(e.value)
this.showFormalDate = false
},
chooseSafeDate(e) {
this.safeDate = formatDate(e.value)
this.socialSecurityBuyDate = formatDate(e.value)
this.showSafeDate = false
},
chooseEducation(e) {
@ -334,6 +365,13 @@ export default {
this.gwindex = index
this.gwid = id
},
onsubmit(selectedData) {
console.log('提交的数据:', selectedData);
selectedData.map(item => item.id);
this.driverLicenseTypeArr = selectedData;
this.driverLicenseTypeArrStr = selectedData.map(item => item.id).join(',');
this.showDriveType = false; //
},
async gettab() {
let res = await request({
url: '/system/role/pageByQuery',
@ -461,6 +499,8 @@ export default {
title: "操作成功",
})
this.pageNum = 1
this.goodsList = []
this.getindex()
}
},
@ -483,10 +523,17 @@ export default {
status: 0,
userType: '01',
roleId: this.gwid,
name: this.realName,
joinDate: this.joinDate,
idCard: this.idCard,
educational: this.educationText,
probationPeriod: this.probationPeriod,
socialSecurityBuyDate: this.socialSecurityBuyDate,
driverLicenseTypeArr: this.driverLicenseTypeArr.map(item => item.id),
password: '123456'
}
let res = await request({
url: '/system/user/create',
url: '/inspectionStaff/save',
method: 'post',
data: data
})
@ -502,26 +549,6 @@ export default {
roleIds: roleIds
}
})
const staffData = {
userId: res.data,
name: this.realName,
tel: this.phoneNum,
joinedDate: this.joinedDate,
idNumber: this.idNumber,
education: this.education,
formalDate: this.formalDate,
safeDate: this.safeDate,
fileNames: this.files.length > 0 ? this.files.map(item => item.name).join(",") : "",
fileUrls: this.files.length > 0 ? this.files.map(item => {
return item.fileUrl.replace(config.baseImageUrl + "/", "")
}).join(",") : ""
}
const staffRes = await request({
url: '/company/staff/updateByExistUser',
method: 'post',
data: staffData
})
uni.showToast({
title: "添加成功"
})

View File

@ -168,7 +168,7 @@
},
viewFile(filePath){
uni.downloadFile({
url: this.$baseImageUrl+filePath,
url: this.$baseImageUrl+'/'+filePath,
success: function (res) {
var filePath = res.tempFilePath;
uni.openDocument({

View File

@ -10,20 +10,20 @@
<view class="ail">
<view class="on-input">
<view class="s-huix">姓名</view>
<view class=""><input v-model="staff.name" type="text" placeholder="请输入姓名"></view>
<view class=""><input v-model="staff.nickname" type="text" placeholder="请输入姓名"></view>
</view>
<view class="on-input">
<view class="s-huix">电话</view>
<view class=""><input v-model="staff.tel" type="text" placeholder="请输入手机号"></view>
<view class=""><input v-model="staff.mobile" type="text" placeholder="请输入手机号"></view>
</view>
<view class="on-input">
<view class="s-huix">学历</view>
<view class="" @click="showEducation = true"><input disabled :value="getEducation" type="text"
placeholder="请选择学历"></view>
placeholder="请选择学历" v-model="staff.educational"></view>
</view>
<view class="on-input">
<view class="s-huix">身份证号</view>
<view class=""><input v-model="staff.idNumber" type="text" placeholder="请输入身份证号"></view>
<view class=""><input v-model="staff.idCard" type="text" placeholder="请输入身份证号"></view>
</view>
<view class="on-input">
<view class="s-huix">入职时间</view>
@ -40,17 +40,25 @@
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
placeholder="请选择购买保险时间"></view>
</view>
<view class="on-input">
<view class="s-huix">驾照类型</view>
<view class="" @click="showDriveType = true">
<input disabled :value="driverLicenseTypeArrStr" type="text"
placeholder="请选择驾照类型">
</view>
</view>
<view class="">
<view style="display: flex;justify-content: space-between;margin: 1rem auto">
<view class="s-huix" style="text-align: left">附件</view>
<view class="" style="color: #3391ff" @click="addFile">添加附件</view>
</view>
<view v-for="(item, index) in files" style="margin-bottom: 1rem;border-bottom: 1px solid #DAE1F8;">
<view v-for="(item, index) in files" :key="fileKey + index" style="margin-bottom: 1rem;border-bottom: 1px solid #DAE1F8;">
<view class="on-input">
<view class="s-huix">名称</view>
<view class=""><input v-model="item.fileName" type="text" placeholder="请输入附件名称"></view>
<view class=""><input v-model="item.name" type="text" placeholder="请输入附件名称"></view>
</view>
<u-upload v-if="!item.fileUrl"
<u-upload v-if="!item.url"
@afterRead="uploadFilePromise($event, index)"
name="6"
multiple
@ -60,7 +68,7 @@
>
</u-upload>
<view v-else class="image-container">
<image :src="item.fileUrl" style="width: 100%;height: 140px;"></image>
<image :src="baseImageUrl + '/' + item.url" style="width: 100%;height: 140px;"></image>
<view @click="deletedUrl(index)" class="close-button">
<text>x</text>
</view>
@ -78,7 +86,7 @@
<u-datetime-picker
:show="showJoinedDate"
v-model="staff.joinedDate"
v-model="staff.joinDate"
@cancel="showJoinedDate = false"
@confirm="chooseJoinDate"
mode="date"
@ -86,7 +94,7 @@
></u-datetime-picker>
<u-datetime-picker
:show="showFormalDate"
v-model="staff.formalDate"
v-model="staff.probationPeriod"
@cancel="showFormalDate = false"
@confirm="chooseFormalDate"
mode="date"
@ -94,12 +102,24 @@
></u-datetime-picker>
<u-datetime-picker
:show="showSafeDate"
v-model="staff.safeDate"
v-model="staff.socialSecurityBuyDate"
@cancel="showSafeDate = false"
@confirm="chooseSafeDate"
mode="date"
return-type='string'
></u-datetime-picker>
<qianziyu-select
:show="showDriveType"
type="checkbox"
name="id"
:dataLists="driverLicenseType"
:showSearch=false
@cancel="showDriveType = false"
:checkboxData="driverLicenseTypeArr"
@submit="onsubmit"
@update:checkboxData="driverLicenseTypeArr = $event"
>
</qianziyu-select>
</view>
</template>
@ -111,8 +131,8 @@ import upload from '@/utils/upload.js'
export default {
name: "StaffInfo",
data(){
return{
data() {
return {
userId: null,
staff: {},
user: {},
@ -122,58 +142,71 @@ export default {
showJoinedDate: false,
showFormalDate: false,
showSafeDate: false,
topName: null
showDriveType: false,
topName: null,
driverLicenseTypeArr: [],
driverLicenseType: [],
driverLicenseTypeArrStr: null,
baseImageUrl: config.baseImageUrl,
fileKey: 0, // key
}
},
onLoad(data){
if (data.id){
onLoad(data) {
if (data.id) {
this.userId = data.id
this.getInfoByUserId()
this.getDriveType()
}
},
computed:{
getEducation(){
if (!this.educations || this.educations.length === 0){
computed: {
getEducation() {
if (!this.educations || this.educations.length === 0) {
this.getEducations()
}
const index = this.educations.findIndex(item => item.value === this.staff.education)
if (index !== -1){
if (index !== -1) {
return this.educations[index].label
}
return ''
},
formattedJoinedDate() {
if (!this.staff.joinedDate) return '';
return formatDate(this.staff.joinedDate); // formatDate'yyyy-MM-dd'
if (!this.staff.joinDate) return '';
return formatDate(this.staff.joinDate); // formatDate'yyyy-MM-dd'
},
formattedFormalDate() {
if (!this.staff.formalDate) return '';
return formatDate(this.staff.formalDate); // formatDate'yyyy-MM-dd'
if (!this.staff.probationPeriod) return '';
return formatDate(this.staff.probationPeriod); // formatDate'yyyy-MM-dd'
},
formattedSafeDate() {
if (!this.staff.safeDate) return '';
return formatDate(this.staff.safeDate); // formatDate'yyyy-MM-dd'
if (!this.staff.socialSecurityBuyDate) return '';
return formatDate(this.staff.socialSecurityBuyDate); // formatDate'yyyy-MM-dd'
},
},
methods:{
getyadd(){
if (!this.staff.name || !this.staff.tel) {
methods: {
getyadd() {
if (!this.staff.nickname || !this.staff.mobile) {
uni.showToast({
title: '姓名和电话不能有空',
icon: 'none'
})
return
}
//
if (this.staff.probationPeriod) {
this.staff.probationPeriod = formatDate(this.staff.probationPeriod);
}
this.staff.userId = this.userId
console.log(this.staff)
const data = {
...this.staff,
fileNames: this.files.length > 0 ? this.files.map(item => item.fileName).join(",") : null,
fileUrls: this.files.length > 0 ? this.files.map(item => {
return item.fileUrl.replace(config.baseImageUrl + "/", "")
}).join(",") : null
fileList: this.files,
driverLicenseType: this.driverLicenseTypeArrStr,
driverLicenseTypeArr: this.driverLicenseTypeArr.map(item => item.id)
}
request({
url: '/company/staff/updateByExistUser',
method: 'post',
url: '/inspectionStaff/update',
method: 'put',
data: data
}).then(res => {
uni.showToast({
@ -182,6 +215,9 @@ export default {
this.getInfoByUserId()
})
},
forceRefreshFiles() {
this.fileKey += 1; // key
},
addFile() {
if (this.files.length === 0 || this.files[0].fileUrl !== null) {
this.files.unshift({
@ -196,8 +232,10 @@ export default {
filePath: event.file[0].url,
}).then((res) => {
this.files[index].name = event.file[0].name
this.files[index].fileUrl = config.baseImageUrl + "/" + res.data.url
this.files[index].url = res.data.url
this.forceRefreshFiles(); //
})
console.log(this.files)
},
deletedUrl(index) {
this.files.splice(index, 1)
@ -207,49 +245,76 @@ export default {
this.showJoinedDate = false
},
chooseFormalDate(e) {
this.staff.formalDate = formatDate(e.value)
this.showFormalDate = false
const formattedDate = formatDate(e.value);
console.log('Formatted probationPeriod:', formattedDate); //
this.staff.probationPeriod = formattedDate;
console.log(this.staff.probationPeriod); //
this.showFormalDate = false;
},
chooseSafeDate(e) {
this.staff.safeDate = formatDate(e.value)
this.staff.socialSecurityBuyDate = formatDate(e.value)
this.showSafeDate = false
},
chooseEducation(e) {
this.$set(this.staff, 'education', e.value[0].value)
this.$set(this.staff, 'education', e.value[0].label)
// this.staff['education'] = e.value[0].value
// console.log('education', this.staff.education)
this.staff.educational = e.value[0].label
this.showEducation = false
},
async getEducations(){
async getEducations() {
this.educations = await getDictDataByType("company_staff_edu")
},
async getInfoByUserId(){
async getInfoByUserId() {
const res = await request({
url: '/company/staff/getByUserId?id=' + this.userId,
url: '/inspectionStaff/get',
params: {
id: this.userId
},
method: 'get'
})
const data = res.data
this.staff = data?.staff || this.staff
this.user = data?.user
this.topName = this.user?.nickname || this.staff?.name || this.user?.username
this.staff.name = this.user?.nickname || this.user?.username
if (!data?.staff){
this.staff.tel = this.user?.username || this.user?.mobile
this.staff.userId = this.user.id
this.staff = res.data
this.topName = this.staff?.nickname
if (res.data.driverLicenseType) {
this.driverLicenseTypeArrStr = res.data.driverLicenseType
res.data.driverLicenseTypeArr.forEach(item => {
let temp = {
id: item,
name: item
}
this.driverLicenseTypeArr.push(temp)
})
}
if (this?.staff?.fileNames){
if (this?.staff?.fileList) {
this.files = []
const names = this.staff.fileNames.split(",")
const urls = this.staff.fileUrls.split(",")
names.forEach((item, index) => {
this.staff.fileList.forEach((item) => {
const temp = {
fileName: item,
fileUrl: config.baseImageUrl + (urls[index][0] === "/" ? urls[index] : "/" + urls[index])
name: item.name,
url: item.url
}
this.files.push(temp)
})
}
},
getback(){
getDriveType() {
return request({
url: '/common/down/getDriverLicenseType',
method: 'get'
}).then(res => {
//id
this.driverLicenseType = res.data
})
},
onsubmit(selectedData) {
console.log('提交的数据:', selectedData);
selectedData.map(item => item.id);
this.driverLicenseTypeArr = selectedData;
this.driverLicenseTypeArrStr = selectedData.map(item => item.id).join(',');
this.showDriveType = false; //
},
getback() {
uni.navigateBack()
},
}
@ -263,7 +328,8 @@ export default {
height: calc(100vh);
background: white;
}
.c-top{
.c-top {
width: 100%;
box-sizing: border-box;
padding: 15px;
@ -273,15 +339,18 @@ export default {
align-items: center;
background-color: white;
}
.c-title{
.c-title {
font-size: 18px;
font-weight: bold
}
.ail{
.ail {
width: 100%;
box-sizing: border-box;
padding: 15px;
}
.on-input {
width: 100%;
display: flex;
@ -292,14 +361,17 @@ export default {
margin: 10px;
justify-content: space-between;
}
.on-input input {
text-align: right;
padding-right: 1rem
}
.s-huix {
width: 30%;
text-align: right;
}
.image-container {
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
width: 100%;

593
pages/staff/goReport.vue Normal file
View File

@ -0,0 +1,593 @@
<!-- 新增线下订单-->
<template>
<view class="content">
<view style="width: 100%; height: 44px;"></view>
<view class="top-heder">
<view class="t-left" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="t-title">
<text>{{ title }}</text>
</view>
<view class="t-you"></view>
</view>
<view class="mub">
<view class="top-ail">
<!-- 名称 -->
<view class="box-list">
<view class="list-box">
<view class="l-left">编号</view>
<view class="l-right">
<input type="text" v-model="data.id" placeholder="请输入编号">
</view>
</view>
<view class="list-box">
<view class="l-left">检验报告编号</view>
<view class="l-right">
<input type="text" v-model="data.reportId" placeholder="请输入检验报告编号">
</view>
</view>
<view class="list-box">
<view class="l-left">客户姓名</view>
<view class="l-right">
<input type="text" v-model="data.userName" placeholder="请输入客户姓名">
</view>
</view>
<view class="list-box">
<view class="l-left">车牌号</view>
<view class="l-right">
<input type="text" v-model="data.carNum" placeholder="请输入车牌号">
</view>
</view>
<view class="list-box">
<view class="l-left">VIN码</view>
<view class="l-right">
<input type="text" v-model="data.vin" placeholder="请输入VIN码">
</view>
</view>
<view class="list-box">
<view class="l-left">年份</view>
<view class="l-right">
<input type="text" v-model="data.year" placeholder="请输入年份">
</view>
</view>
<view class="list-box">
<view class="l-left">月份</view>
<view class="l-right">
<input type="text" v-model="data.month" placeholder="请输入月份">
</view>
</view>
<view class="list-box">
<view class="l-left"></view>
<view class="l-right">
<input type="text" v-model="data.day" placeholder="请输入日">
</view>
</view>
<view class="list-box">
<u-checkbox-group
v-model="data.checkboxValue"
placement="column"
@change="checkboxChange"
>
<u-checkbox
:customStyle="{marginBottom: '8px'}"
v-for="(item, index) in radiolist1"
:key="index"
:label="item.name"
:name="item.name"
>
</u-checkbox>
</u-checkbox-group>
</view>
</view>
<view class="dlanniu" @click="submit()">
<text>确认生成</text>
</view>
</view>
</view>
<!-- 底部 -->
</view>
</template>
<script>
import config from '@/config';
import request from '../../utils/request';
import upload from '@/utils/upload.js'
import {getToken, getTenantId} from '@/utils/auth'
export default {
data() {
return {
imagePath: '',
fileList: [],
title: '维护修理告知书',
customerSource: '',
data: '',
buyName: '',
nickname: '',
buyPhone: '',
userAddress: '',
carNum: '',
carStatus: '',
carIdNo: '',
radioValue: '0',
carModel: '',
carNature: '',
show: false,
shownature: false,
showgoods: false,
showxin: false,
showzhi: false,
showRecord: false,
showLeadMan: false,
skuId: 0,
inspectionWorkNodes: [],
defaultIndex: [0],
kehuDefaultIndex: [0],
goodsDefaultIndex: [0, 0],
columns: [],
options: [],
nature: [],
goodsone: [],
goodstwo: [],
columnData: [],
xinlist: [],
zhilist: [],
recordTime: Number(new Date()),
baseUrl: this.$baseImageUrl,
goodsId: '',
msg: '3',
tapnum: 0,
fenlist: [],
goodstext: '',
ftitle: null,
shopImages: [],
shoplist: {},
province: '',
unitName: '',
kehui: '',
naturetext: '',
customerData: [],
inspectionWorkNodeStr: "",
leadManId: undefined,
leadManList: [],
isInsert: true,
inspectionId: undefined,
submitRecordTime: undefined,
xinDefaultIndex: [0],
recordTimeStr: '',
//
radiolist1: [{
name: '《汽油车污染物排放限值及测量方法(双怠速法及简易工况法)》( GB 18285-2018)',
disabled: false,
label:'one'
},
{
name: '柴油车污染物排放限值及测量方法(自由加速法及加载加速法)》( GB 3847-2018规定的在用',
disabled: false,
label:'two'
},
{
name: '汽油车',
disabled: false
, label:'three'
}, {
name: '柴油车污染物排放限值要求',
disabled: false
, label:'four'
}
],
}
},
onLoad(options) {
if (options.inspectionInfoId) {
this.inspectionInfoId = options.inspectionInfoId
this.getData()
}
},
onShow() {
},
methods: {
getData() {
request({
url: '/system/info/getWordContent',
method: 'get',
params: {
id: this.inspectionInfoId
}
}).then(res => {
this.data = res.data
})
},
getback(){
uni.navigateBack()
},
checkboxChange(n) {
},
async submit() {
this.radiolist1.forEach(item => {
const flag = this.data.checkboxValue.indexOf(item.name) > -1 ? true : false
if (flag) {
this.data[item.label] = "√"
}else {
this.data[item.label] = "□"
}
})
request({
url: '/system/info/exportWord',
method: 'post',
data: this.data
}).then(res => {
console.log('word地址',this.$baseImageUrl + "/" + res.data)
})
},
//
async getgoods() {
let res = await request({
url: '/partnerOwn/partner/editPartnerInfo',
method: 'post',
data: this.shoplist
})
if (res.code == 200) {
uni.showToast({
title: "修改成功"
})
}
setTimeout(() => {
uni.navigateBack()
}, 2000);
},
},
computed: {
checkboxLabelClass() {
return 'checkbox-label';
}
}
}
</script>
<style scoped lang="scss">
.content {
box-sizing: border-box;
width: 100%;
height: calc(100vh);
background: white;
}
.top-heder {
width: 100%;
height: 46px;
background: white;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 5px 15px;
}
.t-title {
font-size: 17px;
font-weight: bold;
color: #333333;
}
.checkbox-label {
word-wrap: break-word;
word-break: break-all;
}
.t-left {
width: 10%;
}
.t-you {
height: 100%;
width: 20%;
}
.t-input {
width: 80%;
height: 36px;
background: #F0F0F0;
border-radius: 50px;
box-sizing: border-box;
padding: 0 15px;
display: flex;
align-items: center;
}
.top-ail {
width: 100%;
box-sizing: border-box;
padding: 15px;
background-color: #F4F4F4;
// height: calc(100vh);
}
.mub {
background-color: #F4F4F4;
height: calc(100vh);
}
.dix {
display: flex;
align-items: center;
}
.upimg {
width: 100%;
height: 126px;
border-radius: 8px;
box-sizing: border-box;
background-color: white;
image {
width: 100%;
height: 100%;
}
}
.box-list {
width: 100%;
border-radius: 8px;
box-sizing: border-box;
padding: 10px;
background-color: white;
margin: 10px auto;
}
.list-box {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 15px 5px;
border-bottom: 1px solid #EEEEEE;
}
.l-left {
font-size: 16px;
font-weight: 400;
color: #333333;
}
.l-right {
font-size: 16px;
font-weight: 400;
color: #999999;
text-align: right;
}
.xiaolan {
// width: 109px;
// height: 30px;
background: #E2EAFF;
border-radius: 50px;
display: flex;
align-content: center;
justify-self: center;
box-sizing: border-box;
padding: 5px;
font-size: 14px;
font-weight: 400;
color: #0D2E8D;
}
.xiaohui {
// width: 141px;
// height: 30px;
box-sizing: border-box;
padding: 0px 10px;
background: #F7F7F7;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
margin: 10px;
}
.hui-right {
border-left: 1px solid #DDDDDD;
padding: 5px;
margin-left: 5px;
}
.wrap-box {
width: 100%;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
}
.bottom-di {
width: 100%;
height: 56px;
background: #FFFFFF;
border-radius: 8px;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0px 20px;
margin-bottom: 10px;
}
.thui {
font-size: 16px;
font-weight: 400;
color: #666666;
margin-top: 10px;
margin-left: 8px;
}
.imgs {
box-sizing: border-box;
margin-top: 20px;
}
.p-box {
border-radius: 10px;
overflow: hidden;
box-sizing: border-box;
padding: 20px;
width: 100%;
background-color: white;
}
.p-top {
width: 100%;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #000000;
margin-bottom: 20px;
}
.on-input {
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
}
.ipt-kuang {
width: 70%;
height: 30px;
background: #FFFFFF;
border-radius: 8px 8px 8px 8px;
opacity: 1;
border: 1px solid #DDDDDD;
display: flex;
align-items: center;
margin: 10px auto;
box-sizing: border-box;
padding: 0px 10px;
}
.t-left {
width: 20%;
font-size: 14px;
font-weight: 400;
color: #000000;
}
.dlanniu {
width: 80%;
height: 45px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
margin: 20px auto;
color: white;
}
.da {
font-size: 16px;
}
//
.top {
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
border-radius: 10px;
margin: 10px auto;
background-color: white;
}
.top-box {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left {
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon {
width: 18px;
height: 18px;
border-radius: 4px;
color: white;
background: orangered;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-weight: bold;
margin-right: 6px;
}
.tb-right {
width: 20px;
height: 26px;
image {
width: 100%;
height: 100%;
}
}
.text1 {
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput {
width: 100%;
display: flex;
background: white;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.xixi {
font-size: 12px;
color: #0D2E8D;
margin-left: 10px;
}
</style>

View File

@ -49,6 +49,19 @@
</view>
</view>
</view>
<view class="ian-box">
<view class="on-input" @click="goWord()">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">word</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="ian-box">
<!-- <view class="on-input">
<view class="dix">
@ -182,6 +195,15 @@ export default {
url: "/pages/staff/goRoyalty"
})
},
goWord() {
request({
url: '/system/info/exportWord',
method: 'get',
params: {
id: 4400
}
})
},
getdianpu() {
uni.navigateTo({
url: "/pages/my/shoporder"

View File

@ -11,7 +11,7 @@ export async function getDictDataByType(type) {
const response = await request({
url: '/system/dict-data/type',
method: 'get',
params: { type }
params: {type}
});
data = response.data;
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间