|
@@ -39,12 +39,12 @@
|
|
|
<u-input v-model="formData.charger" placeholder="请输入负责人" />
|
|
|
<button @click="goBigNum" class="manyBtn">添加负责人</button>
|
|
|
</u-form-item>
|
|
|
-
|
|
|
+
|
|
|
<u-form-item label="人员信息" prop="members">
|
|
|
<u-input v-model="formData.members" placeholder="请输入队员人数" />
|
|
|
<button @click="goPeopleMes" class="manyBtn">添加人员信息</button>
|
|
|
</u-form-item>
|
|
|
-
|
|
|
+
|
|
|
<u-form-item label="水罐车数量" prop="waterTanker">
|
|
|
<u-input v-model="formData.waterTanker" placeholder="请输入水罐车" />
|
|
|
</u-form-item>
|
|
@@ -188,13 +188,13 @@
|
|
|
let empList = localStorage.getItem('empList')
|
|
|
empList = JSON.parse(empList)
|
|
|
let pack = {
|
|
|
- duty:empList[0].power,
|
|
|
- empName:empList[0].name,
|
|
|
- mobile:empList[0].phone,
|
|
|
- idcardno:empList[0].userNum
|
|
|
+ duty: empList[0].power,
|
|
|
+ empName: empList[0].name,
|
|
|
+ mobile: empList[0].phone,
|
|
|
+ idcardno: empList[0].userNum
|
|
|
}
|
|
|
this.newEmpList = pack
|
|
|
- console.log(pack,'pack');
|
|
|
+ console.log(pack, 'pack');
|
|
|
},
|
|
|
methods: {
|
|
|
submit(ref) {
|
|
@@ -203,17 +203,20 @@
|
|
|
.then(res => {
|
|
|
// 因为需要提交的数据和绑定的数据不一样,所以要转换
|
|
|
this.formData['status'] = 0;
|
|
|
- this.formData.builtOn = this.formData.builtOn
|
|
|
- console.log(this.formData, '222');
|
|
|
- this.formData.empList = [this.newEmpList]
|
|
|
+ if (this.formData.builtOn) {
|
|
|
+ this.formData.builtOn = this.formData.builtOn
|
|
|
+ }
|
|
|
+ if (this.newEmpList) {
|
|
|
+ this.formData.empList = [this.newEmpList]
|
|
|
+ }
|
|
|
var jsdata = JSON.stringify(this.formData);
|
|
|
createStation(jsdata).then(response => {
|
|
|
- console.log('response.data.msg,', response.data);
|
|
|
+ // console.log('response.data.msg,', response.data);
|
|
|
uni.showLoading({
|
|
|
title: response.data.msg
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
- console.log('新增成功!');
|
|
|
+ // console.log('新增成功!');
|
|
|
uni.hideLoading();
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
@@ -222,7 +225,7 @@
|
|
|
});
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- console.log('err错误信息为:', err);
|
|
|
+ // console.log('err错误信息为:', err);
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '错误!' + err[0].message
|