index.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <div class="filter-container">
  8. <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" style="width: 120px;" class="filter-item" @change="changePastureName">
  9. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  10. </el-select>
  11. <el-select v-model="getdataListParm.parammaps.deptName" placeholder="部门" style="width: 120px;" class="filter-item" clearable>
  12. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
  13. </el-select>
  14. <el-input v-model="getdataListParm.parammaps.cardNumber" placeholder="卡号" clearable class="filter-item" style="width: 120px" />
  15. <!-- <el-date-picker v-model="getdataListParm.parammaps.selTime" type="date" placeholder="交易时间" style="width:170px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" /> -->
  16. <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-5px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  17. <el-input v-model="getdataListParm.parammaps.equipmentNumber" placeholder="设备编号" clearable class="filter-item" style="width: 120px" />
  18. <el-input v-model="getdataListParm.parammaps.assetName" placeholder="设备名称" clearable class="filter-item" style="width: 120px" />
  19. <el-input v-model="getdataListParm.parammaps.employName" placeholder="加油工" clearable class="filter-item" style="width: 120px" />
  20. <el-input v-model="getdataListParm.parammaps.oilClass" placeholder="加油工班" clearable class="filter-item" style="width: 120px" />
  21. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  22. <div>
  23. <el-button v-if="isDieselAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  24. <el-button v-if="isDieselExport" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
  25. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  26. <el-button v-if="isRetreatImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2" @click="form_search">导入</el-button>
  27. </el-upload>
  28. <el-button v-if="isDieselExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">数据导出</el-button>
  29. <el-button class="filter-item" type="danger" icon="el-icon-download" @click="form_delete">删除</el-button>
  30. </div>
  31. </div>
  32. <el-table
  33. :key="tableKey"
  34. v-loading="listLoading"
  35. element-loading-text="给我一点时间"
  36. :data="list"
  37. border
  38. fit
  39. highlight-current-row
  40. style="width: 100%;"
  41. :row-style="rowStyle"
  42. :cell-style="cellStyle"
  43. class="elTable"
  44. @sort-change="tableSort1"
  45. >
  46. <el-table-column label="序号" align="center" type="index" width="50px">
  47. <template slot-scope="scope">
  48. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="牧场" width="90px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.pastureName }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="部门" width="80px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.departName }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="交易时间" sortable prop="selTime" width="90px" align="center" />
  62. <el-table-column label="车号" min-width="110px" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.assetNumber }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="加油工班" width="80px" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.oilClass }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="加油工" width="80px" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ scope.row.empId }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="卡号" width="90px" align="center">
  78. <template slot-scope="scope">
  79. <span>{{ scope.row.cardNumber }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="卡类型" width="80px" align="center">
  83. <template slot-scope="scope">
  84. <span>{{ scope.row.cardType }}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="本次加油量(升)" sortable prop="oilAmount" width="80px" align="center">
  88. <template slot-scope="scope">
  89. <span>{{ scope.row.oilAmount }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="本次消费金额(元)" sortable prop="nowPrice" width="80px" align="center">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.nowPrice }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="备注" min-width="110px" align="center">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.note }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="操作" align="center" width="200px" class-name="small-padding fixed-width" fixed="right">
  103. <template slot-scope="{row}">
  104. <el-button v-if="isDieselModify" type="success" size="mini" @click="handleDieselUpdate(row)">编辑</el-button>
  105. <!-- <el-button type="primary" size="mini" style="width:70px" @click="handleDosageRecord(row)">用量记录</el-button> -->
  106. <!-- <el-button v-if="isDieselUpdate" type="success" size="mini" @click="handleDieselUpdate(row)">修改</el-button> -->
  107. <!-- <el-button v-if="isDieselDel" type="danger" size="mini" @click="handleDieselDel(row)">删除</el-button> -->
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  112. <!-- 弹出层新增or修改 -->
  113. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
  114. <el-form ref="temp" :rules="rules" :model="temp" label-position="right" label-width="150px">
  115. <el-row>
  116. <el-col :span="8">
  117. <el-form-item label="油卡编号" prop="cardNumber">
  118. <el-autocomplete
  119. ref="cardNumber"
  120. v-model="temp.cardNumber"
  121. value-key="cardNumber"
  122. class="inline-input"
  123. :fetch-suggestions="formCardSearch"
  124. placeholder="请输入内容"
  125. :disabled="dialogStatus==='update'"
  126. @select="handleformNameSelect"
  127. @blur="blurformNameSelect"
  128. >
  129. <template slot-scope="{ item }">
  130. <div class="name" style="display: inline;">{{ item.cardCode }}</div>
  131. </template>
  132. </el-autocomplete>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="8">
  136. <el-form-item label="单价:" prop="price">
  137. <el-input ref="price" v-model="temp.price" />
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="8">
  141. <el-form-item label="油量(L):" prop="oilAmount">
  142. <el-input ref="oilAmount" v-model="temp.oilAmount" />
  143. </el-form-item>
  144. </el-col>
  145. </el-row>
  146. <el-row>
  147. <el-col :span="8">
  148. <el-form-item label="设备名称:" prop="assetName">
  149. <el-autocomplete ref="assetName" v-model="temp.assetName" value-key="assetName" class="inline-input" :fetch-suggestions="formNameSearch" placeholder="" disabled @select="handleformNameSelect" />
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="8">
  153. <el-form-item label="牧场设备编号:" prop="eqCode">
  154. <el-autocomplete ref="eqCode" v-model="temp.eqCode" value-key="eqCode" class="inline-input" :fetch-suggestions="formNumberSearch" placeholder="" disabled @select="handleformNameSelect">
  155. <template slot-scope="{ item }">
  156. <div class="name" style="display: inline;">{{ item.assetNumber }}</div>
  157. </template>
  158. </el-autocomplete>
  159. </el-form-item>
  160. </el-col>
  161. </el-row>
  162. <el-row>
  163. <el-col :span="8">
  164. <el-form-item label="牧场" prop="pastureName">
  165. <el-input ref="pastureName" v-model="temp.pastureName" disabled />
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="8">
  169. <el-form-item label="部门" prop="deptName">
  170. <el-input ref="deptName" v-model="temp.deptName" disabled />
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. <el-row>
  175. <el-col :span="8">
  176. <el-form-item label="加油人:" prop="employeId">
  177. <el-input ref="employeId" v-model="temp.empId" :disabled="dialogStatus==='update'" />
  178. <!-- <el-select v-model="temp.employeId" placeholder="负责人" :disabled="dialogStatus==='update'" class="filter-item">
  179. <el-option
  180. v-for="item in findAllEmploye"
  181. :key="item.id"
  182. :label="item.name"
  183. :value="item.id"
  184. />
  185. </el-select> -->
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="8">
  189. <el-form-item label="录入人:" prop="inputId">
  190. <el-select v-model="temp.inputId" placeholder="负责人" :disabled="dialogStatus==='update'" class="filter-item">
  191. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  192. </el-select>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="8">
  196. <el-form-item label="加油工班次:" prop="oilClass">
  197. <el-input ref="oilClass" v-model="temp.oilClass" :disabled="dialogStatus==='update'" />
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="8">
  201. <el-form-item label="交易时间:" prop="selTime">
  202. <el-date-picker v-model="temp.selTime" type="date" placeholder="交易时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%;" :disabled="dialogStatus==='update'" />
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="8">
  206. <el-form-item label="备注:" prop="note">
  207. <el-input v-model="temp.note" type="textarea" :rows="2" placeholder="请输入内容" />
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. </el-form>
  212. <div slot="footer" class="dialog-footer">
  213. <el-button v-if="dialogStatus==='create'" ref="createb" :disabled="isokDisable" type="success" @click="add_dialog_save_again()">保存并新增</el-button>
  214. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  215. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  216. </div>
  217. </el-dialog>
  218. <!-- 用量记录 -->
  219. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
  220. <div class="dosageRecord">
  221. <div style="position: absolute;top:20px;left:100px;font:18px/24px '' ;color:#303133;">
  222. <span style="margin:0 10px;">表名称:{{ dosageRecordTemp.formName }}</span>
  223. <span>表编号:{{ dosageRecordTemp.formNumber }}</span>
  224. </div>
  225. <el-table
  226. :key="tableKey"
  227. v-loading="listLoadingDosageRecord"
  228. element-loading-text="给我一点时间"
  229. :data="listDosageRecord"
  230. border
  231. fit
  232. highlight-current-row
  233. style="width: 100%;"
  234. :row-style="rowStyle"
  235. :cell-style="cellStyle"
  236. class="elTable"
  237. @sort-change="tableSort2"
  238. >
  239. <el-table-column label="序号" align="center" type="index" width="50px">
  240. <template slot-scope="scope">
  241. <span>{{ scope.$index + (pageNumDosageRecord-1) * pageSizeDosageRecord + 1 }}</span>
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="上次值" sortable prop="lastAmount" min-width="110px" align="center">
  245. <template slot-scope="scope">
  246. <span>{{ scope.row.lastAmount }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="本次值" sortable prop="endAmount" min-width="110px" align="center">
  250. <template slot-scope="scope">
  251. <span>{{ scope.row.endAmount }}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="用量" sortable prop="waterConsumption" min-width="110px" align="center">
  255. <template slot-scope="scope">
  256. <span>{{ scope.row.waterConsumption }}</span>
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="单价" sortable prop="price" align="center" width="150">
  260. <template slot-scope="scope">
  261. <span>{{ scope.row.price }}</span>
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="总价" sortable prop="sumPrice" align="center" width="150">
  265. <template slot-scope="scope">
  266. <span>{{ scope.row.sumPrice }}</span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="记录人" width="150px" align="center">
  270. <template slot-scope="scope">
  271. <span>{{ scope.row.empname }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="记录日期" min-width="110px" align="center" sortable prop="date" />
  275. </el-table>
  276. <pagination v-show="totalDosageRecord>=0" :total="totalDosageRecord" :page.sync="getDosageRecordListParm.offset" :limit.sync="getDosageRecordListParm.pagecount" @pagination="getDosageRecordList" />
  277. <div slot="footer" class="dialog-footer">
  278. <el-button @click="dialogFormDosageRecord = false">关闭</el-button>
  279. </div>
  280. </div>
  281. </el-dialog>
  282. <!-- 删除 -->
  283. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormDelete" :close-on-click-modal="false" width="40%">
  284. <el-form ref="deleteTemp" :rules="rules" :model="deleteTemp" label-position="right" label-width="190px">
  285. <el-row>
  286. <el-col :span="8">
  287. <el-form-item label="请选择要删除数据的日期:" prop="startTime">
  288. <el-date-picker ref="startTime" v-model="deleteTemp.startTime" :clearable="false" type="date" placeholder="日期" style="width:100%px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  289. </el-form-item>
  290. </el-col>
  291. </el-row>
  292. </el-form>
  293. <div slot="footer" class="dialog-footer">
  294. <el-button type="primary" :disabled="isokDisable" @click="deleteData()">确认</el-button>
  295. <el-button @click="dialogFormDelete = false;get_table_data()">关闭</el-button>
  296. </div>
  297. </el-dialog>
  298. </div>
  299. </template>
  300. <script>
  301. // 引入
  302. require('script-loader!file-saver')
  303. import { GetDataByName, GetDataByNames, PostDataByName, checkButtons, ExecDataByConfig, failproccess, GetAccount } from '@/api/common'
  304. // import { DownloadExcel, GetDataByNameXlsx } from '@/api/common'
  305. import waves from '@/directive/waves'
  306. import { parseTime, sortChange } from '@/utils/index.js'
  307. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  308. import { MessageBox } from 'element-ui'
  309. import { getToken } from '@/utils/auth'
  310. import Cookies from 'js-cookie'
  311. export default {
  312. name: 'Diesel',
  313. components: { Pagination },
  314. directives: { waves },
  315. data() {
  316. return {
  317. isokDisable: false,
  318. isDieselUpdate: [],
  319. isDieselDel: [],
  320. isDieselAdd: [],
  321. isDieselExport: [],
  322. isDieselModify: [],
  323. isRetreatImport: [],
  324. isRetreatMuban: [],
  325. formNumberSearchList: [],
  326. formNameSearchList: [],
  327. tableKey: 0,
  328. list: null,
  329. total: 0,
  330. listLoading: true,
  331. requestParam: {
  332. name: 'insertDiesel',
  333. offset: 0,
  334. pagecount: 0,
  335. parammaps: {}
  336. },
  337. postDataPramas: {
  338. },
  339. // 1-2:table&搜索传参
  340. getdataListParm: {
  341. name: 'getDieselList',
  342. page: 1,
  343. offset: 1,
  344. pagecount: 10,
  345. returntype: 'Map',
  346. parammaps: {
  347. selTime: '',
  348. pastureName: Cookies.get('pasturename'),
  349. departName: ''
  350. }
  351. },
  352. // 2-3:下拉框请求后数据加入[]
  353. getDictByName: [],
  354. findAllAssetType: [],
  355. findAllPasture: [],
  356. findAllDepart: [],
  357. findAllEmploye: [],
  358. // 2-1.请求下拉框接口
  359. requestParams: [
  360. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['水表类型'] },
  361. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  362. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  363. { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  364. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
  365. ],
  366. getDepartParam: {
  367. name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
  368. },
  369. requestFilterParams: {
  370. name: 'getWaterList',
  371. page: 1,
  372. offset: 1,
  373. pagecount: 10,
  374. returntype: 'Map',
  375. parammaps: {}
  376. },
  377. temp: {
  378. selTime: parseTime(new Date(), '{y}-{m}-{d}'),
  379. oilClass: '', // 加油工班
  380. cardNumber: '',
  381. price: '',
  382. empId: '',
  383. inputId: this.$store.state.user.employeid,
  384. departmentId: this.$store.state.user.departmentid,
  385. pastureId: this.$store.state.user.pastureid,
  386. oilAmount: '',
  387. nowPrice: '',
  388. note: '',
  389. eqId: '',
  390. eqCode: '',
  391. oilcardId: ''
  392. },
  393. dialogFormVisible: false,
  394. dialogStatus: '',
  395. textMap: {
  396. update: '编辑',
  397. create: '新增',
  398. DosageRecord: '用量记录',
  399. delete: '删除'
  400. },
  401. dialogFormDosageRecord: false,
  402. totalDosageRecord: 0,
  403. listDosageRecord: [],
  404. listLoadingDosageRecord: false,
  405. getDosageRecordListParm: {
  406. name: 'getDieselHistory',
  407. page: 1,
  408. offset: 1,
  409. pagecount: 10,
  410. returntype: 'Map',
  411. parammaps: {}
  412. },
  413. dosageRecordTemp: {},
  414. // 校验规则
  415. rules: {
  416. cardNumber: [{ required: true, message: '必填', trigger: 'blur' }],
  417. price: [{ required: true, message: '必填', trigger: 'blur' }],
  418. oilAmount: [{ required: true, message: '必填', trigger: 'blur' }],
  419. endAmount: [{ type: 'number', required: true, validator: (rule, value, callback) => {
  420. console.log(rule, value, callback)
  421. if (!value) {
  422. callback(new Error('不能为空'))
  423. }
  424. if (value < 0) {
  425. callback(new Error('必须大于0'))
  426. } else if (value < this.temp.aAmount) {
  427. callback(new Error('必须大于上次值'))
  428. }
  429. setTimeout(() => {
  430. const re = /^\d+$/ // /^[0-9]*[1-9][0-9]*$/
  431. const rsCheck = re.test(value)
  432. if (!rsCheck) {
  433. callback(new Error('请输入整数'))
  434. } else {
  435. callback()
  436. }
  437. }, 0)
  438. }, trigger: 'blur' }],
  439. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  440. startTime: [{ required: true, message: '必填', trigger: 'blur' }]
  441. },
  442. MeasureListbyfilter: [],
  443. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  444. cellStyle: { padding: 0 + 'px' },
  445. buttons: [],
  446. isPercentage: false,
  447. percentage: 1,
  448. dialogFormDelete: false,
  449. deleteTemp: {}
  450. }
  451. },
  452. computed: {
  453. // 设置请求头
  454. headers() {
  455. return {
  456. // 设置token
  457. token: getToken()
  458. }
  459. },
  460. uploadData() {
  461. return {
  462. name: 'importDiesel',
  463. importParams: '牧场,油卡编号,设备名称,设备编号,加油日期,加油量(升),单价,录入人,加油人,加油工班,备注',
  464. sheetname: 'SheetJS'
  465. }
  466. },
  467. // 设置上传地址
  468. uploadExcelUrl() {
  469. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  470. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  471. }
  472. },
  473. created() {
  474. const that = this
  475. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  476. that.buttons = response.data.list
  477. that.get_auto_buttons()
  478. })
  479. this.get_select_list()
  480. this.get_table_data()
  481. },
  482. methods: {
  483. tableSort1(column) {
  484. sortChange(column, this.list)
  485. },
  486. tableSort2(column) {
  487. sortChange(column, this.listDosageRecord)
  488. },
  489. get_auto_buttons() {
  490. // 新增
  491. const DieselAdd = 'cost:diesel:add'
  492. const isDieselAdd = checkButtons(this.$store.state.user.buttons, DieselAdd)
  493. this.isDieselAdd = isDieselAdd
  494. // 模板
  495. const RetreatMuban = 'cost:diesel:muban'
  496. const isRetreatMuban = checkButtons(this.$store.state.user.buttons, RetreatMuban)
  497. this.isRetreatMuban = isRetreatMuban
  498. // 导出
  499. const DieselExport = 'cost:diesel:export'
  500. const isDieselExport = checkButtons(this.$store.state.user.buttons, DieselExport)
  501. this.isDieselExport = isDieselExport
  502. // 导入
  503. const RetreatImport = 'cost:diesel:import'
  504. const isRetreatImport = checkButtons(this.$store.state.user.buttons, RetreatImport)
  505. this.isRetreatImport = isRetreatImport
  506. // 编辑
  507. const DieselModify = 'cost:diesel:modify'
  508. const isDieselModify = checkButtons(this.$store.state.user.buttons, DieselModify)
  509. this.isDieselModify = isDieselModify
  510. // 修改
  511. const DieselUpdate = 'cost:diesel:update'
  512. const isDieselUpdate = checkButtons(this.$store.state.user.buttons, DieselUpdate)
  513. this.isDieselUpdate = isDieselUpdate
  514. // 删除
  515. const DieselDel = 'cost:diesel:del'
  516. const isDieselDel = checkButtons(this.$store.state.user.buttons, DieselDel)
  517. this.isDieselDel = isDieselDel
  518. },
  519. isIntegerZero_(rule, value, callback) {
  520. if (value === '' || value === undefined || value === null) {
  521. return callback(new Error('输入不可以为空'))
  522. }
  523. if (value.length === 0) {
  524. return callback(new Error('输入不可以为空'))
  525. }
  526. setTimeout(() => {
  527. const re = /^\d+$/ // /^[0-9]*[1-9][0-9]*$/
  528. const rsCheck = re.test(value)
  529. if (!rsCheck) {
  530. callback(new Error('请输入整数'))
  531. } else {
  532. callback()
  533. }
  534. }, 0)
  535. },
  536. // 模糊查询-报修名称
  537. formNumberSearch(queryString, cb) {
  538. this.requestFilterParams.name = 'findAssetMainOil'
  539. this.requestFilterParams.parammaps['assetNumber'] = queryString
  540. this.requestFilterParams.parammaps['pastureId'] = Cookies.get('pastureid')
  541. this.requestFilterParams.parammaps['assetName'] = ''
  542. this.requestFilterParams.parammaps['cardCode'] = ''
  543. GetDataByName(this.requestFilterParams).then(response => {
  544. this.formNumberSearchList = response.data.list
  545. var results = queryString ? this.formNumberSearchList.filter(this.createFilter(queryString)) : this.formNumberSearchList
  546. cb(results)
  547. })
  548. },
  549. createFilter(queryString) {
  550. return returnValue => {
  551. return (
  552. returnValue.assetNumber.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
  553. )
  554. }
  555. },
  556. formNameSearch(queryString, cb) {
  557. this.requestFilterParams.name = 'findAssetMainOil'
  558. this.requestFilterParams.parammaps['assetNumber'] = ''
  559. this.requestFilterParams.parammaps['pastureId'] = Cookies.get('pastureid')
  560. this.requestFilterParams.parammaps['assetName'] = queryString
  561. this.requestFilterParams.parammaps['cardCode'] = ''
  562. GetDataByName(this.requestFilterParams).then(response => {
  563. this.formNameSearchList = response.data.list
  564. var results = queryString ? this.formNameSearchList.filter(this.createFilterName(queryString)) : this.formNameSearchList
  565. cb(results)
  566. })
  567. },
  568. formCardSearch(queryString, cb) {
  569. this.requestFilterParams.name = 'findAssetMainOil'
  570. this.requestFilterParams.parammaps['assetNumber'] = ''
  571. this.requestFilterParams.parammaps['assetName'] = ''
  572. this.requestFilterParams.parammaps['cardCode'] = queryString
  573. this.requestFilterParams.parammaps['pastureId'] = Cookies.get('pastureid')
  574. GetDataByName(this.requestFilterParams).then(response => {
  575. if (response.data.list === null) {
  576. this.formNameSearchList = []
  577. } else {
  578. this.formNameSearchList = response.data.list
  579. }
  580. var results = queryString ? this.formNameSearchList.filter(this.createFilterName(queryString)) : this.formNameSearchList
  581. cb(results)
  582. })
  583. },
  584. createFilterName(queryString) {
  585. return returnValue => {
  586. return (
  587. returnValue.cardCode.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
  588. )
  589. }
  590. },
  591. handleformNameSelect(item) {
  592. this.temp.assetName = item.assetName
  593. this.temp.cardNumber = item.cardCode
  594. this.temp.eqId = item.eqId
  595. this.temp.eqCode = item.eqCode
  596. this.temp.oilcardId = item.oilcardId
  597. this.temp.deptName = item.deptName
  598. this.temp.departmentId = item.deptId
  599. this.temp.pastureName = item.pastureName
  600. this.temp.price = item.price
  601. },
  602. blurformNameSelect(item) {
  603. this.temp.assetName = ''
  604. this.temp.cardNumber = ''
  605. this.temp.eqId = ''
  606. this.temp.eqCode = ''
  607. this.temp.oilcardId = ''
  608. this.temp.deptName = ''
  609. this.temp.pastureName = ''
  610. this.temp.price = ''
  611. }, // 导出
  612. handleDownload() {
  613. this.$alert('油卡正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  614. this.isPercentage = true
  615. this.percentage = 1
  616. var timer = setInterval(() => {
  617. this.percentage += 5
  618. if (this.percentage > 95) {
  619. this.percentage = 99
  620. clearInterval(timer)
  621. }
  622. this.percentage = this.percentage
  623. }, 1000)
  624. this.requestParam.name = 'getDieselList'
  625. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  626. this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
  627. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  628. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  629. GetAccount(this.requestParam).then(response => {
  630. if (response.data.list !== '') {
  631. this.percentage = 99
  632. setTimeout(() => {
  633. this.isPercentage = false
  634. }, 2000)
  635. }
  636. this.$nextTick(() => {
  637. import('@/vendor/Export2Excel').then(excel => {
  638. const list1 = response.data.list
  639. const tHeader = [
  640. '牧场', '部门', '交易时间', '车号', '加油工班', '加油工', '卡号', '卡类型', '本次加油量(升)', '本次消费金额(元)', '备注'
  641. ]
  642. const filterVal = [
  643. 'pastureName', 'departName', 'selTime', 'assetNumber', 'oilClass', 'empId', 'cardNumber', 'cardType', 'oilAmount', 'nowPrice', 'note'
  644. ]
  645. const data1 = this.formatJson(filterVal, list1)
  646. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '柴油用量', autoWidth: true, bookType: 'xlsx' })
  647. })
  648. })
  649. })
  650. },
  651. handleDownloadTemp() {
  652. this.$alert('柴油模板正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  653. this.isPercentage = true
  654. this.percentage = 1
  655. var timer = setInterval(() => {
  656. this.percentage += 5
  657. if (this.percentage > 95) {
  658. this.percentage = 99
  659. clearInterval(timer)
  660. }
  661. this.percentage = this.percentage
  662. }, 1000)
  663. this.requestParam.name = 'getOilcardList'
  664. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  665. GetDataByName(this.requestParam).then(response => {
  666. if (response.data.list !== '') {
  667. this.percentage = 99
  668. setTimeout(() => {
  669. this.isPercentage = false
  670. }, 2000)
  671. }
  672. this.$nextTick(() => {
  673. import('@/vendor/Export2Excel').then(excel => {
  674. let day = parseTime(new Date(), '{y}-{m}-{d}')
  675. for(let i=0;i<response.data.list.length;i++){
  676. this.$set(response.data.list[i], 'i', i+1)
  677. this.$set(response.data.list[i], 'day', day)
  678. this.$set(response.data.list[i], 'day', day)
  679. this.$set(response.data.list[i], 'name', Cookies.get('employename'))
  680. }
  681. const list1 = response.data.list
  682. console.log(list1,'list1')
  683. const tHeader = [
  684. '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注'
  685. ]
  686. const filterVal = [
  687. 'i', 'pastureName', 'cardNumber', 'assetName', 'assetNumber', 'day', '加油量(L)', '单价', 'name', '加油人', '加油工班', '备注'
  688. ]
  689. const data1 = this.formatJson(filterVal, list1)
  690. excel.export_json_to_excel({
  691. header: tHeader,
  692. data: data1,
  693. filename: '柴油模板',
  694. autoWidth: true,
  695. bookType: 'xlsx'
  696. })
  697. })
  698. })
  699. })
  700. },
  701. formatJson(filterVal, jsonData) {
  702. return jsonData.map(v =>
  703. filterVal.map(j => {
  704. if (j === 'timestamp') {
  705. return parseTime(v[j])
  706. } else {
  707. return v[j]
  708. }
  709. })
  710. )
  711. },
  712. // 导入
  713. beforeImportExcel(file) {
  714. /* const isExcel =
  715. file.type ===
  716. 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' */
  717. const isLt2M = file.size / 1024 / 1024 < 2
  718. /* if (!isExcel) {
  719. this.$message.error(
  720. '上传文件必须是Xlsx格式!建议先导出,再修改导出文件再导入!'
  721. )
  722. }*/
  723. if (!isLt2M) {
  724. this.$message.error('上传文件大小不能超过 2MB!')
  725. }
  726. return isLt2M
  727. },
  728. handleImportExcelSuccess(res, file) {
  729. // if (res.msg === 'ok') {
  730. if (res.msg === 'ok') {
  731. this.$message({
  732. title: '成功',
  733. message: '导入成功:' + res.data.success + '条!',
  734. type: 'success',
  735. duration: 2000
  736. })
  737. if (res.data.err_count > 0) {
  738. this.$notify({
  739. title: '失败',
  740. message: '导入失败:' + res.data.err_count + '条!',
  741. type: 'danger',
  742. duration: 2000
  743. })
  744. import('@/vendor/Export2Excel').then(excel => {
  745. const list1 = res.data.result
  746. const tHeader = [
  747. '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '备注', '错误信息'
  748. ]
  749. const filterVal = [
  750. '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '备注', 'error_msg'
  751. ]
  752. const data1 = this.formatJson(filterVal, list1)
  753. excel.export_json_to_excel({
  754. header: tHeader,
  755. data: data1,
  756. filename: this.requestParam.parammaps.formType,
  757. autoWidth: true,
  758. bookType: 'xlsx'
  759. })
  760. })
  761. }
  762. } else {
  763. this.$notify({
  764. title: '失败',
  765. message: '上传失败',
  766. type: 'danger',
  767. duration: 2000
  768. })
  769. }
  770. },
  771. // 1-1: table&搜索
  772. get_table_data() {
  773. this.listLoading = true
  774. GetDataByName(this.getdataListParm).then(response => {
  775. if (response.data.list == null) {
  776. this.list = []
  777. } else {
  778. this.list = response.data.list
  779. this.pageNum = response.data.pageNum
  780. this.pageSize = response.data.pageSize
  781. if (response.data.total) {
  782. this.total = response.data.total
  783. }
  784. }
  785. setTimeout(() => {
  786. this.listLoading = false
  787. }, 100)
  788. })
  789. },
  790. // 2-2:下拉框
  791. get_select_list() {
  792. GetDataByNames(this.requestParams).then(response => {
  793. this.getDictByName = response.data.getDictByName.list
  794. this.findAllAssetType = response.data.findAllAssetType.list
  795. this.findAllPasture = response.data.findAllPasture.list
  796. this.findAllEmploye = response.data.findAllEmploye.list
  797. this.getDepartDownList()
  798. })
  799. },
  800. getDepartDownList() {
  801. GetDataByName(this.getDepartParam).then(response => {
  802. this.findAllDepart = response.data.list
  803. })
  804. },
  805. changePastureName(item) {
  806. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  807. this.getdataListParm.parammaps.deptName = ''
  808. this.getDepartDownList()
  809. },
  810. form_search() {
  811. this.listLoading = true
  812. this.getdataListParm.offset = 1
  813. if (this.getdataListParm.parammaps.inputDatetime == null) {
  814. this.getdataListParm.parammaps.inputDatetime = ''
  815. }
  816. if (this.getdataListParm.parammaps.inputDatetime !== '' && this.getdataListParm.parammaps.inputDatetime !== null) {
  817. this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  818. this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  819. } else {
  820. this.getdataListParm.parammaps.inputDatetime = ''
  821. this.getdataListParm.parammaps.startTime = ''
  822. this.getdataListParm.parammaps.stopTime = ''
  823. }
  824. // if (this.getdataListParm.parammaps.selTime == null) {
  825. // this.getdataListParm.parammaps.selTime = ''
  826. // }
  827. this.get_table_data()
  828. },
  829. handleModifyStatus(row, status) {
  830. this.$message({
  831. message: '操作成功',
  832. type: 'success'
  833. })
  834. row.status = status
  835. },
  836. form_reset() {
  837. this.temp.cardNumber = ''
  838. this.temp.price = ''
  839. this.temp.oilAmount = ''
  840. this.temp.assetName = ''
  841. this.temp.eqCode = ''
  842. this.temp.pastureName = ''
  843. this.temp.deptName = ''
  844. this.temp.oilClass = ''
  845. this.temp.selTime = parseTime(new Date(), '{y}-{m}-{d}')
  846. this.temp.note = ''
  847. },
  848. form_add() {
  849. console.log(this.temp.DATE)
  850. this.form_reset()
  851. this.dialogStatus = 'create'
  852. this.dialogFormVisible = true
  853. this.temp.empId = ''
  854. this.temp.departmentId = ''
  855. this.temp.pastureId = this.$store.state.user.pastureid
  856. this.$nextTick(() => {
  857. this.$refs['temp'].clearValidate()
  858. })
  859. },
  860. add_dialog_save() {
  861. this.isokDisable = true
  862. setTimeout(() => {
  863. this.isokDisable = false
  864. }, 1000)
  865. this.$refs['temp'].validate(valid => {
  866. if (valid) {
  867. this.postDataPramas.common = { 'returnmap': '0' }
  868. this.postDataPramas.data = []
  869. this.postDataPramas.data[0] = { 'name': 'insertDiesel', 'type': 'e', 'parammaps': {
  870. 'pastureId': this.temp.pastureId,
  871. 'selTime': this.temp.selTime,
  872. 'oilClass': this.temp.oilClass,
  873. 'oilAmount': this.temp.oilAmount,
  874. 'eqId': this.temp.eqId,
  875. 'eqCode': this.temp.eqCode,
  876. 'departmentId': this.temp.departmentId,
  877. 'note': this.temp.note,
  878. 'nowPrice': this.temp.price * this.temp.oilAmount,
  879. 'oilcardId': this.temp.oilcardId,
  880. 'cardNumber': this.temp.cardNumber,
  881. 'price': this.temp.price,
  882. 'empId': this.temp.empId,
  883. 'inputId': this.temp.inputId
  884. }}
  885. this.postDataPramas.data[1] = { 'name': 'updateOilCardExecData', 'type': 'e',
  886. 'parammaps': {
  887. 'id': this.temp.oilcardId,
  888. 'nowPrice': this.temp.price * this.temp.oilAmount
  889. }}
  890. ExecDataByConfig(this.postDataPramas).then(response => {
  891. if (response.msg === 'fail') {
  892. this.$notify({
  893. title: '保存失败',
  894. message: response.data,
  895. type: 'warning',
  896. duration: 2000
  897. })
  898. } else {
  899. this.get_table_data()
  900. this.dialogFormVisible = false
  901. this.$notify({
  902. title: '',
  903. message: '保存成功',
  904. type: 'success',
  905. duration: 2000
  906. })
  907. }
  908. })
  909. }
  910. })
  911. },
  912. // 继续新增
  913. add_dialog_save_again() {
  914. this.isokDisable = true
  915. setTimeout(() => {
  916. this.isokDisable = false
  917. }, 1000)
  918. this.$refs['temp'].validate(valid => {
  919. if (valid) {
  920. this.postDataPramas.common = { 'returnmap': '0' }
  921. this.postDataPramas.data = []
  922. this.postDataPramas.data[0] = { 'name': 'insertDiesel', 'type': 'e', 'parammaps': {
  923. 'pastureId': this.temp.pastureId,
  924. 'selTime': this.temp.selTime,
  925. 'oilClass': this.temp.oilClass,
  926. 'oilAmount': this.temp.oilAmount,
  927. 'eqId': this.temp.eqId,
  928. 'eqCode': this.temp.eqCode,
  929. 'departmentId': this.temp.departmentId,
  930. 'note': this.temp.note,
  931. 'nowPrice': this.temp.price * this.temp.oilAmount,
  932. 'oilcardId': this.temp.oilcardId,
  933. 'cardNumber': this.temp.cardNumber,
  934. 'price': this.temp.price,
  935. 'empId': this.temp.empId,
  936. 'inputId': this.temp.inputId
  937. }}
  938. this.postDataPramas.data[1] = { 'name': 'updateOilCardExecData', 'type': 'e',
  939. 'parammaps': {
  940. 'id': this.temp.oilcardId,
  941. 'nowPrice': this.temp.price * this.temp.oilAmount
  942. }}
  943. ExecDataByConfig(this.postDataPramas).then(response => {
  944. if (response.msg !== 'fail') {
  945. this.form_reset()
  946. this.$nextTick(() => {
  947. this.$refs['temp'].clearValidate()
  948. })
  949. this.$notify({
  950. title: '成功',
  951. message: '新增成功',
  952. type: 'success',
  953. duration: 2000
  954. })
  955. } else {
  956. failproccess(response, this.$notify)
  957. }
  958. })
  959. }
  960. })
  961. },
  962. form_edit(row) {
  963. this.temp = Object.assign({}, row) // copy obj
  964. this.dialogStatus = 'update'
  965. this.dialogFormVisible = true
  966. this.$nextTick(() => {
  967. this.$refs['temp'].clearValidate()
  968. })
  969. },
  970. // 修改加油信息
  971. edit_dialog_save() {
  972. this.$refs['temp'].validate(valid => {
  973. if (valid) {
  974. this.postDataPramas.common = { 'returnmap': '0' }
  975. this.postDataPramas.data = []
  976. this.postDataPramas.data[0] = { 'name': 'updateDieselExecData', 'type': 'e', 'parammaps': {
  977. 'id': this.temp.id,
  978. 'oilAmount': this.temp.oilAmount,
  979. 'note': this.temp.note,
  980. 'nowPrice': this.temp.price * this.temp.oilAmount,
  981. 'price': this.temp.price
  982. }}
  983. this.postDataPramas.data[1] = { 'name': 'updateOilCardLAExecData', 'type': 'e',
  984. 'parammaps': {
  985. 'id': this.temp.oilcardId,
  986. 'nowPrice': this.temp.price * this.temp.oilAmount
  987. }}
  988. ExecDataByConfig(this.postDataPramas).then(response => {
  989. if (response.msg === 'fail') {
  990. this.$notify({
  991. title: '保存失败',
  992. message: response.data,
  993. type: 'warning',
  994. duration: 2000
  995. })
  996. } else {
  997. this.get_table_data()
  998. this.dialogFormVisible = false
  999. this.$notify({
  1000. title: '',
  1001. message: '保存成功',
  1002. type: 'success',
  1003. duration: 2000
  1004. })
  1005. }
  1006. })
  1007. }
  1008. })
  1009. },
  1010. handleDieselUpdate(row) {
  1011. this.temp = Object.assign({}, row) // copy obj
  1012. this.temp.eqCode = this.temp.assetNumber
  1013. this.temp.deptName = this.temp.departName
  1014. this.dialogStatus = 'update'
  1015. this.dialogFormVisible = true
  1016. this.$nextTick(() => {
  1017. this.$refs['temp'].clearValidate()
  1018. })
  1019. },
  1020. // 删除加油信息
  1021. handleDieselDel(row) {
  1022. MessageBox.confirm('是否确认删除此条加油信息?', {
  1023. confirmButtonText: '确认',
  1024. cancelButtonText: '取消',
  1025. type: 'warning'
  1026. })
  1027. .then(() => {
  1028. this.requestParam.name = 'deleteDiesel'
  1029. this.requestParam.parammaps = {}
  1030. this.requestParam.parammaps['id'] = row.id
  1031. PostDataByName(this.requestParam).then(() => {
  1032. this.get_table_data()
  1033. this.dialogFormVisible = false
  1034. this.$notify({
  1035. title: '成功',
  1036. message: '删除成功',
  1037. type: 'success',
  1038. duration: 2000
  1039. })
  1040. })
  1041. })
  1042. .catch(() => {
  1043. this.$message({
  1044. type: 'info',
  1045. message: '已取消删除'
  1046. })
  1047. })
  1048. },
  1049. handleDosageRecord(row) {
  1050. this.dialogStatus = 'DosageRecord'
  1051. this.dialogFormDosageRecord = true
  1052. this.dosageRecordTemp = Object(row, {})
  1053. this.getDosageRecordList()
  1054. },
  1055. form_delete() {
  1056. this.deleteTemp = {}
  1057. this.dialogStatus = 'delete'
  1058. this.dialogFormDelete = true
  1059. },
  1060. deleteData() {
  1061. this.$refs['deleteTemp'].validate(valid => {
  1062. if (valid) {
  1063. this.requestParam.name = 'deletedatastem'
  1064. this.requestParam.parammaps = {}
  1065. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  1066. this.requestParam.parammaps.codeType = 3
  1067. this.requestParam.parammaps.startTime = this.deleteTemp.startTime
  1068. this.requestParam.parammaps.stopTime = this.deleteTemp.startTime
  1069. PostDataByName(this.requestParam).then(response => {
  1070. if (response.msg == 'fail') {
  1071. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1072. } else {
  1073. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1074. this.dialogFormDelete = false
  1075. this.get_table_data()
  1076. }
  1077. })
  1078. }
  1079. })
  1080. },
  1081. getDosageRecordList() {
  1082. this.listLoadingDosageRecord = true
  1083. this.getDosageRecordListParm.parammaps.id = this.dosageRecordTemp.oilcardId
  1084. GetDataByName(this.getDosageRecordListParm).then(response => {
  1085. this.listDosageRecord = response.data.list
  1086. this.pageNumDosageRecord = response.data.pageNum
  1087. this.pageSizeDosageRecord = response.data.pageSize
  1088. if (response.data.total) {
  1089. this.totalDosageRecord = response.data.total
  1090. }
  1091. setTimeout(() => {
  1092. this.listLoadingDosageRecord = false
  1093. }, 100)
  1094. })
  1095. }
  1096. }
  1097. }
  1098. </script>