|
@@ -39,10 +39,10 @@
|
|
|
<u-input v-model="person.phone" @blur="phoneBlur" :placeholder="'请输入电话号'" />
|
|
|
<span class="erroring" v-if="phoneRules">电话号有误</span>
|
|
|
</u-form-item>
|
|
|
- <u-form-item class="typeStyle" :prop="'age' + (index + 1)">
|
|
|
+ <!-- <u-form-item class="typeStyle" :prop="'age' + (index + 1)">
|
|
|
<p style="width: 150rpx;margin-left: 20rpx;">人员类型</p>
|
|
|
<u-input v-model="person.worker" :placeholder="'请输入人员类型'" />
|
|
|
- </u-form-item>
|
|
|
+ </u-form-item> -->
|
|
|
<u-form-item class="antherStyle">
|
|
|
<p style="width: 150rpx;">职务</p>
|
|
|
<uni-data-select v-model="person.power" :localdata="range" @change="change"></uni-data-select>
|
|
@@ -71,10 +71,10 @@
|
|
|
ref="item1">
|
|
|
<u--input class="insides" v-model="formbox.fuserNum" border="none"></u--input>
|
|
|
</u-form-item>
|
|
|
- <u-form-item style="width: 350rpx;" label="人员类型" prop="userInfo.fworker" borderBottom
|
|
|
+ <!-- <u-form-item style="width: 350rpx;" label="人员类型" prop="userInfo.fworker" borderBottom
|
|
|
ref="item1">
|
|
|
<u--input class="insides" v-model="formbox.fworker" border="none"></u--input>
|
|
|
- </u-form-item>
|
|
|
+ </u-form-item> -->
|
|
|
</u--form>
|
|
|
<div class="useBox">
|
|
|
<button class="antherBtn" @click="makeSureEdit">确认修改</button>
|
|
@@ -83,6 +83,15 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <u-popup :show="showDel" title="确认删除?" mode="center" >
|
|
|
+ <div style="width: 300rpx;height: 200rpx;">
|
|
|
+ <p>是否删除该内容?</p>
|
|
|
+ <button class="antherBtn" @click="makeSureDel">确认</button>
|
|
|
+ <button class="antherBtn" @click="showDel = false">取消</button>
|
|
|
+ </div>
|
|
|
+ </u-popup>
|
|
|
+ </div>
|
|
|
<button @click="addNewPeople" class="circleBtn">+</button>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -147,6 +156,8 @@
|
|
|
nameRules: false, //对name的正则验证
|
|
|
userRules: false, //对身份证的正则验证
|
|
|
phoneRules: false, //对电话的正则验证
|
|
|
+ showDel: false,
|
|
|
+ delId: '',
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -180,47 +191,52 @@
|
|
|
},
|
|
|
|
|
|
addSure() {
|
|
|
- if (!this.userRules && !this.phoneRules && !this.nameRules) {
|
|
|
- creatFirePeople({
|
|
|
- duty: this.membersList[0].power,
|
|
|
- empName: this.membersList[0].name,
|
|
|
- empType: this.membersList[0].worker,
|
|
|
- idcardno: this.membersList[0].userNum,
|
|
|
- microstationid: this.fireStationId - 0,
|
|
|
- mobile: this.membersList[0].phone,
|
|
|
- }).then(res => {
|
|
|
- if (res.data) {
|
|
|
- this.getAllFire()
|
|
|
- uni.showToast({
|
|
|
- title: '添加成功',
|
|
|
- icon: 'success', // 图标类型,可选值:'success', 'loading', 'none'
|
|
|
- duration: 2000, // 持续时间,单位为毫秒,默认值为 1500
|
|
|
- mask: false, // 是否显示透明蒙层,防止触摸穿透,默认值为 false
|
|
|
- success() {
|
|
|
- console.log('toast消息提示显示成功');
|
|
|
- },
|
|
|
- fail(err) {
|
|
|
- console.error('toast消息提示显示失败', err);
|
|
|
- }
|
|
|
- });
|
|
|
- this.membersList = []
|
|
|
- }
|
|
|
- console.log(res, 'r11111');
|
|
|
- })
|
|
|
- // console.log(this.membersList, 'memberList');
|
|
|
+ if (this.$route.query.addId) {
|
|
|
+ if (!this.userRules && !this.phoneRules && !this.nameRules) {
|
|
|
+ creatFirePeople({
|
|
|
+ duty: this.membersList[0].power,
|
|
|
+ empName: this.membersList[0].name,
|
|
|
+ // empType: this.membersList[0].worker,
|
|
|
+ idcardno: this.membersList[0].userNum,
|
|
|
+ microstationid: this.fireStationId - 0,
|
|
|
+ mobile: this.membersList[0].phone,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.getAllFire()
|
|
|
+ uni.showToast({
|
|
|
+ title: '添加成功',
|
|
|
+ icon: 'success', // 图标类型,可选值:'success', 'loading', 'none'
|
|
|
+ duration: 2000, // 持续时间,单位为毫秒,默认值为 1500
|
|
|
+ mask: false, // 是否显示透明蒙层,防止触摸穿透,默认值为 false
|
|
|
+ success() {
|
|
|
+ console.log('toast消息提示显示成功');
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.error('toast消息提示显示失败', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.membersList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请检查表单项',
|
|
|
+ icon: 'none', // 图标类型,可选值:'success', 'loading', 'none'
|
|
|
+ duration: 2000, // 持续时间,单位为毫秒,默认值为 1500
|
|
|
+ mask: false, // 是否显示透明蒙层,防止触摸穿透,默认值为 false
|
|
|
+ success() {
|
|
|
+ console.log('toast消息提示显示成功');
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.error('toast消息提示显示失败', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
- title: '请检查表单项',
|
|
|
- icon: 'none', // 图标类型,可选值:'success', 'loading', 'none'
|
|
|
- duration: 2000, // 持续时间,单位为毫秒,默认值为 1500
|
|
|
- mask: false, // 是否显示透明蒙层,防止触摸穿透,默认值为 false
|
|
|
- success() {
|
|
|
- console.log('toast消息提示显示成功');
|
|
|
- },
|
|
|
- fail(err) {
|
|
|
- console.error('toast消息提示显示失败', err);
|
|
|
- }
|
|
|
- });
|
|
|
+ localStorage.setItem("empList", JSON.stringify(this.membersList))
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
change(e) {
|
|
@@ -264,7 +280,7 @@
|
|
|
// console.log(res, '888');
|
|
|
this.tableList = res.data.list
|
|
|
})
|
|
|
- } else {
|
|
|
+ } else if (this.$route.query.addId === '0') {
|
|
|
num = '0'
|
|
|
getfirepage({
|
|
|
pageNo: 1,
|
|
@@ -279,7 +295,12 @@
|
|
|
|
|
|
},
|
|
|
delUser(row) {
|
|
|
- delFirePeople(row.id).then(res => {
|
|
|
+ this.showDel = true
|
|
|
+ this.delId = row.id
|
|
|
+
|
|
|
+ },
|
|
|
+ makeSureDel() {
|
|
|
+ delFirePeople(this.delId).then(res => {
|
|
|
if (res.data) {
|
|
|
uni.showToast({
|
|
|
title: '删除成功',
|
|
@@ -294,6 +315,7 @@
|
|
|
}
|
|
|
});
|
|
|
this.getAllFire()
|
|
|
+ this.showDel = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -306,7 +328,7 @@
|
|
|
this.formbox.fname = res.data.empName
|
|
|
this.formbox.fphone = res.data.mobile
|
|
|
this.formbox.fpower = res.data.duty
|
|
|
- this.formbox.fworker = res.data.empType
|
|
|
+ // this.formbox.fworker = res.data.empType
|
|
|
this.formbox.fuserNum = res.data.idcardno
|
|
|
this.showModal = true
|
|
|
|
|
@@ -320,7 +342,7 @@
|
|
|
editFirePeople({
|
|
|
duty: this.formbox.fpower,
|
|
|
empName: this.formbox.fname,
|
|
|
- empType: this.formbox.fworker,
|
|
|
+ // empType: this.formbox.fworker,
|
|
|
id: this.editPeopleId,
|
|
|
idcardno: this.formbox.fuserNum,
|
|
|
microstationid: this.fireStationId - 0,
|
|
@@ -375,25 +397,30 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- console.log(options, 'options')
|
|
|
- this.resultId = this.$route.query.addId
|
|
|
- if (this.resultId === '2') {
|
|
|
- this.tomole = '添加负责人'
|
|
|
- } else if (this.resultId === '1') {
|
|
|
- this.tomole = '添加值班人'
|
|
|
- } else {
|
|
|
- this.tomole = '添加人员信息'
|
|
|
- }
|
|
|
- let ids = localStorage.getItem("fireId")
|
|
|
- if (ids) {
|
|
|
- this.fireStationId = ids
|
|
|
- // console.log(this.fireStationId, 'fireid');
|
|
|
- }
|
|
|
- // console.log(this.$route.query, 'query'); // 输出传递的参数值
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.getAllFire()
|
|
|
- this.getbackid()
|
|
|
+ if (this.$route.query.addId) {
|
|
|
+ this.getAllFire()
|
|
|
+ this.getbackid()
|
|
|
+ console.log(options, 'options')
|
|
|
+ this.resultId = this.$route.query.addId
|
|
|
+ if (this.resultId === '2') {
|
|
|
+ this.tomole = '添加负责人'
|
|
|
+ } else if (this.resultId === '1') {
|
|
|
+ this.tomole = '添加值班人'
|
|
|
+ } else {
|
|
|
+ this.tomole = '添加人员信息'
|
|
|
+ }
|
|
|
+ let ids = localStorage.getItem("fireId")
|
|
|
+ if (ids) {
|
|
|
+ this.fireStationId = ids
|
|
|
+ // console.log(this.fireStationId, 'fireid');
|
|
|
+ }
|
|
|
+ // console.log(this.$route.query, 'query'); // 输出传递的参数值
|
|
|
+ } else {
|
|
|
+ return
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
getDuty() {
|