|
@@ -167,9 +167,9 @@
|
|
|
<el-form ref="temp" :rules="create2.rules" :model="create2.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
|
|
|
|
|
|
<el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="允许误差时间(分钟):" prop="time">
|
|
|
- <el-input ref="time" v-model="create2.temp.time" class="filter-item" placeholder="请输入" type="text" />
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="允许误差时间(分钟):" prop="allowableerror">
|
|
|
+ <el-input ref="time" v-model="create2.temp.allowableerror" class="filter-item" placeholder="请输入" type="text" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -180,7 +180,7 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button class="cancelClose" @click="create2.dialogFormVisible = false;getList()">关闭</el-button>
|
|
|
- <el-button class="save" @click="handleCreate2">确认</el-button>
|
|
|
+ <el-button class="save" @click="create_sure2">确认</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -189,9 +189,14 @@
|
|
|
<!-- 校验 -->
|
|
|
<el-dialog title="提示" :destroy-on-close="true" :visible.sync="check.dialogFormVisible" :close-on-click-modal="false" width="30%">
|
|
|
<div class="check">
|
|
|
- <p v-if="check.temp.isDistribution == '0'">当前有栏舍未分配,建议及时进行分配,未分配栏舍如下:</p>
|
|
|
- <p v-else>已分配完:当前栏舍已分配完善</p>
|
|
|
- {{ check.temp.bnames }}
|
|
|
+ <p v-if="check.temp.isDistribution1 == '0'">未启用分配如下:</p>
|
|
|
+ <p v-else>当前栏舍已分配完</p>
|
|
|
+ {{ check.temp.banme1 }}
|
|
|
+
|
|
|
+
|
|
|
+ <p v-if="check.temp.isDistribution2 == '0'">未启用栏舍如下:</p>
|
|
|
+ <p v-else>当前栏舍已全部启用</p>
|
|
|
+ {{ check.temp.banme2 }}
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer" style="bottom: 10px;">
|
|
|
<el-button class="save" @click="check.dialogFormVisible=false;">确认</el-button>
|
|
@@ -204,7 +209,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { GetDataByName, postJson, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons } from '@/api/common'
|
|
|
+import { GetDataByName, postJson, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons, checkDates } from '@/api/common'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
import Pagination2 from '@/components/Pagination2'
|
|
|
import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
|
|
@@ -261,7 +266,7 @@ export default {
|
|
|
create2: {
|
|
|
dialogFormVisible: false,
|
|
|
dialogStatus: '',
|
|
|
- temp: { pastureid: Cookies.get('pastureid'), time: ''},
|
|
|
+ temp: { pastureid: Cookies.get('pastureid'), allowableerror: ''},
|
|
|
rules: {
|
|
|
// fname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
|
// fclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
@@ -284,7 +289,8 @@ export default {
|
|
|
},
|
|
|
temp: {
|
|
|
bnames: '',
|
|
|
- isDistribution: ''
|
|
|
+ isDistribution1: '',
|
|
|
+ isDistribution2: ''
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -393,6 +399,8 @@ export default {
|
|
|
response.data.list.forEach(function(item){
|
|
|
if(item.times !== ""){
|
|
|
item.timesArr = item.times.split(',')
|
|
|
+ }else{
|
|
|
+ item.timesArr = []
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -430,29 +438,125 @@ export default {
|
|
|
// 新增
|
|
|
handleCreate1() {
|
|
|
console.log('点击了新增')
|
|
|
- this.resetTemp1()
|
|
|
- this.dialogFull = false
|
|
|
- this.create1.dialogStatus = 'create'
|
|
|
- this.create1.dialogFormVisible = true
|
|
|
+
|
|
|
+ if (this.selectList.length == 0) {
|
|
|
+ this.$message({ type: 'error', message: '请选择推料信息', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ this.resetTemp1()
|
|
|
+ this.dialogFull = false
|
|
|
+ this.create1.dialogStatus = 'create'
|
|
|
+ this.create1.dialogFormVisible = true
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
resetTemp1() {
|
|
|
- this.create1.temp = { pastureid: Cookies.get('pastureid'), 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': "", 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', barid: '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' }
|
|
|
+ this.timetags1 = []
|
|
|
},
|
|
|
|
|
|
|
|
|
create_sure1(){
|
|
|
- console.log(this.timetags1)
|
|
|
+ console.log('timetags1-----',this.timetags1)
|
|
|
+ console.log('selectList-----',this.selectList)
|
|
|
+
|
|
|
+ var timeArrRea = this.timetags1
|
|
|
+
|
|
|
+ var selectArr = this.selectList
|
|
|
+ var idsArr = []
|
|
|
+ selectArr.forEach(function(item){
|
|
|
+ idsArr.push(item.id)
|
|
|
+ })
|
|
|
+
|
|
|
+ var timeIdArr = []
|
|
|
+
|
|
|
+
|
|
|
+ idsArr.forEach(function(item){
|
|
|
+ timeArrRea.forEach(function(items){
|
|
|
+ timeIdArr.push({"time":items,"id":item})
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ console.log("timeIdArr",timeIdArr)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var send_data2 = {
|
|
|
+ "common":{"returnmap":"0"},
|
|
|
+ "data":[
|
|
|
+ {
|
|
|
+ "name":"delPushingDetailByIds",
|
|
|
+ "type":"e",
|
|
|
+ "parammaps":{"ids":idsArr.join(",")}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name":"insertPushingDetail",
|
|
|
+ "resultmaps":{
|
|
|
+ "list":timeIdArr
|
|
|
+ },
|
|
|
+ "children":[{"name":"insertPushingDetailByPushingId","type":"e","parammaps":
|
|
|
+ {"pastureid":Cookies.get('pastureid'),"id":"@insertPushingDetail.id","time":"@insertPushingDetail.time","type":0}}]}
|
|
|
+ ]}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ExecDataByConfig(send_data2).then(response => {
|
|
|
+ console.log('设置推料', send_data2)
|
|
|
+ console.log('设置推料', response)
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '设置失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.$notify({ title: '设置成功', message: '设置成功', type: 'success', duration: 2000 })
|
|
|
+ this.create1.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
handleCreate2() {
|
|
|
- console.log('点击了新增')
|
|
|
- this.resetTemp2()
|
|
|
- this.dialogFull = false
|
|
|
- this.create2.dialogStatus = 'create'
|
|
|
- this.create2.dialogFormVisible = true
|
|
|
+
|
|
|
+
|
|
|
+ if (this.selectList.length == 0) {
|
|
|
+ this.$message({ type: 'error', message: '请选择推料信息', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ console.log('点击了新增')
|
|
|
+ this.resetTemp2()
|
|
|
+ this.dialogFull = false
|
|
|
+ this.create2.dialogStatus = 'create'
|
|
|
+ this.create2.dialogFormVisible = true
|
|
|
+ }
|
|
|
},
|
|
|
resetTemp2() {
|
|
|
- this.create2.temp = { pastureid: Cookies.get('pastureid'), 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': "", 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', barid: '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' }
|
|
|
+ this.create2.temp = { pastureid: Cookies.get('pastureid'), 'allowableerror': '' }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ create_sure2(){
|
|
|
+ console.log(this.selectList)
|
|
|
+ var allowableerror = this.create2.temp.allowableerror
|
|
|
+
|
|
|
+ var selectArr = this.selectList
|
|
|
+ var idsArr = []
|
|
|
+ selectArr.forEach(function(item){
|
|
|
+ idsArr.push(item.id)
|
|
|
+ })
|
|
|
+
|
|
|
+ var send_data = {"name":"updateAllowableerrorByIds","parammaps":{"allowableerror":allowableerror,"ids":idsArr.join(",")}}
|
|
|
+
|
|
|
+ PostDataByName(send_data).then(response => {
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '设置失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.$notify({ title: '设置成功', message: '设置成功', type: 'success', duration: 2000 })
|
|
|
+ this.create2.dialogFormVisible = false
|
|
|
+ this.getList()
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
|
|
@@ -506,13 +610,22 @@ export default {
|
|
|
this.getCheckList()
|
|
|
},
|
|
|
getCheckList() {
|
|
|
- GetDataByName(this.check.getCheckParm).then(response => {
|
|
|
- if (response.data.list[0].bnames !== undefined) {
|
|
|
- this.check.temp.isDistribution = 0
|
|
|
- this.check.temp.bnames = response.data.list[0].bnames
|
|
|
+ var check_data = {"name":"checkPushingBar","offset":0,"pagecount":0,"parammaps":{"pastureid":Cookies.get('pastureid')}}
|
|
|
+
|
|
|
+ GetDataByName(check_data).then(response => {
|
|
|
+ console.log(response)
|
|
|
+ if (response.data.list[0].banme1 !== undefined) {
|
|
|
+ this.check.temp.isDistribution1 = 0
|
|
|
+ this.check.temp.banme1 = response.data.list[0].banme1
|
|
|
} else {
|
|
|
- this.check.temp = {}
|
|
|
- this.check.temp.isDistribution = 1
|
|
|
+ this.check.temp.isDistribution1 = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ if (response.data.list[0].banme2 !== undefined) {
|
|
|
+ this.check.temp.isDistribution2 = 0
|
|
|
+ this.check.temp.banme2 = response.data.list[0].banme2
|
|
|
+ } else {
|
|
|
+ this.check.temp.isDistribution2 = 1
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -657,10 +770,10 @@ export default {
|
|
|
row.pastureid = Cookies.get('pastureid')
|
|
|
|
|
|
|
|
|
- // if (this.table.temp.ccount === '') {
|
|
|
- // this.$message({ type: 'error', message: '实际牛头数不能为空', duration: 2000 })
|
|
|
- // return false
|
|
|
- // }
|
|
|
+ if (row.tmrname === '') {
|
|
|
+ this.$message({ type: 'error', message: '推料车名称不能为空', duration: 2000 })
|
|
|
+ return false
|
|
|
+ }
|
|
|
|
|
|
// const positiveInteger = /^[0-9]\d*$/
|
|
|
// if (!positiveInteger.test(parseFloat(this.table.temp.ccount))) {
|
|
@@ -690,7 +803,7 @@ export default {
|
|
|
"name":"checkPushing","resultmaps":{"list":timesTempArr},
|
|
|
"children":[
|
|
|
{
|
|
|
- "name":"checkPushing","type":"e",
|
|
|
+ "name":"checkPushing","type":"v",
|
|
|
"parammaps": {
|
|
|
"tmrname":row.tmrname,
|
|
|
"tmrid":row.tmrid,
|
|
@@ -704,31 +817,18 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
|
|
|
- PostDataByName(send_data).then(response => {
|
|
|
- console.log(response)
|
|
|
- if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- } else {
|
|
|
- this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
- if(id == 0){
|
|
|
- var send_data = {
|
|
|
+ if(row.id == 0){
|
|
|
+ var send_data2 = {
|
|
|
"common":{"returnmap":"0"},
|
|
|
"data":[
|
|
|
{"name":"insertPushing","type":"e",
|
|
|
"parammaps": row
|
|
|
- },
|
|
|
+ },
|
|
|
{"name":"insertPushingDetail",
|
|
|
"resultmaps":{
|
|
|
- "list":[
|
|
|
- {"time":"10:00"},{"time":"12:00"}
|
|
|
- ]
|
|
|
+ "list":timesTempArr
|
|
|
},
|
|
|
"children":[
|
|
|
{
|
|
@@ -739,33 +839,51 @@ export default {
|
|
|
]}
|
|
|
}else {
|
|
|
|
|
|
+ var send_data2 = {
|
|
|
+ "common":{"returnmap":"0"},
|
|
|
+ "data":[
|
|
|
+ {"name":"updatePushing","type":"e",
|
|
|
+ "parammaps":row
|
|
|
+ },
|
|
|
+ {"name": "delPushingDetail","type": "e",
|
|
|
+ "parammaps": {"id": row.id }
|
|
|
+ },
|
|
|
+ {"name":"insertPushingDetail",
|
|
|
+ "resultmaps":{"list":timesTempArr},
|
|
|
+ "children":[
|
|
|
+ {"name":"insertPushingDetail","type":"e",
|
|
|
+ "parammaps":
|
|
|
+ {"pastureid":Cookies.get('pastureid'),
|
|
|
+ "barid":row.barid,"time":"@insertPushingDetail.time","type":0}}]}
|
|
|
+ ]}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ checkDates(send_data).then(response => {
|
|
|
+ console.log(response)
|
|
|
+ if (response.data === ture) {
|
|
|
+ ExecDataByConfig(send_data2).then(response => {
|
|
|
+ console.log('编辑保存发送参数', send_data2)
|
|
|
+ console.log('编辑保存', response)
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+
|
|
|
+ this.getList()
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
- // ExecDataByConfig(this.requestParam).then(response => {
|
|
|
- // console.log('编辑保存发送参数', this.requestParam)
|
|
|
- // if (response.msg === 'fail') {
|
|
|
- // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- // } else {
|
|
|
- // if(obj.data.length>0){
|
|
|
- // const url = 'authdata/fpdetail/edit'
|
|
|
- // const data = obj
|
|
|
- // postJson(url, data).then(response => {
|
|
|
- // if(response.msg !== 'fail'){
|
|
|
- // this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }else{
|
|
|
- // this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
- // }
|
|
|
- // this.getList()
|
|
|
- // for (let i = 0; i < this.headerList.length; i++) {
|
|
|
- // if (this.headerList[i].target.className == 'el-icon-lock') {
|
|
|
- // this.headerList[i].target.className = 'el-icon-unlock'
|
|
|
- // this.$set(this.headerList[i].target, 'className', 'el-icon-unlock')
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
+
|
|
|
},
|
|
|
updateCancel(row) {
|
|
|
console.log('点击了编辑取消')
|
|
@@ -885,6 +1003,7 @@ export default {
|
|
|
.table {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+ .el-tag{margin-right: 5px;}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.red-row{
|