|
@@ -107,7 +107,7 @@
|
|
<el-button v-if="isDieselModify" type="success" size="mini" @click="handleDieselUpdate(row)">编辑</el-button>
|
|
<el-button v-if="isDieselModify" type="success" size="mini" @click="handleDieselUpdate(row)">编辑</el-button>
|
|
<!-- <el-button type="primary" size="mini" style="width:70px" @click="handleDosageRecord(row)">用量记录</el-button> -->
|
|
<!-- <el-button type="primary" size="mini" style="width:70px" @click="handleDosageRecord(row)">用量记录</el-button> -->
|
|
<!-- <el-button v-if="isDieselUpdate" type="success" size="mini" @click="handleDieselUpdate(row)">修改</el-button> -->
|
|
<!-- <el-button v-if="isDieselUpdate" type="success" size="mini" @click="handleDieselUpdate(row)">修改</el-button> -->
|
|
- <!-- <el-button v-if="isDieselDel" type="danger" size="mini" @click="handleDieselDel(row)">删除</el-button> -->
|
|
|
|
|
|
+ <el-button v-if="isDieselDel" type="danger" size="mini" @click="handleDieselDel(row)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -317,7 +317,7 @@
|
|
<script>
|
|
<script>
|
|
// 引入
|
|
// 引入
|
|
require('script-loader!file-saver')
|
|
require('script-loader!file-saver')
|
|
-import { GetDataByName, GetDataByNames, PostDataByName, checkButtons, ExecDataByConfig, failproccess, GetAccount,getJson } from '@/api/common'
|
|
|
|
|
|
+import { GetDataByName, GetDataByNames, PostDataByName,postJson, checkButtons, ExecDataByConfig, failproccess, GetAccount,getJson } from '@/api/common'
|
|
// import { DownloadExcel, GetDataByNameXlsx } from '@/api/common'
|
|
// import { DownloadExcel, GetDataByNameXlsx } from '@/api/common'
|
|
import waves from '@/directive/waves'
|
|
import waves from '@/directive/waves'
|
|
import { parseTime, sortChange } from '@/utils/index.js'
|
|
import { parseTime, sortChange } from '@/utils/index.js'
|
|
@@ -364,7 +364,8 @@ export default {
|
|
parammaps: {
|
|
parammaps: {
|
|
selTime: '',
|
|
selTime: '',
|
|
pastureName: Cookies.get('pasturename'),
|
|
pastureName: Cookies.get('pasturename'),
|
|
- departName: ''
|
|
|
|
|
|
+ departName: '',
|
|
|
|
+ inputDatetime:''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 2-3:下拉框请求后数据加入[]
|
|
// 2-3:下拉框请求后数据加入[]
|
|
@@ -482,14 +483,15 @@ export default {
|
|
uploadData() {
|
|
uploadData() {
|
|
return {
|
|
return {
|
|
name: 'importDiesel',
|
|
name: 'importDiesel',
|
|
- importParams: '牧场,油卡编号,设备名称,设备编号,加油日期,加油量(升),单价,录入人,加油人,加油工班,备注',
|
|
|
|
- sheetname: 'SheetJS'
|
|
|
|
|
|
+ importParams: '牧场,油卡编号,设备名称,设备编号,加油日期,加油量(升),单价,录入人,加油人,加油工班,备注,柴油类型',
|
|
|
|
+ sheetname: 'SheetJS',
|
|
|
|
+ pastureId:Cookies.get('pastureid')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 设置上传地址
|
|
// 设置上传地址
|
|
uploadExcelUrl() {
|
|
uploadExcelUrl() {
|
|
// process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
|
|
// process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
|
|
- return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
|
|
|
|
|
|
+ return process.env.VUE_APP_BASE_API + 'authdata/diese/import/excel'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -717,10 +719,10 @@ export default {
|
|
const list1 = response.data.list
|
|
const list1 = response.data.list
|
|
console.log(list1,'list1')
|
|
console.log(list1,'list1')
|
|
const tHeader = [
|
|
const tHeader = [
|
|
- '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注'
|
|
|
|
|
|
+ '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注','柴油类型'
|
|
]
|
|
]
|
|
const filterVal = [
|
|
const filterVal = [
|
|
- 'i', 'pastureName', 'cardNumber', 'assetName', 'assetNumber', 'day', '加油量(L)', '单价', 'name', '加油人', '加油工班', '备注'
|
|
|
|
|
|
+ 'i', 'pastureName', 'cardNumber', 'assetName', 'assetNumber', 'day', '加油量(L)', '单价', 'name', '加油人', '加油工班', '备注','柴油类型'
|
|
]
|
|
]
|
|
const data1 = this.formatJson(filterVal, list1)
|
|
const data1 = this.formatJson(filterVal, list1)
|
|
excel.export_json_to_excel({
|
|
excel.export_json_to_excel({
|
|
@@ -766,14 +768,14 @@ export default {
|
|
if (res.msg === 'ok') {
|
|
if (res.msg === 'ok') {
|
|
this.$message({
|
|
this.$message({
|
|
title: '成功',
|
|
title: '成功',
|
|
- message: '导入成功:' + res.data.success + '条!',
|
|
|
|
|
|
+ message: '导入成功',
|
|
type: 'success',
|
|
type: 'success',
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
if (res.data.err_count > 0) {
|
|
if (res.data.err_count > 0) {
|
|
this.$notify({
|
|
this.$notify({
|
|
title: '失败',
|
|
title: '失败',
|
|
- message: '导入失败:' + res.data.err_count + '条!',
|
|
|
|
|
|
+ message: '导入失败',
|
|
type: 'danger',
|
|
type: 'danger',
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
@@ -781,10 +783,10 @@ export default {
|
|
import('@/vendor/Export2Excel').then(excel => {
|
|
import('@/vendor/Export2Excel').then(excel => {
|
|
const list1 = res.data.result
|
|
const list1 = res.data.result
|
|
const tHeader = [
|
|
const tHeader = [
|
|
- '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '备注', '错误信息'
|
|
|
|
|
|
+ '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班','柴油类型', '备注', '错误信息'
|
|
]
|
|
]
|
|
const filterVal = [
|
|
const filterVal = [
|
|
- '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '备注', 'error_msg'
|
|
|
|
|
|
+ '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班','柴油类型', '备注', 'error_msg'
|
|
]
|
|
]
|
|
const data1 = this.formatJson(filterVal, list1)
|
|
const data1 = this.formatJson(filterVal, list1)
|
|
excel.export_json_to_excel({
|
|
excel.export_json_to_excel({
|
|
@@ -891,6 +893,7 @@ export default {
|
|
this.dialogFormVisible = true
|
|
this.dialogFormVisible = true
|
|
this.temp.empId = ''
|
|
this.temp.empId = ''
|
|
this.temp.departmentId = ''
|
|
this.temp.departmentId = ''
|
|
|
|
+ this.temp.oilType = ''
|
|
this.temp.pastureId = this.$store.state.user.pastureid
|
|
this.temp.pastureId = this.$store.state.user.pastureid
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs['temp'].clearValidate()
|
|
this.$refs['temp'].clearValidate()
|
|
@@ -907,34 +910,32 @@ export default {
|
|
var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
|
|
var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
|
|
}
|
|
}
|
|
this.$set(this.temp,'oilName',oilName)
|
|
this.$set(this.temp,'oilName',oilName)
|
|
- this.postDataPramas.common = { 'returnmap': '0' }
|
|
|
|
- this.postDataPramas.data = []
|
|
|
|
- this.postDataPramas.data[0] = { 'name': 'insertDiesel', 'type': 'e', 'parammaps': {
|
|
|
|
- 'pastureId': this.temp.pastureId,
|
|
|
|
- 'selTime': this.temp.selTime,
|
|
|
|
- 'oilClass': this.temp.oilClass,
|
|
|
|
- 'oilAmount': this.temp.oilAmount,
|
|
|
|
- 'eqId': this.temp.eqId,
|
|
|
|
- 'eqCode': this.temp.eqCode,
|
|
|
|
- 'departmentId': this.temp.departmentId,
|
|
|
|
- 'note': this.temp.note,
|
|
|
|
- 'nowPrice': this.temp.price * this.temp.oilAmount,
|
|
|
|
- 'oilcardId': this.temp.oilcardId,
|
|
|
|
- 'cardNumber': this.temp.cardNumber,
|
|
|
|
- 'price': this.temp.price,
|
|
|
|
- 'empId': this.temp.empId,
|
|
|
|
- 'inputId': this.temp.inputId,
|
|
|
|
- 'oilType':this.temp.oilType,
|
|
|
|
- 'oilName':this.temp.oilName,
|
|
|
|
- }}
|
|
|
|
- this.postDataPramas.data[1] = { 'name': 'updateOilCardExecData', 'type': 'e',
|
|
|
|
- 'parammaps': {
|
|
|
|
- 'id': this.temp.oilcardId,
|
|
|
|
- 'nowPrice': this.temp.price * this.temp.oilAmount
|
|
|
|
-
|
|
|
|
- }}
|
|
|
|
-
|
|
|
|
- ExecDataByConfig(this.postDataPramas).then(response => {
|
|
|
|
|
|
+ if(this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined){
|
|
|
|
+ this.temp.eqId = 0
|
|
|
|
+ }else{
|
|
|
|
+ this.temp.eqId = parseFloat(this.temp.eqId)
|
|
|
|
+ }
|
|
|
|
+ let url = 'authdata/diese/add'
|
|
|
|
+ let data = {
|
|
|
|
+ pastureId:this.temp.pastureId,
|
|
|
|
+ selTime: this.temp.selTime,
|
|
|
|
+ oilClass:this.temp.oilClass,
|
|
|
|
+ oilAmount: this.temp.oilAmount,
|
|
|
|
+ eqId: this.temp.eqId,
|
|
|
|
+ eqCode: this.temp.eqCode,
|
|
|
|
+ departmentId: this.temp.departmentId,
|
|
|
|
+ note: this.temp.note,
|
|
|
|
+ nowPrice: this.temp.price * this.temp.oilAmount,
|
|
|
|
+ oilcardId: this.temp.oilcardId,
|
|
|
|
+ cardNumber: this.temp.cardNumber,
|
|
|
|
+ price: this.temp.price,
|
|
|
|
+ empId: this.temp.empId,
|
|
|
|
+ inputId: this.temp.inputId,
|
|
|
|
+ oilType:this.temp.oilType,
|
|
|
|
+ oilName:this.temp.oilName,
|
|
|
|
+ }
|
|
|
|
+ postJson(url,data).then(response => {
|
|
|
|
+ // ExecDataByConfig(this.postDataPramas).then(response => {
|
|
if (response.msg === 'fail') {
|
|
if (response.msg === 'fail') {
|
|
this.$notify({
|
|
this.$notify({
|
|
title: '保存失败',
|
|
title: '保存失败',
|
|
@@ -969,35 +970,31 @@ export default {
|
|
var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
|
|
var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
|
|
}
|
|
}
|
|
this.$set(this.temp,'oilName',oilName)
|
|
this.$set(this.temp,'oilName',oilName)
|
|
- this.postDataPramas.common = { 'returnmap': '0' }
|
|
|
|
- this.postDataPramas.data = []
|
|
|
|
- this.postDataPramas.data[0] = { 'name': 'insertDiesel', 'type': 'e', 'parammaps': {
|
|
|
|
-
|
|
|
|
- 'pastureId': this.temp.pastureId,
|
|
|
|
- 'selTime': this.temp.selTime,
|
|
|
|
- 'oilClass': this.temp.oilClass,
|
|
|
|
- 'oilAmount': this.temp.oilAmount,
|
|
|
|
- 'eqId': this.temp.eqId,
|
|
|
|
- 'eqCode': this.temp.eqCode,
|
|
|
|
- 'departmentId': this.temp.departmentId,
|
|
|
|
- 'note': this.temp.note,
|
|
|
|
- 'nowPrice': this.temp.price * this.temp.oilAmount,
|
|
|
|
- 'oilcardId': this.temp.oilcardId,
|
|
|
|
- 'cardNumber': this.temp.cardNumber,
|
|
|
|
- 'price': this.temp.price,
|
|
|
|
- 'empId': this.temp.empId,
|
|
|
|
- 'inputId': this.temp.inputId,
|
|
|
|
- 'oilType':this.temp.oilType,
|
|
|
|
- 'oilName':this.temp.oilName,
|
|
|
|
- }}
|
|
|
|
-
|
|
|
|
- this.postDataPramas.data[1] = { 'name': 'updateOilCardExecData', 'type': 'e',
|
|
|
|
- 'parammaps': {
|
|
|
|
- 'id': this.temp.oilcardId,
|
|
|
|
- 'nowPrice': this.temp.price * this.temp.oilAmount
|
|
|
|
- }}
|
|
|
|
-
|
|
|
|
- ExecDataByConfig(this.postDataPramas).then(response => {
|
|
|
|
|
|
+ if(this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined){
|
|
|
|
+ this.temp.eqId = 0
|
|
|
|
+ }else{
|
|
|
|
+ this.temp.eqId = parseFloat(this.temp.eqId)
|
|
|
|
+ }
|
|
|
|
+ let url = 'authdata/diese/add'
|
|
|
|
+ let data = {
|
|
|
|
+ pastureId:this.temp.pastureId,
|
|
|
|
+ selTime: this.temp.selTime,
|
|
|
|
+ oilClass:this.temp.oilClass,
|
|
|
|
+ oilAmount: this.temp.oilAmount,
|
|
|
|
+ eqId: this.temp.eqId,
|
|
|
|
+ eqCode: this.temp.eqCode,
|
|
|
|
+ departmentId: this.temp.departmentId,
|
|
|
|
+ note: this.temp.note,
|
|
|
|
+ nowPrice: this.temp.price * this.temp.oilAmount,
|
|
|
|
+ oilcardId: this.temp.oilcardId,
|
|
|
|
+ cardNumber: this.temp.cardNumber,
|
|
|
|
+ price: this.temp.price,
|
|
|
|
+ empId: this.temp.empId,
|
|
|
|
+ inputId: this.temp.inputId,
|
|
|
|
+ oilType:this.temp.oilType,
|
|
|
|
+ oilName:this.temp.oilName,
|
|
|
|
+ }
|
|
|
|
+ postJson(url,data).then(response => {
|
|
if (response.msg !== 'fail') {
|
|
if (response.msg !== 'fail') {
|
|
this.form_reset()
|
|
this.form_reset()
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -1010,7 +1007,12 @@ export default {
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- failproccess(response, this.$notify)
|
|
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: '保存失败',
|
|
|
|
+ message: response.data,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1095,7 +1097,11 @@ export default {
|
|
this.requestParam.name = 'deleteDiesel'
|
|
this.requestParam.name = 'deleteDiesel'
|
|
this.requestParam.parammaps = {}
|
|
this.requestParam.parammaps = {}
|
|
this.requestParam.parammaps['id'] = row.id
|
|
this.requestParam.parammaps['id'] = row.id
|
|
- PostDataByName(this.requestParam).then(() => {
|
|
|
|
|
|
+ let url = 'authdata/diese/off'
|
|
|
|
+ let data = {
|
|
|
|
+ id:parseInt(row.id),
|
|
|
|
+ }
|
|
|
|
+ postJson(url,data).then(response => {
|
|
this.get_table_data()
|
|
this.get_table_data()
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
this.$notify({
|
|
this.$notify({
|