Compare commits
3 Commits
89f32ff254
...
23ce4633a9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23ce4633a9 | ||
|
|
e738661bdc | ||
|
|
e9f63a1fff |
181
components/qianziyu-select/qianziyu-select.vue
Normal file
181
components/qianziyu-select/qianziyu-select.vue
Normal 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>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">身份证号:</view>
|
<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>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">入职时间:</view>
|
<view class="s-huix">入职时间:</view>
|
||||||
@ -113,6 +113,13 @@
|
|||||||
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
|
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
|
||||||
placeholder="请选择购买保险时间"></view>
|
placeholder="请选择购买保险时间"></view>
|
||||||
</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="on-input">
|
||||||
<view class="s-huix">附件:</view>
|
<view class="s-huix">附件:</view>
|
||||||
<view class="" @click="addFile"><input disabled type="text" placeholder="添加附件"></view>
|
<view class="" @click="addFile"><input disabled type="text" placeholder="添加附件"></view>
|
||||||
@ -160,7 +167,7 @@
|
|||||||
|
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showJoinedDate"
|
:show="showJoinedDate"
|
||||||
v-model="joinedDate"
|
v-model="joinDate"
|
||||||
@cancel="showJoinedDate = false"
|
@cancel="showJoinedDate = false"
|
||||||
@confirm="chooseJoinDate"
|
@confirm="chooseJoinDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
@ -168,7 +175,7 @@
|
|||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showFormalDate"
|
:show="showFormalDate"
|
||||||
v-model="formalDate"
|
v-model="probationPeriod"
|
||||||
@cancel="showFormalDate = false"
|
@cancel="showFormalDate = false"
|
||||||
@confirm="chooseFormalDate"
|
@confirm="chooseFormalDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
@ -176,12 +183,24 @@
|
|||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showSafeDate"
|
:show="showSafeDate"
|
||||||
v-model="safeDate"
|
v-model="socialSecurityBuyDate"
|
||||||
@cancel="showSafeDate = false"
|
@cancel="showSafeDate = false"
|
||||||
@confirm="chooseSafeDate"
|
@confirm="chooseSafeDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
return-type='string'
|
return-type='string'
|
||||||
></u-datetime-picker>
|
></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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -218,7 +237,6 @@ export default {
|
|||||||
show: false,
|
show: false,
|
||||||
realName: "",
|
realName: "",
|
||||||
phoneNum: "",
|
phoneNum: "",
|
||||||
idCard: "",
|
|
||||||
workName: "",
|
workName: "",
|
||||||
workids: [],
|
workids: [],
|
||||||
postid: '',
|
postid: '',
|
||||||
@ -228,20 +246,25 @@ export default {
|
|||||||
addRoleId: undefined,
|
addRoleId: undefined,
|
||||||
education: null,
|
education: null,
|
||||||
educationText: null,
|
educationText: null,
|
||||||
idNumber: null,
|
idCard: null,
|
||||||
joinedDate: null,
|
joinDate: null,
|
||||||
formalDate: null,
|
probationPeriod: null,
|
||||||
safeDate: null,
|
socialSecurityBuyDate: null,
|
||||||
educations: [],
|
educations: [],
|
||||||
showEducation: false,
|
showEducation: false,
|
||||||
showJoinedDate: false,
|
showJoinedDate: false,
|
||||||
showFormalDate: false,
|
showFormalDate: false,
|
||||||
showSafeDate: false,
|
showSafeDate: false,
|
||||||
files: []
|
files: [],
|
||||||
|
showDriveType: false,
|
||||||
|
driverLicenseType: [],
|
||||||
|
driverLicenseTypeArr: [],
|
||||||
|
driverLicenseTypeArrStr: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.getDriveType()
|
||||||
|
this.gettab()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
@ -262,23 +285,22 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.gettab()
|
|
||||||
// this.baseUrl = this.$baseUrl
|
// this.baseUrl = this.$baseUrl
|
||||||
this.partnerId = uni.getStorageSync('partnerId')
|
this.partnerId = uni.getStorageSync('partnerId')
|
||||||
// this.getindex()
|
// this.getindex()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formattedJoinedDate() {
|
formattedJoinedDate() {
|
||||||
if (!this.joinedDate) return '';
|
if (!this.joinDate) return '';
|
||||||
return formatDate(this.joinedDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.joinDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
formattedFormalDate() {
|
formattedFormalDate() {
|
||||||
if (!this.formalDate) return '';
|
if (!this.probationPeriod) return '';
|
||||||
return formatDate(this.formalDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.probationPeriod); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
formattedSafeDate() {
|
formattedSafeDate() {
|
||||||
if (!this.safeDate) return '';
|
if (!this.socialSecurityBuyDate) return '';
|
||||||
return formatDate(this.safeDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.socialSecurityBuyDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -291,6 +313,15 @@ export default {
|
|||||||
this.files[index].fileUrl = config.baseImageUrl + "/" + res.data.url
|
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) {
|
deletedUrl(index) {
|
||||||
this.files.splice(index, 1)
|
this.files.splice(index, 1)
|
||||||
},
|
},
|
||||||
@ -303,15 +334,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
chooseJoinDate(e) {
|
chooseJoinDate(e) {
|
||||||
this.joinedDate = formatDate(e.value)
|
this.joinDate = formatDate(e.value)
|
||||||
this.showJoinedDate = false
|
this.showJoinedDate = false
|
||||||
},
|
},
|
||||||
chooseFormalDate(e) {
|
chooseFormalDate(e) {
|
||||||
this.formalDate = formatDate(e.value)
|
this.probationPeriod = formatDate(e.value)
|
||||||
this.showFormalDate = false
|
this.showFormalDate = false
|
||||||
},
|
},
|
||||||
chooseSafeDate(e) {
|
chooseSafeDate(e) {
|
||||||
this.safeDate = formatDate(e.value)
|
this.socialSecurityBuyDate = formatDate(e.value)
|
||||||
this.showSafeDate = false
|
this.showSafeDate = false
|
||||||
},
|
},
|
||||||
chooseEducation(e) {
|
chooseEducation(e) {
|
||||||
@ -334,6 +365,13 @@ export default {
|
|||||||
this.gwindex = index
|
this.gwindex = index
|
||||||
this.gwid = id
|
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() {
|
async gettab() {
|
||||||
let res = await request({
|
let res = await request({
|
||||||
url: '/system/role/pageByQuery',
|
url: '/system/role/pageByQuery',
|
||||||
@ -461,6 +499,8 @@ export default {
|
|||||||
title: "操作成功",
|
title: "操作成功",
|
||||||
|
|
||||||
})
|
})
|
||||||
|
this.pageNum = 1
|
||||||
|
this.goodsList = []
|
||||||
this.getindex()
|
this.getindex()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -483,10 +523,17 @@ export default {
|
|||||||
status: 0,
|
status: 0,
|
||||||
userType: '01',
|
userType: '01',
|
||||||
roleId: this.gwid,
|
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'
|
password: '123456'
|
||||||
}
|
}
|
||||||
let res = await request({
|
let res = await request({
|
||||||
url: '/system/user/create',
|
url: '/inspectionStaff/save',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -502,26 +549,6 @@ export default {
|
|||||||
roleIds: roleIds
|
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({
|
uni.showToast({
|
||||||
title: "添加成功"
|
title: "添加成功"
|
||||||
})
|
})
|
||||||
|
|||||||
@ -168,7 +168,7 @@
|
|||||||
},
|
},
|
||||||
viewFile(filePath){
|
viewFile(filePath){
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: this.$baseImageUrl+filePath,
|
url: this.$baseImageUrl+'/'+filePath,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
var filePath = res.tempFilePath;
|
var filePath = res.tempFilePath;
|
||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
|
|||||||
@ -10,20 +10,20 @@
|
|||||||
<view class="ail">
|
<view class="ail">
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">姓名:</view>
|
<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>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">电话:</view>
|
<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>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">学历:</view>
|
<view class="s-huix">学历:</view>
|
||||||
<view class="" @click="showEducation = true"><input disabled :value="getEducation" type="text"
|
<view class="" @click="showEducation = true"><input disabled :value="getEducation" type="text"
|
||||||
placeholder="请选择学历"></view>
|
placeholder="请选择学历" v-model="staff.educational"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">身份证号:</view>
|
<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>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<view class="s-huix">入职时间:</view>
|
<view class="s-huix">入职时间:</view>
|
||||||
@ -40,17 +40,25 @@
|
|||||||
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
|
<view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
|
||||||
placeholder="请选择购买保险时间"></view>
|
placeholder="请选择购买保险时间"></view>
|
||||||
</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 class="">
|
||||||
<view style="display: flex;justify-content: space-between;margin: 1rem auto">
|
<view style="display: flex;justify-content: space-between;margin: 1rem auto">
|
||||||
<view class="s-huix" style="text-align: left">附件:</view>
|
<view class="s-huix" style="text-align: left">附件:</view>
|
||||||
<view class="" style="color: #3391ff" @click="addFile">添加附件</view>
|
<view class="" style="color: #3391ff" @click="addFile">添加附件</view>
|
||||||
</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="on-input">
|
||||||
<view class="s-huix">名称:</view>
|
<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>
|
</view>
|
||||||
<u-upload v-if="!item.fileUrl"
|
<u-upload v-if="!item.url"
|
||||||
@afterRead="uploadFilePromise($event, index)"
|
@afterRead="uploadFilePromise($event, index)"
|
||||||
name="6"
|
name="6"
|
||||||
multiple
|
multiple
|
||||||
@ -60,7 +68,7 @@
|
|||||||
>
|
>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
<view v-else class="image-container">
|
<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">
|
<view @click="deletedUrl(index)" class="close-button">
|
||||||
<text>x</text>
|
<text>x</text>
|
||||||
</view>
|
</view>
|
||||||
@ -78,7 +86,7 @@
|
|||||||
|
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showJoinedDate"
|
:show="showJoinedDate"
|
||||||
v-model="staff.joinedDate"
|
v-model="staff.joinDate"
|
||||||
@cancel="showJoinedDate = false"
|
@cancel="showJoinedDate = false"
|
||||||
@confirm="chooseJoinDate"
|
@confirm="chooseJoinDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
@ -86,7 +94,7 @@
|
|||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showFormalDate"
|
:show="showFormalDate"
|
||||||
v-model="staff.formalDate"
|
v-model="staff.probationPeriod"
|
||||||
@cancel="showFormalDate = false"
|
@cancel="showFormalDate = false"
|
||||||
@confirm="chooseFormalDate"
|
@confirm="chooseFormalDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
@ -94,12 +102,24 @@
|
|||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showSafeDate"
|
:show="showSafeDate"
|
||||||
v-model="staff.safeDate"
|
v-model="staff.socialSecurityBuyDate"
|
||||||
@cancel="showSafeDate = false"
|
@cancel="showSafeDate = false"
|
||||||
@confirm="chooseSafeDate"
|
@confirm="chooseSafeDate"
|
||||||
mode="date"
|
mode="date"
|
||||||
return-type='string'
|
return-type='string'
|
||||||
></u-datetime-picker>
|
></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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -111,8 +131,8 @@ import upload from '@/utils/upload.js'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "StaffInfo",
|
name: "StaffInfo",
|
||||||
data(){
|
data() {
|
||||||
return{
|
return {
|
||||||
userId: null,
|
userId: null,
|
||||||
staff: {},
|
staff: {},
|
||||||
user: {},
|
user: {},
|
||||||
@ -122,58 +142,71 @@ export default {
|
|||||||
showJoinedDate: false,
|
showJoinedDate: false,
|
||||||
showFormalDate: false,
|
showFormalDate: false,
|
||||||
showSafeDate: false,
|
showSafeDate: false,
|
||||||
topName: null
|
showDriveType: false,
|
||||||
|
topName: null,
|
||||||
|
driverLicenseTypeArr: [],
|
||||||
|
driverLicenseType: [],
|
||||||
|
driverLicenseTypeArrStr: null,
|
||||||
|
baseImageUrl: config.baseImageUrl,
|
||||||
|
fileKey: 0, // 初始化 key 值
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(data){
|
onLoad(data) {
|
||||||
if (data.id){
|
if (data.id) {
|
||||||
this.userId = data.id
|
this.userId = data.id
|
||||||
this.getInfoByUserId()
|
this.getInfoByUserId()
|
||||||
|
this.getDriveType()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed: {
|
||||||
getEducation(){
|
getEducation() {
|
||||||
if (!this.educations || this.educations.length === 0){
|
if (!this.educations || this.educations.length === 0) {
|
||||||
this.getEducations()
|
this.getEducations()
|
||||||
}
|
}
|
||||||
const index = this.educations.findIndex(item => item.value === this.staff.education)
|
const index = this.educations.findIndex(item => item.value === this.staff.education)
|
||||||
if (index !== -1){
|
if (index !== -1) {
|
||||||
return this.educations[index].label
|
return this.educations[index].label
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
formattedJoinedDate() {
|
formattedJoinedDate() {
|
||||||
if (!this.staff.joinedDate) return '';
|
if (!this.staff.joinDate) return '';
|
||||||
return formatDate(this.staff.joinedDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.staff.joinDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
formattedFormalDate() {
|
formattedFormalDate() {
|
||||||
if (!this.staff.formalDate) return '';
|
if (!this.staff.probationPeriod) return '';
|
||||||
return formatDate(this.staff.formalDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.staff.probationPeriod); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
formattedSafeDate() {
|
formattedSafeDate() {
|
||||||
if (!this.staff.safeDate) return '';
|
if (!this.staff.socialSecurityBuyDate) return '';
|
||||||
return formatDate(this.staff.safeDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
return formatDate(this.staff.socialSecurityBuyDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
getyadd(){
|
getyadd() {
|
||||||
if (!this.staff.name || !this.staff.tel) {
|
if (!this.staff.nickname || !this.staff.mobile) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '姓名和电话不能有空',
|
title: '姓名和电话不能有空',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 手动格式化日期字段,确保是格式化后的字符串
|
||||||
|
if (this.staff.probationPeriod) {
|
||||||
|
this.staff.probationPeriod = formatDate(this.staff.probationPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.staff.userId = this.userId
|
||||||
|
console.log(this.staff)
|
||||||
const data = {
|
const data = {
|
||||||
...this.staff,
|
...this.staff,
|
||||||
fileNames: this.files.length > 0 ? this.files.map(item => item.fileName).join(",") : null,
|
fileList: this.files,
|
||||||
fileUrls: this.files.length > 0 ? this.files.map(item => {
|
driverLicenseType: this.driverLicenseTypeArrStr,
|
||||||
return item.fileUrl.replace(config.baseImageUrl + "/", "")
|
driverLicenseTypeArr: this.driverLicenseTypeArr.map(item => item.id)
|
||||||
}).join(",") : null
|
|
||||||
}
|
}
|
||||||
request({
|
request({
|
||||||
url: '/company/staff/updateByExistUser',
|
url: '/inspectionStaff/update',
|
||||||
method: 'post',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -182,6 +215,9 @@ export default {
|
|||||||
this.getInfoByUserId()
|
this.getInfoByUserId()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
forceRefreshFiles() {
|
||||||
|
this.fileKey += 1; // 改变 key 值以强制刷新组件
|
||||||
|
},
|
||||||
addFile() {
|
addFile() {
|
||||||
if (this.files.length === 0 || this.files[0].fileUrl !== null) {
|
if (this.files.length === 0 || this.files[0].fileUrl !== null) {
|
||||||
this.files.unshift({
|
this.files.unshift({
|
||||||
@ -196,8 +232,10 @@ export default {
|
|||||||
filePath: event.file[0].url,
|
filePath: event.file[0].url,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.files[index].name = event.file[0].name
|
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) {
|
deletedUrl(index) {
|
||||||
this.files.splice(index, 1)
|
this.files.splice(index, 1)
|
||||||
@ -207,49 +245,76 @@ export default {
|
|||||||
this.showJoinedDate = false
|
this.showJoinedDate = false
|
||||||
},
|
},
|
||||||
chooseFormalDate(e) {
|
chooseFormalDate(e) {
|
||||||
this.staff.formalDate = formatDate(e.value)
|
const formattedDate = formatDate(e.value);
|
||||||
this.showFormalDate = false
|
console.log('Formatted probationPeriod:', formattedDate); // 确认输出是字符串
|
||||||
|
|
||||||
|
this.staff.probationPeriod = formattedDate;
|
||||||
|
console.log(this.staff.probationPeriod); // 确认保存的值是格式化后的字符串
|
||||||
|
this.showFormalDate = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseSafeDate(e) {
|
chooseSafeDate(e) {
|
||||||
this.staff.safeDate = formatDate(e.value)
|
this.staff.socialSecurityBuyDate = formatDate(e.value)
|
||||||
this.showSafeDate = false
|
this.showSafeDate = false
|
||||||
},
|
},
|
||||||
chooseEducation(e) {
|
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
|
// this.staff['education'] = e.value[0].value
|
||||||
|
// console.log('education', this.staff.education)
|
||||||
|
this.staff.educational = e.value[0].label
|
||||||
this.showEducation = false
|
this.showEducation = false
|
||||||
},
|
},
|
||||||
async getEducations(){
|
async getEducations() {
|
||||||
this.educations = await getDictDataByType("company_staff_edu")
|
this.educations = await getDictDataByType("company_staff_edu")
|
||||||
},
|
},
|
||||||
async getInfoByUserId(){
|
async getInfoByUserId() {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/company/staff/getByUserId?id=' + this.userId,
|
url: '/inspectionStaff/get',
|
||||||
|
params: {
|
||||||
|
id: this.userId
|
||||||
|
},
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
const data = res.data
|
this.staff = res.data
|
||||||
this.staff = data?.staff || this.staff
|
this.topName = this.staff?.nickname
|
||||||
this.user = data?.user
|
if (res.data.driverLicenseType) {
|
||||||
this.topName = this.user?.nickname || this.staff?.name || this.user?.username
|
this.driverLicenseTypeArrStr = res.data.driverLicenseType
|
||||||
this.staff.name = this.user?.nickname || this.user?.username
|
res.data.driverLicenseTypeArr.forEach(item => {
|
||||||
if (!data?.staff){
|
let temp = {
|
||||||
this.staff.tel = this.user?.username || this.user?.mobile
|
id: item,
|
||||||
this.staff.userId = this.user.id
|
name: item
|
||||||
|
}
|
||||||
|
this.driverLicenseTypeArr.push(temp)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (this?.staff?.fileNames){
|
if (this?.staff?.fileList) {
|
||||||
this.files = []
|
this.files = []
|
||||||
const names = this.staff.fileNames.split(",")
|
this.staff.fileList.forEach((item) => {
|
||||||
const urls = this.staff.fileUrls.split(",")
|
|
||||||
names.forEach((item, index) => {
|
|
||||||
const temp = {
|
const temp = {
|
||||||
fileName: item,
|
name: item.name,
|
||||||
fileUrl: config.baseImageUrl + (urls[index][0] === "/" ? urls[index] : "/" + urls[index])
|
url: item.url
|
||||||
}
|
}
|
||||||
this.files.push(temp)
|
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()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -263,7 +328,8 @@ export default {
|
|||||||
height: calc(100vh);
|
height: calc(100vh);
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
.c-top{
|
|
||||||
|
.c-top {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
@ -273,15 +339,18 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
.c-title{
|
|
||||||
|
.c-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
}
|
}
|
||||||
.ail{
|
|
||||||
|
.ail {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.on-input {
|
.on-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -292,14 +361,17 @@ export default {
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.on-input input {
|
.on-input input {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 1rem
|
padding-right: 1rem
|
||||||
}
|
}
|
||||||
|
|
||||||
.s-huix {
|
.s-huix {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container {
|
.image-container {
|
||||||
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
|
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
593
pages/staff/goReport.vue
Normal file
593
pages/staff/goReport.vue
Normal 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>
|
||||||
@ -49,6 +49,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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="ian-box">
|
||||||
<!-- <view class="on-input">
|
<!-- <view class="on-input">
|
||||||
<view class="dix">
|
<view class="dix">
|
||||||
@ -182,6 +195,15 @@ export default {
|
|||||||
url: "/pages/staff/goRoyalty"
|
url: "/pages/staff/goRoyalty"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
goWord() {
|
||||||
|
request({
|
||||||
|
url: '/system/info/exportWord',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id: 4400
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getdianpu() {
|
getdianpu() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/my/shoporder"
|
url: "/pages/my/shoporder"
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export async function getDictDataByType(type) {
|
|||||||
const response = await request({
|
const response = await request({
|
||||||
url: '/system/dict-data/type',
|
url: '/system/dict-data/type',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { type }
|
params: {type}
|
||||||
});
|
});
|
||||||
data = response.data;
|
data = response.data;
|
||||||
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
|
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user