Commit 36ff3e3b by zhuxiaomei

抽样单和历史抽样数据

parent 9c66bda5
......@@ -43,7 +43,8 @@
},
"globals": {
"BMap": true,
"AMap": true
"AMap": true,
"plus": true
},
"rules": {}
},
......
......@@ -6,6 +6,8 @@ import http from '../http'
export default {
page: data => http.post('/drs/v1/sampling_place/page', data).then(res => res),
pageApp: data => http.post('/drs/v1/sampling_place/page_app', data).then(res => res),
edit:data=> http.put('/drs/v1/sampling_place/' + data.id, data.obj).then(res=>res),
edit: data => http.put('/drs/v1/sampling_place/' + data.id, data.obj).then(res => res),
listPlaces: data => http.post('/drs/v1/sampling_place/list_places', data).then(res => res),
addMulti: data => http.put('/drs/v1/sampling_place/upload_multi_selected', data).then(res => res),
}
/**
* 双随机抽样计划附件表相关
*/
import http from '../../api/http'
export default {
page: data => http.post('/drs/v1/sampling_plan_attachment/page', data).then(res => res),
list: data => http.post('/drs/v1/sampling_plan_attachment/list', data).then(res => res),
add: data => http.post('/drs/v1/sampling_plan_attachment/', data).then(res => res),
edit: data => http.put('/drs/v1/sampling_plan_attachment/' + data.id, data.obj).then(res => res),
deleteByIds: data => http.delete('/drs/v1/sampling_plan_attachment/?ids=' + data.id).then(res => res),
getById: id => http.get('/drs/v1/sampling_plan_attachment/' + id).then(res => res),
//计划下的附件是图片的附件id集合
getImgById: id => http.post('/drs/v1/sampling_plan_attachment/list_picture_by_plan_id?planId=' + id).then(res => res),
}
/**
* 双随机抽样货架表相关
*/
import http from '../../api/http'
import httpJson from '../../api/httpJson'
export default {
page: data => http.post('/drs/v1/sampling_summary/page', data).then(res => res),
add: data => httpJson.post('/drs/v1/sampling_summary/', JSON.stringify(data)).then(res => res),
edit: data => httpJson.post('/drs/v1/sampling_summary/',JSON.stringify(data)).then(res => res),
deleteByIds: ids => http.delete('/drs/v1/sampling_summary/?ids=' + ids).then(res => res),
getById: id => http.get('/drs/v1/sampling_summary/' + id).then(res => res),
}
......@@ -29,3 +29,5 @@ export {default as message} from './message/message'
export {default as samplingPlan} from './drs/sampling-plan'
export {default as samplingPlace} from './drs/sampling-place'
export {default as samplingShelf} from './drs/sampling-shelf'
export {default as samplingSummary} from './drs/sampling-summary'
export {default as samplingPlanAttachment} from './drs/sampling-plan-attachment'
......@@ -6,10 +6,11 @@
@high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="抽样单编号" placeholder="请输入抽样单编号"></van-field>
<datetime-field label="抽样日期" v-model="formObj.planDate"></datetime-field>
<van-field v-model="formObj.name" label="任务名称" placeholder="请输入任务名称"></van-field>
<van-field v-model="formObj.name" label="被抽样单位" placeholder="请输入被抽样单位名称"></van-field>
<van-field v-model="formObj.samplingNum" label="抽样单编号" placeholder="请输入抽样单编号"></van-field>
<datetime-field label="抽样开始日期" v-model="formObj.samplingDateBegin"></datetime-field>
<datetime-field label="抽样结束日期" v-model="formObj.samplingDateEnd"></datetime-field>
<van-field v-model="formObj.taskName" label="任务名称" placeholder="请输入任务名称"></van-field>
<van-field v-model="formObj.testedName" label="被抽样单位" placeholder="请输入被抽样单位名称"></van-field>
</template>
</search-bar>
<div class="layout-cont-sh">
......@@ -20,13 +21,13 @@
@load="onLoad">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_goto(item)">
<div>抽样单编号:</div>
<div>抽样日期:</div>
<div>任务名称:</div>
<div>任务编号:</div>
<div>生产名称:</div>
<div>样品名称:</div>
<div>被抽样单位名称:</div>
<div>抽样单编号:{{item.samplingNum}}</div>
<div>抽样日期:{{item.samplingDate?$dateformat(item.samplingDate,'yyyy-mm-dd'):''}}</div>
<div>任务名称:{{item.taskName}}</div>
<div>任务编号:{{item.taskNum}}</div>
<div>生产者名称:{{item.proName}}</div>
<div>样品名称:{{item.sampleName}}</div>
<div>被抽样单位名称:{{item.testedName}}</div>
</div>
</van-swipe-cell>
</van-list>
......@@ -35,43 +36,99 @@
</template>
<script>
import {samplingSummary} from '../../api'
export default {
name: "SamplingList",
data() {
return {
formObj: {
name: '',
planDate: '',
uname: '',
ctime: ''
samplingNum: '',
samplingDateBegin: '',
samplingDateEnd: '',
taskName: '',
testedName: '',
isHistory: 1
},
resultList: [
{name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2},
]
key: '',
resultList: [],
page: 1,
rows: 10,
refreshing: false,//刷新中...
loading: false,//加载中...
finished: false,//没有更多数据
}
},
mounted() {
this._getData()
},
methods: {
//简单查询 清空高级查询条件 赋值简单查询数据
_search(value) {
this.key = value
this.formObj = this.$resetFields(this.formObj)
console.log('search', value)
this.formObj.isHistory = 1
this._refresh()
},
//高级搜索 清空key 查询
_valParams() {
if (this.formObj.samplingDateBegin === '' && this.formObj.samplingDateEnd !== '') {
this.$toast('请选择抽样开始日期!')
return false
} else if (this.formObj.samplingDateBegin !== '' && this.formObj.samplingDateEnd === '') {
this.$toast('请选择抽样结束日期!')
return false
} else if (this.formObj.samplingDateBegin !== '' && this.formObj.samplingDateEnd !== '' && (new Date(this.formObj.planDateBegin) > new Date(this.formObj.planDateEnd))) {
this.$toast('抽样开始日期不能大于抽样结束日期!')
return false
}
return true
},
_highSearch() {
console.log('high-search')
console.log(this.formObj, 'formObj')
this.key = ''
if (this._valParams()) {
this.$refs.searchBar._hideHighSearch()
this._refresh()
}
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
console.log(this.formObj, 123)
this.formObj.isHistory = 1
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
...this.formObj
};
if (this.key) {
data.samplingNum = this.key
}
return this.$serializeForm(data)
},
_getData: async function () {
let result = await samplingSummary.page(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
if (this.resultList.length === result.total) {
this.finished = true
}
},
_goto(){
this.$router.push('/sampling_list/sampling_list_detail')
_refresh() {
this.page = 1;
this._getData()
},
_load() {
this.page = this.page + 1;
this._getData()
},
_goto(item) {
if (item.testedType === 1) {
this.$router.push({path: '/sampling_list/sampling_list_detail_net', query: {id: item.id}})
} else {
this.$router.push({path: '/sampling_list/sampling_list_detail', query: {id: item.id}})
}
}
}
}
......
......@@ -19,13 +19,13 @@
<!--todo 批量打印、删除-->
</template>
<template #content>
<search-bar label="抽样单编号" highSearch @search="_search" @high-search="_highSearch"
<search-bar label="抽样单编号" ref="searchBar"
highSearch @search="_search" @high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="抽样单编号" placeholder="请输入抽样单编号"></van-field>
<!--<datetime-field label="计划日期" v-model="formObj.planDate"></datetime-field>-->
<!--<van-field v-model="formObj.uname" label="登记人" placeholder="请输入登记人"></van-field>-->
<!--<datetime-field label="登记日期" v-model="formObj.ctime"></datetime-field>-->
<van-field v-model="formObj.placeName" label="地点" placeholder="请输入地点"></van-field>
<van-field v-model="formObj.shelfName" label="货架" placeholder="请输入货架"></van-field>
</template>
</search-bar>
<div class="layout-cont-sh" :class="{'layout-cont-sh-btn':showCheck}">
......@@ -41,19 +41,22 @@
<van-swipe-cell v-for="item in resultList" :key="item.id">
<div class="result-item" @click="_tapItem(item)" v-touch:longtap="_longtapHandler">
<van-checkbox :name="item.id" shape="square" v-if="showCheck"></van-checkbox>
<div>计划名称:{{item.name}}</div>
<div>抽样进度:已填抽样单/抽样数</div>
<div>状态:{{item.status}}</div>
<p>附件:</p>
<div>抽样单编号:{{item.samplingNum}}</div>
<div>抽样日期:{{item.samplingDate?$dateformat(item.samplingDate,'yyyy-mm-dd'):''}}</div>
<div>生产者名称:{{item.proName}}</div>
<div>样品名称:{{item.sampleName}}</div>
<div>被抽样单位名称:{{item.testedName}}</div>
<div>地点:{{item.placeName}}</div>
<div>货架:{{item.shelfName}}</div>
<p @click.stop="_goFile(item.id)" style="margin:20px auto">附件:</p>
</div>
<template #right>
<van-button square type="info" text="编辑" class="swipe-cell-btn"
@click="_edit"></van-button>
@click="_edit(item)"></van-button>
<van-button square type="primary" text="打印" class="swipe-cell-btn"
@click="_print"></van-button>
@click="_print(item)"></van-button>
<van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_del"></van-button>
@click="_del([item.id])"></van-button>
</template>
</van-swipe-cell>
</van-checkbox-group>
......@@ -62,6 +65,7 @@
</div>
<div class="bottom-btn">
<div v-if="showCheck" @click="_checkAll">{{checkAll?'取消全选':'全选'}}</div>
<van-button square type="info" @click="_del(checkListValue)">删除</van-button>
</div>
</template>
<SelectShelves ref="shelvesSelect" @on-select="_shelvesResult"></SelectShelves>
......@@ -69,8 +73,8 @@
</template>
<script>
import {message} from '@/api'
import SelectShelves from './components/SelectShelves'
import {samplingSummary} from '../../api'
export default {
name: "SamplingList",
......@@ -80,8 +84,11 @@
data() {
return {
formObj: {
name: ''
name: '',
placeName: '',
shelfName: '',
},
key:'',
showPopup: true,
showCheck: false,
checkListValue: [],
......@@ -91,6 +98,7 @@
refreshing: false,//刷新中...
loading: false,//加载中...
finished: false,//没有更多数据
planId: this.$route.query.planId
}
},
watch: {
......@@ -108,32 +116,38 @@
}
},
mounted() {
this._page()
this._getData()
},
methods: {
//简单查询 清空高级查询条件 赋值简单查询数据
_search(value) {
this.key = value
this.formObj = this.$resetFields(this.formObj)
this._refresh()
console.log('search', value)
},
//高级搜索 清空key 查询
_highSearch() {
console.log('high-search')
console.log(this.formObj, 'formObj')
this.key = ''
this.$refs.searchBar._hideHighSearch()
this._refresh()
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
console.log(this.formObj, 123)
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
planId: this.planId,
...this.formObj//todo 简单查询的关键字
};
if(this.key){
data.samplingNum = this.key
}
return this.$serializeForm(data)
},
_page: async function () {
let result = await message.myPage(this._searchParams())
_getData: async function () {
let result = await samplingSummary.page(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
......@@ -143,27 +157,27 @@
},
_refresh() {
this.page = 1;
this._page()
this._getData()
},
_load() {
this.page = this.page + 1;
this._page()
this._getData()
},
_back() {
this.$router.go(-1)
},
_add() {
this.$refs.shelvesSelect._open()
this.$refs.shelvesSelect._open(this.planId)
},
_shelvesResult(res) {
if (res === '1') {
this.$router.push('/sampling_list/sampling_list_add_net')
_shelvesResult({testedType, shelfId}) {
console.log(testedType, 'testedType')
if (testedType === 1) {
this.$router.push({path: '/sampling_list/sampling_list_add_net', query: {testedType, shelfId}})
} else {
this.$router.push('/sampling_list/sampling_list_add')
this.$router.push({path: '/sampling_list/sampling_list_add', query: {testedType, shelfId}})
}
},
_longtapHandler() {
console.log(1)
this.showCheck = true
},
_hideCheck() {
......@@ -185,22 +199,40 @@
this.checkListValue.splice(this.checkListValue.indexOf(item.id), 1);
}
} else {
if (item.type === 1) {
this.$router.push('/sampling_list/sampling_list_detail_net')
if (item.testedType === 1) {
this.$router.push({path: '/sampling_list/sampling_list_detail_net', query: {id: item.id}})
} else {
this.$router.push('/sampling_list/sampling_list_detail')
this.$router.push({path: '/sampling_list/sampling_list_detail', query: {id: item.id}})
}
}
},
_edit() {
_edit(item) {
if (item.testedType === 1) {
this.$router.push({path: '/sampling_list/sampling_list_add_net', query: {id: item.id}})
} else {
this.$router.push({path: '/sampling_list/sampling_list_add', query: {id: item.id}})
}
},
_print() {
/*todo 蓝牙打印*/
},
_del() {
_del(ids) {
if (ids.length === 0) {
this.$toast('请至少选择一条数据!')
} else {
this._delOk()
}
},
_delOk: async function (ids) {
let result = await samplingSummary.deleteByIds(ids)
if (result) {
this.$toast('操作成功!')
this._refresh()
}
},
_goFile(id) {
this.$router.push({path: '/sampling_list/file', query: {id: id}})
}
}
}
</script>
......
......@@ -705,6 +705,7 @@
import SamplingListAddTable from './components/SamplingListAddTable'
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
import {samplingSummary} from '../../api'
export default {
name: "SamplingListAdd",
......@@ -797,7 +798,7 @@
thirdPartyNatureList: ['委托', '代理', '经销', '进口', '其他'],
storageCondition:'',
storageCondition:[],
place: '', //1生产环节2流通环节3餐饮环节 值为“环节,地点”
placeRemark1: '',
placeRemark2: '',
......@@ -818,9 +819,48 @@
{label: '建筑工地食堂', value: '食堂(建筑工地食堂)'},
],
restLinkList3: ['小吃店', '快餐店', '饮品店集体用餐配送单位', '中央厨房', '其他'],
id: '',
testedType: this.$route.query.testedType,
shelfId: this.$route.query.shelfId
}
},
mounted() {
this._open()
},
methods: {
_open() {
console.log(this.$route.query.id,'this.$route.query.id')
if (this.$route.query.id) {
this.id = this.$route.query.id
this._getData()
} else {
this.id = ''
}
},
_getData: async function () {
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
this.formObj[key] = result[key]
}
}
for(let key in this.netTested){
if(result.netTested[key]){
this.netTested = result.netTested[key]
}
}
for(let key in this.sample){
if(result.sample[key]){
this.sample = result.sample[key]
}
}
this.testedType = result.testedType
this.shelfId = result.shelfId
}
},
_ok() {
let data = Object.assign({}, this.formObj, {nonNetTested: this.nonNetTested}, {sample: this.sample})
data.sample.storageCondition = this.storageCondition.join(',')
......@@ -839,8 +879,29 @@
break
}
}
console.log(data, 'data')
data.shelfId = this.shelfId
data.testedType = this.testedType
console.log(this.testedType,'this.testedType')
if (this.id) {
this._editSave(data)
} else {
this._addSave(data)
}
},
_addSave: async function (data) {
let result = await samplingSummary.add(data)
if (result) {
this.$toast('添加成功!')
this.$router.go(-1)
}
},
_editSave: async function (data) {
let result = await samplingSummary.edit({id: this.id, obj: data})
if (result) {
this.$toast('编辑成功!')
this.$router.go(-1)
}
}
}
}
</script>
......
......@@ -700,6 +700,8 @@
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
import {samplingSummary} from '../../api'
export default {
name: "SamplingListAddNet",
components: {
......@@ -725,7 +727,7 @@
thirdPartyName: '',
thirdPartyAddress: '',
thirdPartyNature: '',
thirdPartyNatureRemark:'',
thirdPartyNatureRemark: '',
thirdPartyLicense: '',
thirdPartyTel: '',
......@@ -765,18 +767,18 @@
sourceRemark: '',
properties: '',
propertiesRemark: '',
dateType:'',
dateType: '',
shelfLife: '',
standard: '',
qualityGrade: '',
specification: '',
quantity:'',
backupQuanity:'',
quantity: '',
backupQuanity: '',
samplingMethod: '',
qrcode: '',
price: '',
inward:'',
originPlace:'',
inward: '',
originPlace: '',
packClass: '',
storageCondition: '',
storageConditionRemark: '',
......@@ -792,13 +794,48 @@
storageConditionList: ['常温', '冷藏', '冷冻', '避光', '密闭', '阴凉', '通风', '干燥', '其他'],
thirdPartyNatureList: ['委托', '代理', '经销', '进口', '其他'],
place:'',
storageCondition:[],
place: '',
storageCondition: [],
id: '',
testedType: this.$route.query.testedType,
shelfId: this.$route.query.shelfId
}
},
methods:{
_open(){
mounted() {
this._open()
},
methods: {
_open() {
if (this.$route.query.id) {
this.id = this.$route.query.id
this._getData()
} else {
this.id = ''
}
},
_getData: async function () {
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
this.formObj[key] = result[key]
}
}
for(let key in this.netTested){
if(result.netTested[key]){
this.netTested = result.netTested[key]
}
}
for(let key in this.sample){
if(result.sample[key]){
this.sample = result.sample[key]
}
}
this.testedType = result.testedType
this.shelfId = result.shelfId
}
},
_ok() {
let data = Object.assign({}, this.formObj, {netTested: this.netTested}, {sample: this.sample})
......@@ -807,8 +844,29 @@
data.netTested.placeLink = this.place.split(',')[0]
data.netTested.place = this.place.split(',')[1]
}
console.log(data, 'data')
data.shelfId = this.shelfId
data.testedType = this.testedType
if (this.id) {
this._editSave(data)
} else {
this._addSave(data)
}
},
_addSave: async function (data) {
let result = await samplingSummary.add(data)
if (result) {
this.$toast('添加成功!')
this.$router.go(-1)
}
},
_editSave: async function (data) {
data.id = this.id
let result = await samplingSummary.edit(data)
if (result) {
this.$toast('编辑成功!')
this.$router.go(-1)
}
}
}
}
</script>
......
<template>
<div>
详情
<add-table>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="samplingNum"
v-model="formObj.samplingNum"
label="抽样单编号"
:rules="[{ required: true, message: '请填写抽样单编号' }]"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.taskNum"
label="No."
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.source"
label="任务来源"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="任务类别">
<template #input>
<van-radio-group disabled v-model="formObj.taskType" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in taskTypeList">
{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
被抽样单位信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="nonNetTested.name"
label="单位名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="nonNetTested.address"
label="单位地址"
placeholder="如证照与许可证不一致,以许可证为准"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="区域类型">
<template #input>
<van-radio-group disabled v-model="nonNetTested.areaType" direction="horizontal">
<van-radio v-for="item in areaTypeList" :key="item" :name="item" shape="square">
{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.areaTypeRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-radio-group disabled v-model="nonNetTested.permitType" direction="horizontal">
<van-radio v-for="item in permitTypeList" :key="item" :name="item" shape="square">
{{item}}
</van-radio>
</van-radio-group>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.permitNum"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.legalPerson"
label="法人代表"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.linkman"
label="联系人"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.license"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="nonNetTested.tel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
抽样地点
</table-col>
<table-col>
<van-radio-group disabled v-model="place" direction="horizontal">
<div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center">生产环节:</div>
<van-radio v-for="item in proLinkList" :key="item" :name="1+','+item" shape="square">
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="placeRemark1"
></van-field>
</div>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center">流通环节:</div>
<van-radio v-for="item in flowLinkList" :key="item" :name="2+','+item" shape="square">
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="placeRemark2"
></van-field>
</div>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;">餐饮环节:</div>
<van-radio v-for="item in restLinkList1" :key="item.value" :name="3+','+item.value"
shape="square">
{{item.label}}
</van-radio>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;width:72px"></div>
<van-radio v-for="item in restLinkList2" :key="item.value" :name="3+','+item.value"
shape="square">
{{item.label}}
</van-radio>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;width:72px"></div>
<van-radio v-for="item in restLinkList3" :key="item.value" :name="3+','+item"
shape="square">{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="placeRemark3"
></van-field>
</div>
</div>
</div>
</van-radio-group>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
样品信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="sampleName"
v-model="formObj.sampleName"
label="样品名称"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.trademark"
label="商标"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.qrcode"
label="条形码"
></van-field>
</table-col>
</table-row>
<table-row>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品类型">
<template #input>
<van-radio-group disabled v-model="sample.type" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in sampleTypeList">
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.typeRemark"
></van-field>
</div>
</van-radio-group>
</template>
</van-field>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品来源">
<template #input>
<van-radio-group disabled v-model="sample.source" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in sourceList">
{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.sourceRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品属性">
<template #input>
<van-radio-group disabled v-model="sample.properties" direction="horizontal">
<van-radio :name="item" :key="item" shape="square"
v-for="item in propertiesList">{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.propertiesRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-radio-group disabled v-model="sample.dateType" direction="horizontal">
<van-radio v-for="item in dateTypeList" :key="item" :name="item" shape="square">
{{item}}
</van-radio>
</van-radio-group>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.standard"
label="执行标准/技术文档"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.batchNo"
label="样品批号"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.specification"
label="规格型号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.qualityGrade"
label="质量等级"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.shelfLife"
label="保质期"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.price"
label="单价"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.samplingBase"
label="抽样基数"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.quantity"
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"
label="备样数量"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="抽样方式">
<template #input>
<van-radio-group disabled v-model="sample.samplingMethod" direction="horizontal">
<van-radio :name="item" v-for="item in samplingMethodList" :key="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="是否进口">
<template #input>
<van-radio-group disabled v-model="sample.inward" direction="horizontal">
<van-radio v-for="item in trueOrFalseList" :key="item.value" :name="item.value"
shape="square">{{item.label}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.originPlace"
label="原产地"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="包装分类">
<template #input>
<van-radio-group disabled v-model="sample.packClass" direction="horizontal">
<van-radio v-for="item in packClassList" :name="item" :key="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="储存条件">
<template #input>
<van-checkbox-group disabled v-model="storageCondition" direction="horizontal">
<van-checkbox v-for="item in storageConditionList" :name="item" :key="item"
shape="square">{{item}}
</van-checkbox>
</van-checkbox-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.storageConditionRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)生产者信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proName"
label="生产者名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proAddress"
label="生产者地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.prolicense"
label="生产许可证号"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proTel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)第三方企业信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyName"
label="企业名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyAddress"
label="企业地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="企业性质">
<template #input>
<van-radio-group disabled v-model="formObj.thirdPartyNature" direction="horizontal">
<van-radio v-for="item in thirdPartyNatureList" :key="item" :name="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.thirdPartyNatureRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyLicense"
label="企业许可证号"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyTel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>抽样单位信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testName"
label="单位名称"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testAddress"
label="地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testLinkman"
label="联系人"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testTel"
label="电话"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testFax"
label="传真"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="100px"
label-align="center"
v-model="formObj.remark"
label="备注"
></van-field>
</table-col>
</table-row>
</add-table>
<div class="bottom-btn">
<van-button block type="info" @click="_goto">返回</van-button>
</div>
</div>
</template>
<script>
import SamplingListAddTable from './components/SamplingListAddTable'
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
import {samplingSummary} from '../../api'
export default {
name: "SamplingListDetail"
name: "SamplingListAdd",
components: {
"add-table": SamplingListAddTable,
"table-row": TableRow,
"table-col": TableCol
},
data() {
return {
formObj: {
samplingNum: '',
taskNum: '',
sampleName: '',
source: '',
taskType: '',
proName: '',
proAddress: '',
prolicense: '',
proTel: '',
thirdPartyName: '',
thirdPartyAddress: '',
thirdPartyNature: '',
thirdPartyNatureRemark: '',
thirdPartyLicense: '',
thirdPartyTel: '',
testName: '',
testAddress: '',
testLinkman: '',
testTel: '',
testFax: '',
remark: ''
},
nonNetTested: {
name: '',
address: '',
areaType: '',
areaTypeRemark: '',
permitType: '',
permitNum: '',
legalPerson: '',
linkman: '',
license: '',
tel: '',
placeLink: '',//保存时单独赋值 从place字段分离出
place: '', //保存时单独赋值 从place字段分离出
placeRemark: '' //保存时单独赋值 根据环节取对应的placeRemarkN
},
sample: {
trademark: '',
qrcode: '',
type: '',
typeRemark: '',
source: '',
sourceRemark: '',
properties: '',
propertiesRemark: '',
dateType: '',
standard: '',
batchNo: '',
specification: '',
qualityGrade: '',
shelfLife: '',
price: '',
samplingBase: '',
quantity: '',
backupQuanity: '',
samplingMethod: '',
inward: '',
originPlace: '',
packClass: '',
storageCondition: [],
storageConditionRemark: ''
},
taskTypeList: ['监督抽检', '风险监测', '评价性抽检'],
areaTypeList: ['景点', '城市', '乡镇', '学校周边', '其他'],
permitTypeList: ['经营许可证号', '生产许可证号'],
sampleTypeList: ['食用农产品', '工业加工食品', '餐饮加工食品', '食品添加剂', '食品相关产品', '其他',],
sourceList: ['加工/自制', '委托生产', '外购', '其他'],
propertiesList: ['普通食品', '特殊食品', '节令食品', '重大活动保障食品', '其他',],
dateTypeList: ['生产日期', '购进日期', '加工日期', '检疫日期'],
samplingMethodList: ['无菌抽样', '非无菌抽样'],
trueOrFalseList: [{label: '是', value: 1}, {label: '否', value: 0}],
packClassList: ['预包装', '非定量包装', '无包装'],
storageConditionList: ['常温', '冷藏', '冷冻', '避光', '密闭', '阴凉', '通风', '干燥', '其他'],
thirdPartyNatureList: ['委托', '代理', '经销', '进口', '其他'],
storageCondition:[],
place: '', //1生产环节2流通环节3餐饮环节 值为“环节,地点”
placeRemark1: '',
placeRemark2: '',
placeRemark3: '',
proLinkList: ['原辅料库', '生产线', '半成品库', '成品库待检区', '成品库已检区', '其他'],
flowLinkList: ['农贸市场', '菜市场', '批发市场', '商场', '超市', '小食杂店', '其他'],
restLinkList1: [
{label: '特大型餐馆', value: '餐馆(特大型餐馆)'},
{label: '大型餐馆', value: '餐馆(大型餐馆)'},
{label: '中型餐馆', value: '餐馆(中型餐馆)'},
{label: '小型餐馆', value: '餐馆(小型餐馆)'},
],
restLinkList2: [
{label: '机关食堂', value: '食堂(机关食堂)'},
{label: '学校/托幼食堂', value: '食堂(学校/托幼食堂)'},
{label: '企事业单位食堂', value: '食堂(企事业单位食堂)'},
{label: '建筑工地食堂', value: '食堂(建筑工地食堂)'},
],
restLinkList3: ['小吃店', '快餐店', '饮品店集体用餐配送单位', '中央厨房', '其他'],
id: '',
}
},
mounted() {
this._open()
},
methods: {
_open() {
this.id = this.$route.query.id
this._getData()
},
_getData: async function () {
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
this.formObj[key] = result[key]
}
}
for(let key in this.netTested){
if(result.netTested[key]){
this.netTested = result.netTested[key]
}
}
for(let key in this.sample){
if(result.sample[key]){
this.sample = result.sample[key]
}
}
this.testedType = result.testedType
this.shelfId = result.shelfId
}
},
_goto(){
this.$router.go(-1)
}
}
}
</script>
<style scoped>
<style lang="less">
@import "../../styles/sampling-list-add.less";
</style>
<template>
<div>
详情网络
<add-table>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.samplingNum"
label="抽样单编号"
:rules="[{ required: true, message: '请填写抽样单编号' }]"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.taskNum"
label="No."
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.source"
label="任务来源"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="任务类别">
<template #input>
<van-radio-group disabled v-model="formObj.taskType" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in taskTypeList">
{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
网络食品交易第三方平台提供者信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.plantformName"
label="平台名称"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.plantformLicense"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.plantformSite"
label="平台网址"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.plantformPermit"
label="电信业务经营许可证"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.plantformAddress"
label="平台地址"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.legalPerson"
label="法人代表"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
被抽样单位信息(入网经营者信息)
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="netTested.name"
label="单位名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="netTested.samplingPlace"
label="单位地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="netTested.estore"
label="网店商铺名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="netTested.sampleSite"
label="样品网址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-radio-group disabled v-model="netTested.permitType" direction="horizontal">
<van-radio v-for="item in permitTypeList" :key="item" :name="item" shape="square">
{{item}}
</van-radio>
</van-radio-group>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.permitNum"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.linkman"
label="联系人"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.license"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="netTested.tel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
抽样地点
</table-col>
<table-col>
<van-radio-group disabled v-model="place" direction="horizontal">
<van-radio :name="1+',网购'" shape="square">流通环节:网购</van-radio>
<van-radio :name="2+',外卖餐饮'" shape="square">餐饮环节:外卖餐饮</van-radio>
</van-radio-group>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
样品信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.sampleName"
label="样品名称"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.trademark"
label="商标"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.num"
label="订单编号"
></van-field>
</table-col>
</table-row>
<table-row>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品类型">
<template #input>
<van-radio-group disabled v-model="sample.type" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in sampleTypeList">
{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.typeRemak"
></van-field>
</div>
</template>
</van-field>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品来源">
<template #input>
<van-radio-group disabled v-model="sample.source" direction="horizontal">
<van-radio :name="item" :key="item" shape="square" v-for="item in sourceList">
{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.sourceRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="样品属性">
<template #input>
<van-radio-group disabled v-model="sample.properties" direction="horizontal">
<van-radio :name="item" :key="item" shape="square"
v-for="item in propertiesList">{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.propertiesRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-radio-group disabled v-model="sample.dateType" direction="horizontal">
<van-radio name="生产日期" shape="square">生产日期</van-radio>
<van-radio name="加工日期" shape="square">加工日期</van-radio>
</van-radio-group>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.shelfLife"
label="保质期"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.dateBatch"
label="生产批号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.standard"
label="执行标准/技术文件"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.qualityGrade"
label="质量等级"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.specification"
label="规格型号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.quantity"
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"
label="备样数量"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="抽样方式">
<template #input>
<van-radio-group disabled v-model="sample.samplingMethod" direction="horizontal">
<van-radio :name="item" v-for="item in samplingMethodList" :key="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.qrcode"
label="条形码"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.price"
label="单价"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
label="是否进口">
<template #input>
<van-radio-group disabled v-model="sample.inward" direction="horizontal">
<van-radio v-for="item in trueOrFalseList" :key="item.value" :name="item.value"
shape="square">{{item.label}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.originPlace"
label="原产地"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="包装分类">
<template #input>
<van-radio-group disabled v-model="sample.packClass" direction="horizontal">
<van-radio v-for="item in packClassList" :name="item" :key="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="储存条件">
<template #input>
<van-checkbox-group disabled v-model="storageCondition" direction="horizontal">
<van-checkbox v-for="item in storageConditionList" :name="item" :key="item"
shape="square">{{item}}
</van-checkbox>
</van-checkbox-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.storageConditionRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)生产者信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proName"
label="生产者名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proAddress"
label="生产者地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.prolicense"
label="生产许可证号"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.proTel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)第三方企业信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyName"
label="企业名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyAddress"
label="企业地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
label="企业性质">
<template #input>
<van-radio-group disabled v-model="formObj.thirdPartyNature" direction="horizontal">
<van-radio v-for="item in thirdPartyNatureList" :key="item" :name="item"
shape="square">{{item}}
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.thirdPartyNatureRemark"
></van-field>
</div>
</template>
</van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyLicense"
label="企业许可证号"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.thirdPartyTel"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>抽样单位信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testName"
label="单位名称"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="formObj.testAddress"
label="地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testLinkman"
label="联系人"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testTel"
label="电话"
></van-field>
</table-col>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="25%"
label-align="center"
v-model="formObj.testFax"
label="传真"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="100px"
label-align="center"
v-model="formObj.remark"
label="备注"
></van-field>
</table-col>
</table-row>
</add-table>
<div class="bottom-btn">
<van-button block type="info" @click="_goto">返回</van-button>
</div>
</div>
</template>
<script>
import SamplingListAddTable from './components/SamplingListAddTable'
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
import {samplingSummary} from '../../api'
export default {
name: "SamplingListDetail"
name: "SamplingListAddNet",
components: {
"add-table": SamplingListAddTable,
"table-row": TableRow,
"table-col": TableCol
},
data() {
return {
formObj: {
samplingNum: '',
taskNum: '',
source: '',
taskType: '',
sampleName: '',
dateBatch: '',
proName: '',
proAddress: '',
prolicense: '',
proTel: '',
thirdPartyName: '',
thirdPartyAddress: '',
thirdPartyNature: '',
thirdPartyNatureRemark: '',
thirdPartyLicense: '',
thirdPartyTel: '',
testName: '',
testAddress: '',
testLinkman: '',
testTel: '',
testFax: '',
remark: ''
},
netTested: {
plantformName: '',
plantformLicense: '',
plantformSite: '',
plantformPermit: '',
plantformAddress: '',
legalPerson: '',
name: '',
samplingPlace: '',
estore: '',
sampleSite: '',
permitType: '',
permitNum: '',
linkman: '',
license: '',
tel: '',
placeLink: '',//保存时单独赋值 从place字段分离出
place: '', //保存时单独赋值 从place字段分离出
},
sample: {
trademark: '',
num: '',
type: '',
typeRemak: '',
source: '',
sourceRemark: '',
properties: '',
propertiesRemark: '',
dateType: '',
shelfLife: '',
standard: '',
qualityGrade: '',
specification: '',
quantity: '',
backupQuanity: '',
samplingMethod: '',
qrcode: '',
price: '',
inward: '',
originPlace: '',
packClass: '',
storageCondition: '',
storageConditionRemark: '',
},
taskTypeList: ['监督抽检', '风险监测', '评价性抽检'],
permitTypeList: ['经营许可证号', '生产许可证号'],
sampleTypeList: ['食用农产品', '工业加工食品', '餐饮加工食品', '食品添加剂', '食品相关产品', '其他',],
sourceList: ['加工/自制', '委托生产', '外购', '其他'],
propertiesList: ['普通食品', '特殊食品', '节令食品', '重大活动保障食品', '其他',],
samplingMethodList: ['无菌抽样', '非无菌抽样'],
trueOrFalseList: [{label: '是', value: 1}, {label: '否', value: 0}],
packClassList: ['预包装', '非定量包装', '无包装'],
storageConditionList: ['常温', '冷藏', '冷冻', '避光', '密闭', '阴凉', '通风', '干燥', '其他'],
thirdPartyNatureList: ['委托', '代理', '经销', '进口', '其他'],
place: '',
storageCondition: [],
id: '',
}
</script>
},
mounted() {
this._open()
},
methods: {
_open() {
this.id = this.$route.query.id
this._getData()
},
_getData: async function () {
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
this.formObj[key] = result[key]
}
}
for (let key in this.netTested) {
if (result.netTested[key]) {
this.netTested = result.netTested[key]
}
}
for (let key in this.sample) {
if (result.sample[key]) {
this.sample = result.sample[key]
}
}
this.testedType = result.testedType
this.shelfId = result.shelfId
}
},
_goto() {
this.$router.go(-1)
},
<style scoped>
}
}
</script>
<style lang="less">
@import "../../styles/sampling-list-add.less";
</style>
......@@ -24,7 +24,7 @@
:finished="finished"
finished-text="没有更多了"
@load="_load">
<div class="result-item" v-for="item in resultList" :key="item.name" @click="_goto(item)">
<div class="result-item" v-for="item in resultList" :key="item.name" @click="_goto(item.id)">
<div>计划名称:{{item.name}}</div>
<div>抽样进度:{{item.completionRatio}}</div>
<div>状态:{{item.progress}}</div>
......@@ -60,6 +60,9 @@
finished: false,//没有更多数据
}
},
mounted() {
this._getData()
},
methods: {
//简单查询 清空高级查询条件 赋值简单查询数据
_search(value) {
......@@ -125,14 +128,14 @@
},
_refresh() {
this.page = 1;
// this._getData()
this._getData()
},
_load() {
this.page = this.page + 1;
this._getData()
},
_goto() {
this.$router.push('/sampling_list/sampling_list')
_goto(id) {
this.$router.push({path:'/sampling_list/sampling_list',query:{planId:id}})
},
}
}
......
......@@ -9,34 +9,26 @@
:safe-area-inset-bottom="true"
:close-on-popstate="true"
:style="{ height: '70%' }">
<!--<van-tree-select height="100%"-->
<!--:items="items"-->
<!--:main-active-index.sync="active"-->
<!--@click-nav="_getShelves">-->
<!--<template #content>-->
<!--<div v-for="item in shelvesList" :key="item" style="height: 40px;background: bisque">{{item}}</div>-->
<!--</template>-->
<!--</van-tree-select>-->
<div class="popup-cont-btn popup-shelves">
<div>
<p>抽样单类型</p>
<van-radio-group v-model="radio" direction="horizontal">
<van-radio name="1">网络</van-radio>
<van-radio name="2">非网络</van-radio>
<van-radio :name="1">网络</van-radio>
<van-radio :name="0">非网络</van-radio>
</van-radio-group>
</div>
<div>
<p>所属货架</p>
<van-tree-select
height="100%"
:items="items"
:items="places"
:active-id.sync="activeId"
:main-active-index.sync="activeIndex"
></van-tree-select>
</div>
</div>
<div class="bottom-btn bottom-btn-two">
<van-button square type="default" color="#f7f8fa" @click="_cancel">取消</van-button>
<van-button square type="default" @click="_cancel">取消</van-button>
<van-button square type="info" @click="_ok">确定</van-button>
</div>
</van-popup>
......@@ -44,15 +36,15 @@
</template>
<script>
import {samplingPlace} from '../../../api'
export default {
name: "SelectShelves",
data() {
return {
showPopup: false,
// items: [{text: '地点 1'}, {text: '地点 2'}],
shelvesList: [],
radio: 0,
items: [
radio: -1,
places: [
{
text: '地点1',
children: [
......@@ -71,44 +63,60 @@
children: [
{
text: '货架2-1',
id: 23,
id: 3,
},
{
text: '货架2-2',
id: 24,
id: 4,
},
],
},
{
text: '地点3',
children: [
{
text: '货架3-1',
id: 5,
},
{
text: '货架3-2',
id: 6,
},
],
},
],
active: 0,
activeId: 0,
activeId: '',
activeIndex: 0,
planId: ''
}
},
methods: {
_open() {
_open(planId) {
this.showPopup = true
this.radio = -1
this.activeId = ''
this.planId = planId
this._getShelves()
},
_getShelves(item) {
if (item === 0) {
this.shelvesList = ['货架1']
_getShelves: async function () {
let result = await samplingPlace.listPlaces({planId: this.planId})
if (result) {
this.places = result
} else {
this.shelvesList = ['货架2']
this.places = []
}
},
_selectResult(item) {
console.log(item, 123)
},
_cancel() {
this.showPopup = false
},
_ok() {
if (this.radio === 0) {
if (this.radio === -1) {
/*todo 修改toast默认配置 https://youzan.github.io/vant/#/zh-CN/toast#xiu-gai-mo-ren-pei-zhi*/
this.$toast('请选择抽样单类型!');
} else if (this.activeId === '') {
this.$toast('请选择货架!')
} else {
this.$emit('on-select', this.radio)
this.$emit('on-select', {testedType: this.radio, shelfId: this.activeId})
}
}
}
......
<template>
<div>
<div class="layout-cont-btn" style="background: #576b95">
<van-pull-refresh v-model="refreshing" @refresh="_refresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="_load">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_download(item)">
<div>附件名称:{{item.fileName +'.'+item.type }}</div>
</div>
<template #right>
<van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_del(item.id)"></van-button>
</template>
</van-swipe-cell>
</van-list>
</van-pull-refresh>
</div>
<div class="bottom-btn bottom-btn-two">
<van-button type="info" block @click="_goto('/sampling/file_upload')">添加附件</van-button>
<van-button type="info" block @click="_uploadImg">添加图片</van-button>
</div>
</div>
</template>
<script>
import {samplingPlanAttachment} from '../../../api'
export default {
data() {
return {
title: '附件',
noDataTitle: '相关附件',
resultList: [],
page: 1,
rows: 20,
contractId: '',
showPrompt: false,
height: '',
imgList: [{
src: '',
}],
preview: false,
fileRename: '',
tempData: {},
loading: false,//加载中...
finished: false,//没有更多数据
refreshing: false,//刷新中...
//文件id
fileId: '',
//上传图片路径:
action: '',
isApp: true
}
},
mounted() {
this.contractId = this.$route.query.contractId;
this.action = this.$global.baseURL + '/drs/v1/sampling_plan_attachment/' + this.contractId;
this._getData();
},
methods: {
_refresh() {
this.page = 1
this._getData()
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
contractId: this.contractId
};
return this.$serializeForm(data)
},
_getData: async function () {
let result = await samplingPlanAttachment.page(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
if (this.resultList.length === result.total) {
this.finished = true
}
},
_load() {
this.page = this.page + 1;
this._getData()
},
//关闭图片
_close() {
this.imgList[0].src = '';
},
//路由跳转
_goto(next) {
let data = {contractId: this.contractId};
this.$router.push({path: next, query: data})
},
_resultChange(msg) {
if (this.$store.state.samplingPlanAttachment.success) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
});
this._search();
}
},
_del(id) {
let flag = this.$route.query.flag;
let data = {};
if (flag === undefined) {
//只可以删除自己上传的附件
data = {id: id, flag: 1};
} else {
//可以删除全部
data = {id: id};
}
this.$store.dispatch('samplingPlanAttachment/deleteByIds', data).then(() => {
this._resultChange('删除成功');
});
},
_addResult() {
this.showPrompt = true;
},
//下载附件
_download(data) {
this.tempData = data;
if (data.type.toLowerCase() === 'jpg' || data.type.toLowerCase() === 'png') {
//预览图片
this.imgList[0].src = this.$global.baseURL + '/drs/v1/sampling_plan_attachment/down?id=' + data.id + '&objectKey=' + data.objectKey;
this.$refs.previewer.show(0);
} else {
//下载文件
let name = '';
if (data.remark === undefined) {
name = data.fileName;
} else {
name = data.remark;
}
this.$router.push({
path: '/sampling/file_down_load',
query: {fileName: name, id: this.tempData.id, ctime: this.tempData.ctime, remark: data.fileName}
})
}
},
//文件重命名
_reName(data) {
this.fileRename = data.fileName;
this.preview = true;
this.fileId = data.id;
},
_cancel() {
this.preview = false;
},
_ok() {
this.preview = false;
let tempData = {
id: this.fileId,
remark: this.fileRename
};
this.$store.dispatch('samplingPlanAttachment/fileSetName', tempData).then(() => {
this._resultChange('修改成功');
});
},
/****************************************上传图片*************************************************/
_uploadImg() {
this.showPrompt = false;
plus.nativeUI.actionSheet({
title: "选择图片",
cancel: "取消",
buttons: [{title: "拍照"}, {title: "相册"}]
}, (e) => {
let index = e.index;
switch (index) {
case 1:
//拍照上传
this._camera();
break;
case 2:
//从相册选择上传
this._pickPhoto();
break
}
});
},
//拍照上传
_camera() {
plus.camera.getCamera().captureImage((e) => {
plus.io.resolveLocalFileSystemURL(e, (entry) => {
var url = entry.toLocalURL();
var name = url.substr(e.lastIndexOf('/') + 1);
//压缩
plus.zip.compressImage({
src: url,
dst: '_doc/' + name,
overwrite: true,
quality: 30,
}, (zip) => {
let files = [{key: 'imgUpload', path: zip.target}];
this._submitImg(files);
}, (error) => {
console.log('压缩失败', error)
});
}, (e) => {
console.log("读取拍照文件错误:" + e.message);
});
}, (s) => {
console.log("error" + s);
}, {});
},
//从相册选择上传
_pickPhoto() {
//多选
plus.gallery.pick((e) => {
let files = [];
let url = '';
let name = '';
for (let i in e.files) {
url = e.files[i];
name = url.substr(url.lastIndexOf('/') + 1);
//压缩取得缩略图
plus.zip.compressImage({
src: url,
dst: '_doc/' + name,
overwrite: true,
quality: 30,
}, (zip) => {
files = [{key: 'imgUpload' + i, path: zip.target}];
this._submitImg(files);
}, (error) => {
console.log('压缩失败',error)
});
}
}, (e) => {
console.log('打开相册失败', e)
}, {filter: 'image', multiple: true, system: false});
},
//上传
_submitImg(files) {
var task = plus.uploader.createUpload(this.action,
{method: "POST"},
(t, status) => { //上传完成
console.log(t, status)
this._search();
}
);
//单图片上传
let tempData = files[0];
task.addFile(tempData.path, {key: tempData.key});
task.setRequestHeader('accessToken', localStorage.getItem('accessToken'));
task.start();
},
/****************************************上传图片*************************************************/
}
}
</script>
<template>
<div>
<div style="margin:100px auto 10px auto;text-align: center">
<!--<img src="../../../../static/image/file-down.png" height="100">-->
<p style="margin:10px auto">{{name}}</p>
<p style="color:#aaa;"> {{ctime}}</p>
</div>
<div>
<!--<div class="edit-btn down-btn" @click="_webOk" style="margin-bottom: 15px" v-if="osName === 'web' ">下载</div>-->
<!--<div class="edit-btn down-btn" @click="_ok" style="margin-bottom: 15px">下载</div>-->
<div class="edit-btn down-btn" @click="_view" style="margin-bottom: 15px">预览</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
title: '下载附件',
name: '',
id: '',
ctime: '',
remark: ''
}
},
mounted() {
this._getQuery();
},
methods: {
_getQuery() {
this.name = this.$route.query.fileName;
this.remark = this.$route.query.remark;
this.id = this.$route.query.id;
this.ctime = this.$dateformat(parseInt(this.$route.query.ctime), 'yyyy/mm/dd');
// this.osName = localStorage.getItem('osName');
},
//移动
_ok() {
this.$vux.loading.show({
text: '下载中...',
width: '10em',
show: true
});
var dtask = plus.downloader.createDownload(
this.$global.baseURL + '/env/v1/env_contract_attachment/download/' + this.id,
{}, (d, status) => {
// 下载完成
if (status == 200) {
this.$vux.loading.hide();
this.$vux.toast.show({
type: 'text',
width: '15em',
text: '下载到' + d.filename,
time: 2000
});
this.$router.go(-1);
} else {
this.$vux.loading.hide();
this.$vux.toast.show({
type: 'warn',
width: '10em',
text: '下载失败',
});
}
});
dtask.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
dtask.setRequestHeader('accessToken', localStorage.getItem('accessToken'));
dtask.start();
},
//浏览器
// _webOk() {
// var request = new XMLHttpRequest();
// request.open("GET", this.$global.baseURL + '/env/v1/env_contract_attachment/download/' + this.id);
// request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// request.setRequestHeader("accessToken", localStorage.getItem('accessToken'));
// request.responseType = 'arraybuffer';
// request.onload = function (e) {
// var a = document.createElement("a");
// document.body.appendChild(a);
// a.style = "display: none";
// var blob = new Blob([this.response], {type: "octet/stream"}),
// url = window.URL.createObjectURL(blob);
// a.href = url;
// a.download = this.remark;
// a.click();
// window.URL.revokeObjectURL(url);
// };
// request.send();
// },
//预览文档
_view() {
// this.$store.dispatch('EnvContractAttachment/preview', this.id).then(() => {
// let result = this.$store.state.EnvContractAttachment.list;
// if (result !== undefined) {
// //使用内置Webview窗口打开URL
// plus.webview.open(this.$global.baseURL + '/print/v1/oos?key=' + result.objectKey, this.id, {
// 'popGesture': 'hide', //侧滑返回
// 'backButtonAutoControl': 'hide', //控制按键返回
// 'additionalHttpHeaders': {accessToken: localStorage.getItem('accessToken')}
// });
// }
// });
//调用第三放程序打开指定文件(必须是本地路径)
this.$vux.loading.show({
text: '加载中...',
width: '10em',
show: true
});
var dtask = plus.downloader.createDownload(
this.$global.baseURL + '/env/v1/env_contract_attachment/download/' + this.id, {}, (d, status) => {
if (status == 200) {
plus.runtime.openFile(d.filename);//cn.wps.moffice_eng-----wps的包名
}
this.$vux.loading.hide();
});
dtask.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
dtask.setRequestHeader('accessToken', localStorage.getItem('accessToken'));
dtask.start();
},
}
}
</script>
<template>
<div>
<div style="margin:100px auto 10px auto;text-align: center">
<div>
<Upload
multiple
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:data="dataObj"
:headers="headers"
:with-credentials="true"
:show-upload-list="false"
>
<img :src="url" height="100">
</Upload>
</div>
<p style="margin:10px auto">请选择附件上传</p>
</div>
</div>
</template>
<script>
import Global from '../../../api/config'
export default {
data() {
return {
title: '附件',
//合同id
contractId: '',
url: './static/image/file-add.png',
files: [],
action: '',
osName: '',
dataObj: {
file: '',
},
headers: '',
}
},
mounted() {
this._getQuery();
},
methods: {
_getQuery() {
this.contractId = this.$route.query.contractId;
this.action = Global.baseURL + '/env/v1/env_contract_attachment/' + this.contractId;
this.headers = {'accessToken': localStorage.getItem('accessToken')};
},
_resultChange(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
});
},
//web
_beupload(file) {
this.dataObj.file = file.name;
this.$vux.loading.show({
text: '上传中...',
width: '10em',
show: true
});
},
_handelsuccess(response) { //上传成功
this.$vux.loading.hide();
if (response.success) {
this._resultChange('上传成功');
this.$router.go(-1);
} else {
this._resultChange('上传失败');
}
},
}
}
</script>
......@@ -16,9 +16,9 @@
</div>
<template #right>
<van-button square type="info" text="打卡" class="swipe-cell-btn"
@click="_getWebLoc"></van-button>
@click="_getWebLoc(item.id)"></van-button>
<van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_delLoc(id)"></van-button>
@click="_delLoc(item.id)"></van-button>
</template>
</van-swipe-cell>
</van-list>
......
......@@ -38,7 +38,7 @@
</template>
<script>
import {samplingPlan, samplingPlace} from '../../../api'
import {samplingPlace} from '../../../api'
export default {
name: "SelectLocation",
......@@ -106,10 +106,9 @@
},
_addOk: async function () {
let data = {
planId: this.planId,
placeIds: this.checkListValue.join(',')
ids: this.checkListValue.join(',')
}
let result = await samplingPlan.savePlace(data)
let result = await samplingPlace.addMulti(data)
if (result) {
this.$toast('操作成功')
this.$emit('refresh')
......
......@@ -4,6 +4,9 @@ import SamplingListAddNet from '@/page/sampling-list/SamplingListAddNet.vue'
import SamplingListAdd from '@/page/sampling-list/SamplingListAdd.vue'
import SamplingListDetail from '@/page/sampling-list/SamplingListDetail.vue'
import SamplingListDetailNet from '@/page/sampling-list/SamplingListDetailNet.vue'
import File from '@/page/sampling-list/file/File.vue'
import FileUpload from '@/page/sampling-list/file/FileUpload.vue'
import FileDownLoad from '@/page/sampling-list/file/FileDownLoad.vue'
export default [
{path: 'sampling_task', component: SamplingTask, meta: {title: '抽样任务'}},
......@@ -12,4 +15,7 @@ export default [
{path: 'sampling_list_add_net', component: SamplingListAddNet, meta: {title: '抽样单添加-网络'}},
{path: 'sampling_list_detail', component: SamplingListDetail, meta: {title: '抽样单详情-非网络'}},
{path: 'sampling_list_detail_net', component: SamplingListDetailNet, meta: {title: '抽样单详情-网络'}},
{path: 'file', component: File, meta: {title: '附件'}},
{path: 'file_upload', component: FileUpload, meta: {title: '添加附件'}},
{path: 'file_download', component: FileDownLoad, meta: {title: '下载附件'}},
]
......@@ -193,10 +193,18 @@ html, body, #app, .main-content-con {
height: auto;
background: @background-color-white;
margin-top: 10px;
padding: 10px;
padding: 10px 0;
border-top: 1px solid @border-color;
border-bottom: 1px solid @border-color;
font-size: 12px;
display: flex;
flex-wrap: wrap;
> div {
width: 50%;
padding: 0 10px;
line-height: 24px;
}
}
.swipe-cell-btn {
......
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