|
@@ -37,6 +37,7 @@
|
|
|
</div>
|
|
|
<div class="operation" ref="operation">
|
|
|
<el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
|
|
|
+ <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleSet">设置</el-button>
|
|
|
<el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleGetSapCode">获取SAP编码</el-button>
|
|
|
<el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="form_delete">删除</el-button>
|
|
|
<el-button class="success" icon="el-icon-receiving" @click="handleFeedBank">饲料库</el-button>
|
|
@@ -82,10 +83,10 @@
|
|
|
<u-table-column label="序号" type="index" align="center" width="50" fixed="left"/>
|
|
|
<u-table-column label="饲料名称" min-width="80px" align="center" prop="fname" fixed="left"/>
|
|
|
<u-table-column label="饲料分类" min-width="80px" align="center" prop="fclass" fixed="left"/>
|
|
|
- <u-table-column label="物料类型" min-width="90px" align="center" prop="materialtyp" />
|
|
|
+ <u-table-column label="物料类型" min-width="90px" align="center" prop="sapMaterialtypeName" />
|
|
|
<!-- <u-table-column label="SAP货位" min-width="90px" align="center" prop="goods" /> -->
|
|
|
<u-table-column label="唯一编码" min-width="80px" align="center" prop="feedcode" />
|
|
|
- <!-- <u-table-column label="SAP编码" min-width="90px" align="center" prop="sapcode" /> -->
|
|
|
+ <!-- <u-table-column label="SAP编码" min-width="90px" align="center" prop="sapCode" /> -->
|
|
|
<u-table-column label="饲料来源" min-width="80px" align="center" prop="source" />
|
|
|
<u-table-column label="计划类型" min-width="80px" align="center" prop="printgroup" />
|
|
|
<u-table-column v-if="isInforvalue" label="小料秤" min-width="90px" align="center" prop="smtmrname" />
|
|
@@ -194,24 +195,25 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="物料类型:" prop="materialtype">
|
|
|
- <el-select v-model="create.temp.materialtype" filterable placeholder="物料类型" class="filter-item" style="width: 100%;">
|
|
|
- <el-option v-for="item in materialtypeList" :key="item.id" :label="item.mixname" :value="item.id" />
|
|
|
+ <el-form-item label="物料类型:" prop="sapMaterialtype">
|
|
|
+ <el-select v-model="create.temp.sapMaterialtype" filterable placeholder="物料类型" class="filter-item" style="width: 100%;">
|
|
|
+ <el-option v-for="item in materialtypeList" :key="item.id" :label="item.distName" :value="item.distCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="SAP货位:" prop="goods">
|
|
|
- <el-select v-model="create.temp.goods" filterable placeholder="SAP货位" class="filter-item" style="width: 100%;">
|
|
|
- <el-option v-for="item in sapGoodsList" :key="item.id" :label="item.mixname" :value="item.id" />
|
|
|
+ <el-form-item label="SAP货位:" prop="sapGoods">
|
|
|
+ <el-select v-model="create.temp.sapGoods" filterable placeholder="SAP货位" class="filter-item" style="width: 100%;">
|
|
|
+ <el-option v-for="item in sapGoodsList" :key="item.id" :label="item.distName" :value="item.distCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="SAP编码:" prop="sapcode">
|
|
|
- <el-select v-model="create.temp.sapcode" filterable placeholder="SAP编码" class="filter-item" style="width: 100%;">
|
|
|
+ <el-form-item label="SAP编码:" prop="sapCode">
|
|
|
+ <el-input ref="sapCode" v-model="create.temp.sapCode" class="filter-item" disabled placeholder="SAP编码" type="text" />
|
|
|
+ <!-- <el-select v-model="create.temp.sapcode" filterable placeholder="SAP编码" class="filter-item" style="width: 100%;">
|
|
|
<el-option v-for="item in sapCodeList" :key="item.id" :label="item.mixname" :value="item.id" />
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -281,7 +283,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="备用字段01:" prop="backup1">
|
|
|
- <el-input ref="backup1" v-model="create.temp.backup1" class="filter-item" placeholder="备用字段01" type="text" />
|
|
|
+ <el-input ref="backup1" v-model="create.temp.backup1" class="filter-item" placeholder="备用字段01" type="text" onkeyup="value=value.replace(/[^\x00-\xff]/g, '')" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
@@ -656,7 +658,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!-- 获取SAP编码 -->
|
|
|
+ <!-- 设置 -->
|
|
|
<el-dialog :fullscreen="dialogFull" :visible.sync="sapCode.dialogFormVisible" :close-on-click-modal="false" width="90%">
|
|
|
<template slot="title">
|
|
|
<div class="avue-crud__dialog__header">
|
|
@@ -710,12 +712,52 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 获取SAP编码 -->
|
|
|
+ <el-dialog :fullscreen="dialogFull" :visible.sync="sapCode2.dialogFormVisible" :close-on-click-modal="false" width="50%">
|
|
|
+ <template slot="title">
|
|
|
+ <div class="avue-crud__dialog__header">
|
|
|
+ <span class="el-dialog__title">
|
|
|
+ <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
|
|
|
+ {{ textMap[sapCode2.dialogStatus] }}
|
|
|
+ </span>
|
|
|
+ <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
|
|
|
+ <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
|
|
|
+ <svg-icon v-else icon-class="fullscreen" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="app-add">
|
|
|
+ <el-form ref="sapCode2" :rules="sapCode2.rules" :model="sapCode2.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="时间范围:" prop="inputDatetime">
|
|
|
+ <el-date-picker v-model="sapCode2.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="物料类型:" prop="sapMaterialtype">
|
|
|
+ <el-select v-model="sapCode2.temp.sapMaterialtype" filterable placeholder="物料类型" class="filter-item" style="width: 100%;">
|
|
|
+ <el-option v-for="item in materialtypeList" :key="item.id" :label="item.distName" :value="item.distCode" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button class="cancelClose" @click="sapCode2.dialogFormVisible = false;getList()">关闭</el-button>
|
|
|
+ <el-button v-if="sapCode2.dialogStatus==='sapCode2' && isRoleEdit" class="save" :disabled="isokDisable" @click="sapCodeData2()">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
|
|
|
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson } from '@/api/common'
|
|
|
import Cookies from 'js-cookie'
|
|
|
import Sortable from 'sortablejs'
|
|
|
import Pagination from '@/components/Pagination'
|
|
@@ -778,7 +820,9 @@ export default {
|
|
|
{ name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] },
|
|
|
{ name: 'getFeedclassByBig', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
|
|
|
{ name: 'getDictByName2', offset: 0, pagecount: 0, params: ['计划类型'] },
|
|
|
- { name: 'getTMRListEnableTypeFeed', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '4' }}
|
|
|
+ { name: 'getTMRListEnableTypeFeed', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '4' }},
|
|
|
+ { name: 'getDistMateriel', offset: 0, pagecount: 0, params: [] },
|
|
|
+ { name: 'getDistGoods', offset: 0, pagecount: 0, params: [] },
|
|
|
],
|
|
|
requestParams2: {
|
|
|
name: 'getSysoptEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), inforname: 'isSmallMaterial' }
|
|
@@ -828,7 +872,7 @@ export default {
|
|
|
create: {
|
|
|
dialogFormVisible: false,
|
|
|
dialogStatus: '',
|
|
|
- temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '',feedgroupid:'',materialtype:'',goods:'',sapcode:''},
|
|
|
+ temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '',feedgroupid:'',sapMaterialtype:'',sapGoods:'',sapCode:''},
|
|
|
rules: {
|
|
|
printgroupid :[{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
|
fname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
@@ -909,14 +953,29 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ sapCode2:{
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogStatus: '',
|
|
|
+ materialtypeList:[],
|
|
|
+ temp:{
|
|
|
+ inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
|
|
|
+ sapMaterialtype:'',
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ inputDatetime :[{required: true, message: '必填', trigger: 'blur' }],
|
|
|
+ sapMaterialtype: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
textMap: {
|
|
|
create: '新增',
|
|
|
update: '编辑',
|
|
|
feedBank: '饲料库',
|
|
|
relation: '关联',
|
|
|
nutritive: '营养价值',
|
|
|
- sapCode: '获取SAP编码'
|
|
|
+ sapCode: '设置',
|
|
|
+ sapCode2: '获取SAP编码',
|
|
|
},
|
|
|
|
|
|
isokDisable: false,
|
|
@@ -1146,6 +1205,8 @@ export default {
|
|
|
this.feedTypeList = response.data.getFeedclassByBig.list
|
|
|
this.planTypeList = response.data.getDictByName2.list
|
|
|
this.smallMaterialList = response.data.getTMRListEnableTypeFeed.list
|
|
|
+ this.materialtypeList = response.data.getDistMateriel .list
|
|
|
+ this.sapGoodsList = response.data.getDistGoods.list
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -1280,21 +1341,37 @@ export default {
|
|
|
if (this.create.temp.uprice == '') { this.create.temp.uprice = '0' }
|
|
|
if (this.create.temp.unitweight == '') { this.create.temp.unitweight = '0' }
|
|
|
if (this.create.temp.autozone == '') { this.create.temp.autozone = '0' }
|
|
|
- if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
|
|
|
- PostDataByName(this.requestParam).then(response => {
|
|
|
- console.log('新增保存发送参数', this.requestParam)
|
|
|
- if (response.msg !== 'fail') {
|
|
|
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
- this.create.dialogFormVisible = false
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
- if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
- if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
- if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
- if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
- }
|
|
|
+ if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
|
|
|
+ let url = 'authdata/feedbackup/check'
|
|
|
+ let data = {
|
|
|
+ fclassid:this.create.temp.fclassid,
|
|
|
+ backup1:this.create.temp.backup1
|
|
|
+ }
|
|
|
+ postJson(url,data).then(response => {
|
|
|
+ if(response.msg == 'fail'){
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
+ if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
+ if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
+ if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
+ if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
+ }else{
|
|
|
+ PostDataByName(this.requestParam).then(response => {
|
|
|
+ console.log('新增保存发送参数', this.requestParam)
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ this.create.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
+ if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
+ if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
+ if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
+ if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -1380,21 +1457,37 @@ export default {
|
|
|
if (this.create.temp.unitweight == '') { this.create.temp.unitweight = '0' }
|
|
|
if (this.create.temp.autozone == '') { this.create.temp.autozone = '0' }
|
|
|
if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
|
|
|
-
|
|
|
- PostDataByName(this.requestParam).then(response => {
|
|
|
- console.log('新增保存发送参数', this.requestParam)
|
|
|
- if (response.msg !== 'fail') {
|
|
|
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
- this.create.dialogFormVisible = false
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
- if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
- if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
- if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
- if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
- }
|
|
|
+ let url = 'authdata/feedbackup/check'
|
|
|
+ let data = {
|
|
|
+ fclassid:this.create.temp.fclassid,
|
|
|
+ feedId:this.create.temp.id,
|
|
|
+ backup1:this.create.temp.backup1
|
|
|
+ }
|
|
|
+ postJson(url,data).then(response => {
|
|
|
+ if(response.msg == 'fail'){
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
+ if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
+ if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
+ if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
+ if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
+ }else{
|
|
|
+ PostDataByName(this.requestParam).then(response => {
|
|
|
+ console.log('新增保存发送参数', this.requestParam)
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ this.create.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
+ if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
+ if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
+ if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
+ if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -1812,18 +1905,18 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- handleGetSapCode(){
|
|
|
+ handleSet(){
|
|
|
if (this.selectList.length == 0) {
|
|
|
this.$message({ type: 'error', message: '请选择一条信息', duration: 2000 })
|
|
|
} else {
|
|
|
this.dialogFull = false
|
|
|
this.sapCode.dialogStatus = 'sapCode'
|
|
|
this.sapCode.dialogFormVisible = true
|
|
|
- this.sapCode.table.getdataListParm.parammaps.MAKTX = this.selectList[0].sapcode
|
|
|
this.getsapCodeList()
|
|
|
}
|
|
|
},
|
|
|
- getsapCodeList(){
|
|
|
+ getsapCodeList(){
|
|
|
+ this.sapCode.table.getdataListParm.parammaps.MAKTX = this.selectList[0].sapCode
|
|
|
GetDataByName(this.sapCode.table.getdataListParm).then(response => {
|
|
|
if (response.data.list !== null) {
|
|
|
this.sapCode.table.list = response.data.list
|
|
@@ -1833,13 +1926,68 @@ export default {
|
|
|
this.$refs.saptable.reloadData(this.sapCode.table.list)
|
|
|
})
|
|
|
},
|
|
|
- handleSapCodeSearch(){},
|
|
|
+ handleSapCodeSearch(){
|
|
|
+ this.getsapCodeList()
|
|
|
+ },
|
|
|
sapCodeData(){
|
|
|
-
|
|
|
+ if(this.sapCode.selectList.length>1 || this.sapCode.selectList.length == 0){
|
|
|
+ this.$message({ type: 'error', message: '请选择一条信息', duration: 2000 })
|
|
|
+ }else{
|
|
|
+ this.requestParam.name = 'updateFeedSapCode'
|
|
|
+ let data = {
|
|
|
+ name:'updateFeedSapCode',
|
|
|
+ parammaps:{
|
|
|
+ sapCode:this.sapCode.selectList[0].MATNR,
|
|
|
+ id:this.selectList[0].id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PostDataByName(data).then(response => {
|
|
|
+ console.log('新增保存发送参数', data)
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ this.sapCode.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
|
|
|
+ if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
|
|
|
+ if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
|
|
|
+ if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
|
|
|
+ if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
handleSapCodeSelectionChange(val){
|
|
|
this.sapCode.selectList = val
|
|
|
console.log(this.sapCode.selectList,'this.sapCode.selectList')
|
|
|
+ },
|
|
|
+ handleGetSapCode(){
|
|
|
+ this.dialogFull = false
|
|
|
+ this.sapCode2.dialogStatus = 'sapCode2'
|
|
|
+ this.sapCode2.dialogFormVisible = true
|
|
|
+ },
|
|
|
+ sapCodeData2(){
|
|
|
+ this.$refs['sapCode2'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let url = 'authdata/sap/feed'
|
|
|
+ let data = {
|
|
|
+ startTime:parseTime(this.sapCode2.temp.inputDatetime[0],'{y}-{m}-{d}'),
|
|
|
+ endTime:parseTime(this.sapCode2.temp.inputDatetime[1],'{y}-{m}-{d}'),
|
|
|
+ mtart:this.sapCode2.temp.sapMaterialtype,
|
|
|
+ pastureId:Cookies.get('pastureid')
|
|
|
+ }
|
|
|
+ postJson(url,data).then(response => {
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ this.sapCode2.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|