Commit aafc7fed by zhuxiaomei

添加的新字段

parent 62b63137
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// 对外暴露全局常量及函数 // 对外暴露全局常量及函数
export default { export default {
//localStorage //localStorage
setLogin: function (user) { setUserInfo: function (user) {
localStorage.setItem('fLoginUser', JSON.stringify(user)); localStorage.setItem('fLoginUser', JSON.stringify(user));
}, },
//clear //clear
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
localStorage.removeItem('fLoginUser'); localStorage.removeItem('fLoginUser');
localStorage.removeItem('accessToken'); localStorage.removeItem('accessToken');
}, },
getLogin: function () { getUserInfo: function () {
return JSON.parse(localStorage.getItem('fLoginUser')); return JSON.parse(localStorage.getItem('fLoginUser'));
}, },
//token //token
......
<template>
<div>
<van-field
readonly
v-model="dateValue"
label="省市区"
placeholder="点击选择省市区"
@click="showPicker = true"
></van-field>
<van-field
readonly
clickable
label="城市"
:value="value"
placeholder="选择城市"
@click="showPicker = true"
></van-field>
<van-popup v-model="showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="columns"
@cancel="showPicker = false"
@confirm="onConfirm"
></van-picker>
</van-popup>
</div>
</template>
<script>
/**
* 该组件不可用 请自行修改
*/
export default {
name: "CascadeCity"
}
</script>
<style scoped>
</style>
<template>
<div class="field-box">
<div class="label">
<span>抽样单编号</span>
</div>
<div class="value">
<input class="van-field__control cus-input-class">
</div>
</div>
</template>
<script>
/**
*自定义 Field
*/
export default {
name: "FieldCustomer"
}
</script>
<style lang="less" scoped>
.field-box {
width: 100%;
height: 100%;
display: flex;
.label {
width: 50%;
display: flex;
vertical-align: middle;
align-items: center;
justify-content: center;
}
.value {
flex: 1;
vertical-align: middle;
}
.cus-input-class {
height: 100%;
padding-left: 12px;
}
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
/** /**
* 全局的配置 * 全局的配置
* @type {{getLogin, logout, baseURL, setToken, setLogin, getToken, version}} * @type
*/ */
Vue.prototype.$global = global Vue.prototype.$global = global
}, },
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
console.log('_getUserInfo') console.log('_getUserInfo')
let user = await sysUser.getUserInfo(); let user = await sysUser.getUserInfo();
if (user) { if (user) {
this.$global.setLogin(user); this.$global.setUserInfo(user);
this.$router.replace('/home'); this.$router.replace('/home');
//todo 清空路由 报错问题 需要降低vue-router版本 //todo 清空路由 报错问题 需要降低vue-router版本
// this.$navigation.cleanRoutes(); // this.$navigation.cleanRoutes();
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
//重新获取用户信息 //重新获取用户信息
let user = await sysUser.getUserInfo(); let user = await sysUser.getUserInfo();
if (user) { if (user) {
this.$global.setLogin(user); this.$global.setUserInfo(user);
this.userInfo = user; this.userInfo = user;
this.id = user.id; this.id = user.id;
} }
......
...@@ -64,6 +64,15 @@ ...@@ -64,6 +64,15 @@
label="单位名称" label="单位名称"
></van-field> ></van-field>
</table-col> </table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="areaObj"
label="省市区"
></van-field>
</table-col>
</table-row> </table-row>
<table-row> <table-row>
<table-col> <table-col>
...@@ -227,6 +236,26 @@ ...@@ -227,6 +236,26 @@
</table-col> </table-col>
</table-row> </table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.samplingDate"
label="抽样日期"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testMembers"
label="抽样人员"
></van-field>
</table-col>
</table-row>
<table-row flex-none> <table-row flex-none>
<table-col> <table-col>
样品信息 样品信息
...@@ -473,6 +502,15 @@ ...@@ -473,6 +502,15 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
v-model="sample.unit"
label="抽样数量单位"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.backupQuanity" v-model="sample.backupQuanity"
label="备样数量" label="备样数量"
></van-field> ></van-field>
...@@ -705,7 +743,7 @@ ...@@ -705,7 +743,7 @@
<table-col> <table-col>
<van-field readonly <van-field readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testLinkman" v-model="formObj.testLinkman"
label="联系人" label="联系人"
...@@ -714,16 +752,27 @@ ...@@ -714,16 +752,27 @@
<table-col> <table-col>
<van-field readonly <van-field readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testTel" v-model="formObj.testTel"
label="电话" label="电话"
></van-field> ></van-field>
</table-col> </table-col>
</table-row>
<table-row>
<table-col> <table-col>
<van-field readonly <van-field readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center"
v-model="formObj.testEmail"
label="邮箱"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testFax" v-model="formObj.testFax"
label="传真" label="传真"
...@@ -788,10 +837,17 @@ ...@@ -788,10 +837,17 @@
testLinkman: '', testLinkman: '',
testTel: '', testTel: '',
testFax: '', testFax: '',
remark: '' remark: '',
samplingDate:'',
testMembers:'',
testEmail:'',
}, },
nonNetTested: { nonNetTested: {
name: '', name: '',
testedProvince:'',
testedCity:'',
testedCountry:'',
address: '', address: '',
areaType: '', areaType: '',
areaTypeRemark: '', areaTypeRemark: '',
...@@ -830,6 +886,7 @@ ...@@ -830,6 +886,7 @@
price: '', price: '',
samplingBase: '', samplingBase: '',
quantity: '', quantity: '',
unit:'',
backupQuanity: '', backupQuanity: '',
samplingMethod: '', samplingMethod: '',
inward: '', inward: '',
...@@ -878,6 +935,11 @@ ...@@ -878,6 +935,11 @@
id: '', id: '',
} }
}, },
computed: {
areaObj:function(){
return this.nonNetTested.testedProvince+this.nonNetTested.testedCity+this.nonNetTested.testedCountry
}
},
mounted() { mounted() {
this._open() this._open()
}, },
...@@ -893,12 +955,16 @@ ...@@ -893,12 +955,16 @@
if (result) { if (result) {
for (let key in this.formObj) { for (let key in this.formObj) {
if (result[key]) { if (result[key]) {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
this.formObj[key] = result[key] this.formObj[key] = result[key]
} }
} }
for(let key in this.netTested){ }
if(result.netTested[key]){ for(let key in this.nonNetTested){
this.netTested[key] = result.netTested[key] if(result.nonNetTested[key]){
this.nonNetTested[key] = result.nonNetTested[key]
} }
} }
for(let key in this.sample){ for(let key in this.sample){
......
...@@ -130,6 +130,15 @@ ...@@ -130,6 +130,15 @@
label="单位名称" label="单位名称"
></van-field> ></van-field>
</table-col> </table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="areaObj"
label="省市区"
></van-field>
</table-col>
</table-row> </table-row>
<table-row> <table-row>
<table-col> <table-col>
...@@ -223,6 +232,26 @@ ...@@ -223,6 +232,26 @@
</van-radio-group> </van-radio-group>
</table-col> </table-col>
</table-row> </table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.samplingDate"
label="抽样日期"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testMembers"
label="抽样人员"
></van-field>
</table-col>
</table-row>
<table-row flex-none> <table-row flex-none>
<table-col> <table-col>
样品信息 样品信息
...@@ -448,6 +477,15 @@ ...@@ -448,6 +477,15 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
v-model="sample.unit"
label="抽样数量单位"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.backupQuanity" v-model="sample.backupQuanity"
label="备样数量" label="备样数量"
></van-field> ></van-field>
...@@ -700,7 +738,7 @@ ...@@ -700,7 +738,7 @@
<table-col> <table-col>
<van-field readonly <van-field readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testLinkman" v-model="formObj.testLinkman"
label="联系人" label="联系人"
...@@ -709,16 +747,29 @@ ...@@ -709,16 +747,29 @@
<table-col> <table-col>
<van-field readonly <van-field readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testTel" v-model="formObj.testTel"
label="电话" label="电话"
></van-field> ></van-field>
</table-col> </table-col>
</table-row>
<table-row>
<table-col> <table-col>
<van-field readonly <van-field
readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="25%" label-width="50%"
label-align="center"
v-model="formObj.testEmail"
label="邮箱"
></van-field>
</table-col>
<table-col>
<van-field
readonly
label-class="cus-field-class"
label-width="50%"
label-align="center" label-align="center"
v-model="formObj.testFax" v-model="formObj.testFax"
label="传真" label="传真"
...@@ -784,7 +835,11 @@ ...@@ -784,7 +835,11 @@
testLinkman: '', testLinkman: '',
testTel: '', testTel: '',
testFax: '', testFax: '',
remark: '' remark: '',
samplingDate:'',
testMembers:'',
testEmail:'',
}, },
netTested: { netTested: {
plantformName: '', plantformName: '',
...@@ -794,6 +849,9 @@ ...@@ -794,6 +849,9 @@
plantformAddress: '', plantformAddress: '',
legalPerson: '', legalPerson: '',
name: '', name: '',
testedProvince:'',
testedCity:'',
testedCountry:'',
address: '', address: '',
estore: '', estore: '',
sampleSite: '', sampleSite: '',
...@@ -828,6 +886,7 @@ ...@@ -828,6 +886,7 @@
qualityGrade: '', qualityGrade: '',
specification: '', specification: '',
quantity: '', quantity: '',
unit:'',
backupQuanity: '', backupQuanity: '',
samplingMethod: '', samplingMethod: '',
qrcode: '', qrcode: '',
...@@ -856,6 +915,11 @@ ...@@ -856,6 +915,11 @@
id: '', id: '',
} }
}, },
computed: {
areaObj:function(){
return this.netTested.testedProvince+this.netTested.testedCity+this.netTested.testedCountry
}
},
mounted() { mounted() {
this._open() this._open()
}, },
...@@ -869,9 +933,13 @@ ...@@ -869,9 +933,13 @@
if (result) { if (result) {
for (let key in this.formObj) { for (let key in this.formObj) {
if (result[key]) { if (result[key]) {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
this.formObj[key] = result[key] this.formObj[key] = result[key]
} }
} }
}
for (let key in this.netTested) { for (let key in this.netTested) {
if (result.netTested[key]) { if (result.netTested[key]) {
this.netTested[key] = result.netTested[key] this.netTested[key] = result.netTested[key]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment