|
|
@@ -2,9 +2,11 @@
|
|
|
.input-with-select .el-select .el-input {
|
|
|
width: 110px;
|
|
|
}
|
|
|
+
|
|
|
.input-with-select .el-input-group__append {
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
+
|
|
|
</style>
|
|
|
|
|
|
<template>
|
|
|
@@ -20,8 +22,16 @@
|
|
|
<el-breadcrumb-item>{{pagetitle}}</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
<span style="float: right;">
|
|
|
+
|
|
|
+ <!--审核模块 暂未进行任何修改版本-->
|
|
|
+ <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="auditorshow"
|
|
|
+ v-if="permissions[permissionscode.srapprove] && service_flag == 'editsource'"
|
|
|
+ :disabled="samplesForm.AuditorStatus != 0 || !author_flag">审核</el-button> -->
|
|
|
+ <!--审核模块结束-->
|
|
|
+
|
|
|
<el-button type="primary" style="margin-left: 8px" class="el-button--mini" @click="savedata">保存</el-button>
|
|
|
- <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" onclick="window.history.go(-1)">返回</el-button>
|
|
|
+ <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
|
|
|
+ onclick="window.history.go(-1)">返回</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
<el-form :model="samplesForm" :rules="samplesrules" label-width="130px" style="min-height: calc(100vh - 189px)"
|
|
|
@@ -31,23 +41,23 @@
|
|
|
<legend style="color:#436EEE"></legend>
|
|
|
<i class="icon icon-paragraph-justify">基本信息</i>
|
|
|
</div>
|
|
|
- <el-row :gutter="20" class="customordetailcss">
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="样本名称" prop="Name">
|
|
|
- <el-input v-model="samplesForm.Name" placeholder="请输入样本名称"></el-input>
|
|
|
+ <el-form-item label="样本源名称" prop="Name">
|
|
|
+ <el-input v-model="samplesForm.Name" placeholder="请输入样本源名称" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="种属" prop="Genus">
|
|
|
- <el-select ref="reftube" v-model="samplesForm.Genus" placeholder="请选择种属" style="width:100%">
|
|
|
+ <el-select ref="reftube" v-model="samplesForm.Genus" placeholder="请选择种属" style="width:100%" filterable>
|
|
|
<el-option v-for="item in genuslist" :label="item.Value" :value="item.Value" :key="item.Key">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="来源编码" prop="InnerNo">
|
|
|
- <el-input v-model="samplesForm.InnerNo" placeholder="请输入内部编号"></el-input>
|
|
|
+ <el-form-item label="来源内码" prop="InnerNo">
|
|
|
+ <el-input v-model="samplesForm.InnerNo" placeholder="请输入来源内码" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -59,18 +69,71 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="数量">
|
|
|
+ <el-form-item label="数量" prop="Amount">
|
|
|
<el-input v-model="samplesForm.Amount" placeholder="请输入数量" style="width:100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="单位">
|
|
|
- <el-select ref="refee" v-model="samplesForm.Unit" clearable style="width:100%" placeholder="请选择单位">
|
|
|
+ <el-select ref="refUnit" v-model="samplesForm.Unit" clearable style="width:100%" placeholder="请选择单位">
|
|
|
<el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item.Value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="取样地区" prop="Province">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-cascader :options="countryoptions" :props="countryprops" maxlength="20" placeholder="省市区"
|
|
|
+ v-model="CityAry" style="width: 100%" @change="handleAreaChange" filterable>
|
|
|
+ </el-cascader>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-input v-model="samplesForm.Address" maxlength="500" placeholder="详细地址" style="width: 100%">
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="区号">
|
|
|
+ <el-input v-model="samplesForm.AreaCode" placeholder="请输入区号" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="经度">
|
|
|
+ <el-input v-model="samplesForm.Longitude" placeholder="请输入经度" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="纬度">
|
|
|
+ <el-input v-model="samplesForm.Latitude" placeholder="请输入纬度" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="海拔">
|
|
|
+ <el-input v-model="samplesForm.Altitude" placeholder="请输入海拔" style="width: 85%"></el-input>
|
|
|
+ <span style="margin-left:15px">米</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="采样日期" prop="SurveyDate">
|
|
|
+ <el-date-picker v-model="samplesForm.SurveyDate" type="date" style="width:100%" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8">
|
|
|
+ <el-form-item label="项目属性">
|
|
|
+ <el-select ref="refProject" v-model="samplesForm.ProjectName" clearable style="width:100%"
|
|
|
+ placeholder="请选择项目属性">
|
|
|
+ <el-option v-for="item in projectlist" :label="item.Value" :value="item.Value" :key="item.Value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="备注信息">
|
|
|
<el-input v-model="samplesForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
|
|
|
@@ -93,19 +156,21 @@
|
|
|
<el-input v-model="item.FieldDefault" v-if="item.FieldType === '1'" :placeholder="'请输入'+item.Name"
|
|
|
auto-complete="off"></el-input>
|
|
|
|
|
|
- <el-select v-model="item.FieldDefault" v-if="item.FieldType === '2'" clearable :placeholder="'请选择'+item.Name"
|
|
|
- style="width:100%">
|
|
|
- <el-option :label="v" :value="v" :key="v" v-for=" v in item.FieldContent.split(',')"></el-option>
|
|
|
+ <el-select v-model="item.FieldDefault" v-if="item.FieldType === '2'" clearable
|
|
|
+ :placeholder="'请选择'+item.Name" style="width:100%">
|
|
|
+ <el-option :label="v" :value="v" :key="v" v-for=" v in item.FieldContent.split(',')">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
|
|
|
<el-input v-model="item.FieldDefault" v-if="item.FieldType === '3'" :placeholder="'请输入'+item.Name"
|
|
|
type="textarea" :rows=3 auto-complete="off"></el-input>
|
|
|
|
|
|
- <el-date-picker v-model="item.FieldDefault" v-if="item.FieldType === '4'" type="datetime" style="width:100%"
|
|
|
- placeholder="请选择日期"></el-date-picker>
|
|
|
+ <el-date-picker v-model="item.FieldDefault" v-if="item.FieldType === '4'" type="datetime"
|
|
|
+ style="width:100%" placeholder="请选择日期"></el-date-picker>
|
|
|
|
|
|
- <el-button plain v-model="item.FieldDefault" v-if="item.FieldType === '5'" type="primary" size="mini"
|
|
|
- class="el-button--small" style="margin-left: 8px" @click="getitem(item)">上传图片</el-button>
|
|
|
+ <el-button plain v-model="item.FieldDefault" v-if="item.FieldType === '5'" type="primary"
|
|
|
+ size="mini" class="el-button--small" style="margin-left: 8px" @click="getitem(item)">上传图片
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</template>
|
|
|
@@ -116,9 +181,30 @@
|
|
|
</el-tabs>
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- <el-dialog title="审核信息" :visible.sync="auditorShow" top="5vh">
|
|
|
+ <el-form :model="shenheForm" label-width="130px" ref="shenheForm">
|
|
|
+ <el-form-item label="审核状态">
|
|
|
+ <template>
|
|
|
+ <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1">审核通过</el-radio>
|
|
|
+ <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="2">审核异常</el-radio>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审核说明">
|
|
|
+ <el-input type="textarea" v-model="shenheForm.AuditorRemark" placeholder="请输入审核说明"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer" style="margin-top: -25px">
|
|
|
+ <el-button size="small" @click="auditorShow = false">取 消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="auditor()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog> -->
|
|
|
+
|
|
|
<el-dialog :title="ImageTitle" width="80%" :visible.sync="imageDialog">
|
|
|
- <el-upload action="" :before-upload="beforeAvatarUpload" :on-preview="handlePictureCardPreview" :http-request="uploadrequest"
|
|
|
- :on-success="handleAvatarSuccess" :on-remove="handleRemove" :file-list="imagefilelist" list-type="picture">
|
|
|
+ <el-upload action="" :before-upload="beforeAvatarUpload" :on-preview="handlePictureCardPreview"
|
|
|
+ :http-request="uploadrequest" :on-success="handleAvatarSuccess" :on-remove="handleRemove"
|
|
|
+ :file-list="imagefilelist" list-type="picture">
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
|
|
|
</el-upload>
|
|
|
@@ -143,9 +229,26 @@
|
|
|
}),
|
|
|
},
|
|
|
data() {
|
|
|
+ var checkAmount = (rule, value, callback) => {
|
|
|
+ if (!isNaN(parseInt(value)) && !isNaN(value) && value > 0) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ callback(new Error('请输入正确数字值!'))
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
Tabs: '',
|
|
|
pagetitle: '', //界面标题
|
|
|
+ dictData: null,
|
|
|
+ countryoptions: [],
|
|
|
+ countryListOptions: [],
|
|
|
+ countryprops: {
|
|
|
+ value: 'adcode',
|
|
|
+ label: 'name',
|
|
|
+ children: 'districts'
|
|
|
+ },
|
|
|
+ CityAry: [],
|
|
|
+
|
|
|
samplesForm: {
|
|
|
Id: '',
|
|
|
AccCode: '',
|
|
|
@@ -156,27 +259,62 @@
|
|
|
Unit: '', // 单位(容量)
|
|
|
SourceType: '',
|
|
|
Weight: '',
|
|
|
+ Province: '',
|
|
|
+ ProvinceName: '',
|
|
|
+ City: '',
|
|
|
+ CityName: '',
|
|
|
+ Street: '',
|
|
|
+ StreetName: '',
|
|
|
+ Address: '',
|
|
|
+ AreaCode: '',
|
|
|
+ Longitude: '',
|
|
|
+ Latitude: '',
|
|
|
+ Altitude: '',
|
|
|
+ SurveyDate: new Date(),
|
|
|
+ ProjectId: '',
|
|
|
+ ProjectName: '',
|
|
|
+ AuditorId: '',
|
|
|
+ AuditorName: '',
|
|
|
+ AuditorStatus: '',
|
|
|
+ AuditorRemark: '',
|
|
|
Remark: '',
|
|
|
},
|
|
|
+ //审核按钮可否点击
|
|
|
+ // auditorShow: false,
|
|
|
+ // shenheForm: {
|
|
|
+ // SuccessStatus: 1,
|
|
|
+ // AuditorRemark: ''
|
|
|
+ // },
|
|
|
+ // author_flag: false,
|
|
|
extendForm: {},
|
|
|
sampeunitlist: [],
|
|
|
genuslist: [],
|
|
|
+ projectlist: [],
|
|
|
samplesrules: {
|
|
|
InnerNo: [{
|
|
|
required: true,
|
|
|
- message: '请输入内部编号',
|
|
|
+ message: '请输入来源内码',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
Name: [{
|
|
|
required: true,
|
|
|
- message: '请输入名称',
|
|
|
+ message: '请输入样本源名称',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
Genus: [{
|
|
|
required: true,
|
|
|
- message: '请输入种属',
|
|
|
+ message: '请输入蜂种名称',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Amount: [{
|
|
|
+ validator: checkAmount,
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
+ // Province: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择省市区',
|
|
|
+ // trigger: 'change'
|
|
|
+ // }],
|
|
|
},
|
|
|
groupnameList: [],
|
|
|
animalextends: [], // 扩展字段
|
|
|
@@ -190,6 +328,12 @@
|
|
|
dialogVisible: false,
|
|
|
ID: '',
|
|
|
pid: 0,
|
|
|
+ permissionscode: {
|
|
|
+ srapprove: 'biobank.sourceAnimal.approve',
|
|
|
+ },
|
|
|
+ permissions: {
|
|
|
+ 'biobank.sourceAnimal.approve': false,
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -201,13 +345,31 @@
|
|
|
} else if (this.pid != '0') {
|
|
|
this.pagetitle = '编辑样本来源'
|
|
|
this.service_flag = 'editsource'
|
|
|
- //this.getanimalinfo()
|
|
|
}
|
|
|
_this.getGroupName()
|
|
|
_this.getAnimalGenus()
|
|
|
_this.getsampetypeunit()
|
|
|
+ _this.getProjectlist()
|
|
|
+ _this.getDictOptions()
|
|
|
+ _this.getPermissions()
|
|
|
+ _this.getAnimalInfo()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getAnimalInfo(ServiceId) {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ _this.$axios.get('/samplessource/getanimalinfo/' + _this.ServiceId, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.samplesForm = res.data.items
|
|
|
+ if (_this.authUser.Profile.Id != res.data.items.CreateUserId) {
|
|
|
+ _this.author_flag = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
savedata() {
|
|
|
if (this.pid == 'addsource' || this.pid <= '0') {
|
|
|
this.trueInnerNo()
|
|
|
@@ -221,18 +383,19 @@
|
|
|
_this.$axios.get("/samplessource/innernomakesure?InnerNo=" + this.samplesForm.InnerNo, {})
|
|
|
.then(function (response) {
|
|
|
let innerTotal = response.data.items
|
|
|
+ console.log("--------------------",response.data.items)
|
|
|
if (innerTotal === 0) {
|
|
|
_this.savebasic()
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: '来源编码重复!'
|
|
|
+ message: '来源内码重复!'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getanimalinfo() {
|
|
|
- let _this = this // request
|
|
|
+ let _this = this
|
|
|
let params = {
|
|
|
Id: this.pid
|
|
|
}
|
|
|
@@ -241,6 +404,11 @@
|
|
|
})
|
|
|
.then(res => {
|
|
|
_this.samplesForm = res.data.items
|
|
|
+ _this.samplesForm.SurveyDate = new Date(res.data.items.SurveyDate)
|
|
|
+ _this.CityAry = []
|
|
|
+ _this.CityAry.push(_this.samplesForm.Province)
|
|
|
+ _this.CityAry.push(_this.samplesForm.City)
|
|
|
+ _this.CityAry.push(_this.samplesForm.Street)
|
|
|
// 为扩展字段赋值
|
|
|
for (var i = 0; i < _this.animalextends.length; i++) {
|
|
|
if (_this.animalextends[i].FieldType == '4') {
|
|
|
@@ -257,7 +425,9 @@
|
|
|
this.$refs["samplesForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
let _this = this
|
|
|
- _this.samplesForm.Unit = _this.$refs.refee.selectedLabel
|
|
|
+ _this.samplesForm.Amount = parseInt(_this.samplesForm.Amount)
|
|
|
+ _this.samplesForm.Unit = _this.$refs.refUnit.selectedLabel
|
|
|
+ // _this.samplesForm.ProjectName = _this.$refs.refProject.selectedLabel
|
|
|
_this.samplesForm.SourceType = _this.$refs.refplace.selectedLabel
|
|
|
let params = _this.samplesForm
|
|
|
let jsonstr = ''
|
|
|
@@ -290,7 +460,6 @@
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- // handle error
|
|
|
console.error(err)
|
|
|
})
|
|
|
} else {
|
|
|
@@ -303,7 +472,10 @@
|
|
|
this.$refs["samplesForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
let _this = this
|
|
|
- _this.samplesForm.Unit = _this.$refs.refee.selectedLabel
|
|
|
+ _this.samplesForm.Amount = parseInt(_this.samplesForm.Amount)
|
|
|
+ _this.samplesForm.Unit = _this.$refs.refUnit.selectedLabel
|
|
|
+ // _this.samplesForm.ProjectName = _this.$refs.refProject.selectedLabel
|
|
|
+ _this.samplesForm.SourceType = _this.$refs.refplace.selectedLabel
|
|
|
let params = _this.samplesForm
|
|
|
let jsonstr = ''
|
|
|
for (let i = 0; i < _this.animalextends.length; i++) {
|
|
|
@@ -317,7 +489,6 @@
|
|
|
params = Object.assign(params, jsonobj)
|
|
|
_this.$axios.put('/samplessource/editanimal/' + _this.pid, params)
|
|
|
.then(res => {
|
|
|
- // response
|
|
|
if (res.data.code === 0) {
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
@@ -334,7 +505,6 @@
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- // handle error
|
|
|
console.error(err)
|
|
|
})
|
|
|
} else {
|
|
|
@@ -343,6 +513,53 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 打开审核弹窗
|
|
|
+ // auditorshow() {
|
|
|
+ // let _this = this
|
|
|
+ // _this.auditorShow = true
|
|
|
+ // },
|
|
|
+ // auditor() {
|
|
|
+ // let _this = this
|
|
|
+ // _this.$confirm("确定审核该样本来源?审核后所有信息将不可修改!", "提示", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning"
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // if (_this.shenheForm.SuccessStatus == 1) {
|
|
|
+ // _this.samplesForm.AuditorStatus = 1
|
|
|
+ // } else {
|
|
|
+ // _this.samplesForm.AuditorStatus = 2
|
|
|
+ // }
|
|
|
+ // _this.samplesForm.AuditorRemark = _this.shenheForm.AuditorRemark
|
|
|
+ // _this.auditorShow = false
|
|
|
+ // _this.saveauditor()
|
|
|
+ // })
|
|
|
+ // .catch(() => {})
|
|
|
+ // },
|
|
|
+ // saveauditor() {
|
|
|
+ // let _this = this
|
|
|
+ // _this.$axios.put('/samplessource/auditoranimal/' + _this.pid, _this.samplesForm)
|
|
|
+ // .then(res => {
|
|
|
+ // // response
|
|
|
+ // if (res.data.code === 0) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // _this.getanimalinfo()
|
|
|
+ // } else {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // // handle error
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 获取样本单位
|
|
|
getsampetypeunit() {
|
|
|
let _this = this
|
|
|
@@ -359,6 +576,14 @@
|
|
|
_this.genuslist = res.data
|
|
|
})
|
|
|
},
|
|
|
+ //获取项目属性
|
|
|
+ getProjectlist() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/items/worditem?code=ProjectName', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.projectlist = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
getGroupName() {
|
|
|
this.$axios.get('extends/listbyloginwithgroup', {})
|
|
|
.then(res => {
|
|
|
@@ -375,17 +600,79 @@
|
|
|
getextends() {
|
|
|
this.$axios.get('extends/listbylogin', {})
|
|
|
.then(res => {
|
|
|
- // response
|
|
|
this.animalextends = res.data
|
|
|
- if (this.pid > '0') {
|
|
|
+ if (this.pid > '1' && this.pid != 'addsource') {
|
|
|
this.getanimalinfo()
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- // handle error
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ getDictOptions() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/sampletype/arealist', {})
|
|
|
+ .then(res => {
|
|
|
+ this.dictData = res.data.items;
|
|
|
+ if (this.dictData) {
|
|
|
+ this.getCityList(this.dictData['GaodeMapChinaAreas'])
|
|
|
+ //this.getCountryList(this.dictData['CountryList'])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCityList(val) {
|
|
|
+ let resultData = JSON.parse(val)
|
|
|
+ let countstr = JSON.stringify(resultData.districts[0].districts)
|
|
|
+ countstr = countstr.replace(/\,\"districts\"\:\[\]/g, '')
|
|
|
+ this.countryoptions = JSON.parse(countstr)
|
|
|
+ },
|
|
|
+ // getCountryList(val) {
|
|
|
+ // let tmpJson = JSON.parse(val)
|
|
|
+ // this.countryListOptions = []
|
|
|
+ // for (let idx in tmpJson) {
|
|
|
+ // this.countryListOptions.push({
|
|
|
+ // label: tmpJson[idx].split('-')[0],
|
|
|
+ // value: tmpJson[idx].split('-')[1],
|
|
|
+ // code: tmpJson[idx].split('-')[2],
|
|
|
+ // key: tmpJson[idx]
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ handleAreaChange(value) {
|
|
|
+ this.samplesForm.Province = value[0]
|
|
|
+ this.samplesForm.City = value[1]
|
|
|
+ this.samplesForm.Street = value[2]
|
|
|
+ for (var i = 0; i < this.countryoptions.length; i++) {
|
|
|
+ if (value[0] == this.countryoptions[i].adcode) {
|
|
|
+ this.samplesForm.ProvinceName = this.countryoptions[i].name
|
|
|
+
|
|
|
+ if (this.countryoptions[i].districts) {
|
|
|
+ for (var n = 0; n < this.countryoptions[i].districts.length; n++) {
|
|
|
+ if (value[1] == this.countryoptions[i].districts[n].adcode) {
|
|
|
+ this.samplesForm.CityName = this.countryoptions[i].districts[n].name
|
|
|
+
|
|
|
+ if (this.countryoptions[i].districts[n].districts) {
|
|
|
+ for (var m = 0; m < this.countryoptions[i].districts[n].districts.length; m++) {
|
|
|
+ if (value[2] == this.countryoptions[i].districts[n].districts[m].adcode) {
|
|
|
+ this.samplesForm.StreetName = this.countryoptions[i].districts[n].districts[m].name
|
|
|
+ this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].districts[n].districts[m]
|
|
|
+ .citycode).slice(-4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.samplesForm.StreetName = this.countryoptions[i].districts[n].name
|
|
|
+ this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].districts[n].citycode).slice(
|
|
|
+ -4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.samplesForm.StreetName = this.countryoptions[i].name
|
|
|
+ this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].citycode).slice(-4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//获取当前上传图片字段
|
|
|
getitem(val) {
|
|
|
this.imagefiles = ''
|
|
|
@@ -474,6 +761,28 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //获取权限
|
|
|
+ getPermissions() {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ let params = {
|
|
|
+ percodes: `'${this.permissionscode.srapprove}'`
|
|
|
+ }
|
|
|
+ this.$axios.get('/permissions/isauths', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data instanceof Array && res.data.length > 0) {
|
|
|
+ res.data.forEach(element => {
|
|
|
+ _this.permissions[element.Code] = element.Isperm
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
|