index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <el-select v-model="table.getdataListParm.parammaps.pastureId" filterable
  5. :placeholder="$t('supplier.mc')" class="filter-item" style="width: 150px;" clearable>
  6. <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pastureName" :value="item.pastureid" />
  7. </el-select>
  8. <el-select v-model="table.getdataListParm.parammaps.msgtype"
  9. :placeholder="$t('supplier.sjlx')" class="filter-item" style="width: 150px;" clearable>
  10. <el-option v-for="item in dataTypeList" :key="item.Id" :label="item.value" :value="item.Id" />
  11. </el-select>
  12. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" :range-separator="$t('common.to')" :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" style="width: 250px;" />
  13. <el-button class="successBorder" @click="handleSearch">{{$t('common.query')}}</el-button>
  14. <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
  15. </div>
  16. <div class="table">
  17. <el-table
  18. :key="table.tableKey"
  19. v-loading="table.listLoading"
  20. :element-loading-text="$t('common.tableMsg')"
  21. :data="table.list"
  22. border
  23. fit
  24. highlight-current-row
  25. style="width: 100%;"
  26. :row-style="rowStyle"
  27. :cell-style="cellStyle"
  28. class="elTable table-fixed"
  29. >
  30. <el-table-column :label="$t('feedingEfficiency.mc')"min-width="90px" align="center" prop="pastureName" />
  31. <el-table-column
  32. :label="$t('supplier.sjlx')" min-width="90px" align="center" prop="msgtypeName">
  33. <template slot-scope="scope">
  34. <span >{{scope.row.msgtypeName}}</span>
  35. <!-- <span @click="clickType(scope.row)">{{scope.row.msgtypeName}}</span> -->
  36. </template>
  37. </el-table-column>
  38. <el-table-column
  39. :label="$t('supplier.qqcs')" min-width="120px" align="center">
  40. <template slot-scope="scope">
  41. <el-tooltip placement="top" :open-delay="1000">
  42. <div slot="content">
  43. <div> {{ scope.row.request }} </div>
  44. </div>
  45. <div style="width: 100%;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ scope.row.request }}</div>
  46. </el-tooltip>
  47. </template>
  48. </el-table-column>
  49. <el-table-column
  50. :label="$t('supplier.xycs')" min-width="120px" align="center">
  51. <template slot-scope="scope">
  52. <el-tooltip placement="top" :open-delay="1000">
  53. <div slot="content">
  54. <div> {{ scope.row.response }} </div>
  55. </div>
  56. <div style="width:100%;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ scope.row.response }}</div>
  57. </el-tooltip>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. :label="$t('supplier.fhzt')" min-width="90px" align="center" prop="status" />
  62. <el-table-column
  63. :label="$t('supplier.xxwb')" min-width="90px" align="center" prop="msgtext" />
  64. <el-table-column
  65. :label="$t('supplier.qqdz')" min-width="90px" align="center" prop="url" />
  66. <el-table-column
  67. :label="$t('supplier.cjsj')" min-width="90px" align="center" prop="createTime" />
  68. </el-table>
  69. </div>
  70. <!-- 数据类型 -->
  71. <el-dialog :title="textMap[type.dialogStatus]" :visible.sync="type.dialogFormVisible" :close-on-click-modal="false" width="50%">
  72. <div class="app-type">
  73. <div class="table" v-if="type.temp.msgtypeName == '搅拌'">
  74. <el-table
  75. :key="type.table.tableKey"
  76. v-loading="type.table.listLoading"
  77. :element-loading-text="$t('common.tableMsg')"
  78. :data="type.table.list"
  79. border
  80. fit
  81. highlight-current-row
  82. style="width: 100%;"
  83. :row-style="rowStyle"
  84. :cell-style="cellStyle"
  85. class="elTable table-fixed"
  86. >
  87. <el-table-column :label="$t('formulationEvaluation.xh')" min-width="90px" align="center" prop="pastureName" />
  88. <el-table-column :label="$t('errorAnalysis.date')" min-width="90px" align="center" prop="status" />
  89. <el-table-column :label="$t('errorAnalysis.isTrainNumber')" min-width="90px" align="center" prop="msgtext" />
  90. <el-table-column :label="$t('errorAnalysis.projname')" min-width="90px" align="center" prop="url" />
  91. <el-table-column label="配方" min-width="90px" align="center" prop="createTime" />
  92. <el-table-column label="原料" min-width="90px" align="center" prop="createTime" />
  93. <el-table-column label="原料顺序" min-width="90px" align="center" prop="createTime" />
  94. <el-table-column :label="$t('errorAnalysis.llzl')" min-width="90px" align="center" prop="createTime" />
  95. <el-table-column :label="$t('errorAnalysis.acWeight')" min-width="90px" align="center" prop="createTime" />
  96. <el-table-column :label="$t('errorAnalysis.startTime')" min-width="90px" align="center" prop="createTime" />
  97. <el-table-column :label="$t('errorAnalysis.endTime')" min-width="90px" align="center" prop="createTime" />
  98. <el-table-column :label="$t('errorAnalysis.Driver')" min-width="90px" align="center" prop="createTime" />
  99. <el-table-column label="自拌料-饲料顺序" min-width="90px" align="center" prop="createTime" />
  100. <el-table-column label="自拌料-饲料名称" min-width="90px" align="center" prop="createTime" />
  101. <el-table-column label="自拌料-饲料重量" min-width="90px" align="center" prop="createTime" />
  102. <el-table-column label="实际重量修改记录" min-width="90px" align="center" prop="createTime" />
  103. <el-table-column :label="$t('formulationEvaluation.xgsj')" min-width="90px" align="center" prop="createTime" />
  104. </el-table>
  105. </div>
  106. <div class="table" v-else-if="type.temp.msgtypeName == '配方'">
  107. <el-table
  108. :key="type.table.tableKey"
  109. v-loading="type.table.listLoading"
  110. :element-loading-text="$t('common.tableMsg')"
  111. :data="type.table.list"
  112. border
  113. fit
  114. highlight-current-row
  115. style="width: 100%;"
  116. :row-style="rowStyle"
  117. :cell-style="cellStyle"
  118. class="elTable table-fixed"
  119. >
  120. <el-table-column :label="$t('formulationEvaluation.xh')" min-width="90px" align="center" prop="pastureName" />
  121. <el-table-column :label="$t('errorAnalysis.feedName')" min-width="90px" align="center" prop="status" />
  122. <el-table-column
  123. :label="$t('supplier.ylbm')" min-width="90px" align="center" prop="msgtext" />
  124. <el-table-column
  125. :label="$t('supplier.ylmc')" min-width="90px" align="center" prop="url" />
  126. <el-table-column
  127. :label="$t('supplier.yllx')" min-width="90px" align="center" prop="createTime" />
  128. <el-table-column :label="$t('premixedPlan.weight')" min-width="90px" align="center" prop="createTime" />
  129. <el-table-column :label="$t('formulationEvaluation.sort')" min-width="90px" align="center" prop="createTime" />
  130. <el-table-column
  131. :label="$t('supplier.yxwcc')" min-width="90px" align="center" prop="createTime" />
  132. </el-table>
  133. </div>
  134. <div class="table" v-else-if="type.temp.msgtypeName == '发料'">
  135. <el-table
  136. :key="type.table.tableKey"
  137. v-loading="type.table.listLoading"
  138. :element-loading-text="$t('common.tableMsg')"
  139. :data="type.table.list"
  140. border
  141. fit
  142. highlight-current-row
  143. style="width: 100%;"
  144. :row-style="rowStyle"
  145. :cell-style="cellStyle"
  146. class="elTable table-fixed"
  147. >
  148. <el-table-column :label="$t('formulationEvaluation.xh')" min-width="90px" align="center" prop="pastureName" />
  149. <el-table-column :label="$t('errorAnalysis.date')" min-width="90px" align="center" prop="status" />
  150. <el-table-column :label="$t('errorAnalysis.isTrainNumber')" min-width="90px" align="center" prop="msgtext" />
  151. <el-table-column :label="$t('errorAnalysis.projname')" min-width="90px" align="center" prop="url" />
  152. <el-table-column :label="$t('errorAnalysis.pen')" min-width="90px" align="center" prop="createTime" />
  153. <el-table-column
  154. :label="$t('supplier.ccl')" min-width="90px" align="center" prop="createTime" />
  155. <el-table-column
  156. :label="$t('supplier.flsx')" min-width="90px" align="center" prop="createTime" />
  157. <el-table-column :label="$t('errorAnalysis.llzl')" min-width="90px" align="center" prop="createTime" />
  158. <el-table-column :label="$t('errorAnalysis.acWeight')" min-width="90px" align="center" prop="createTime" />
  159. <el-table-column :label="$t('errorAnalysis.startTime')" min-width="90px" align="center" prop="createTime" />
  160. <el-table-column :label="$t('errorAnalysis.endTime')" min-width="90px" align="center" prop="createTime" />
  161. <el-table-column :label="$t('errorAnalysis.Driver')" min-width="90px" align="center" prop="createTime" />
  162. <el-table-column :label="$t('errorAnalysis.feedName')" min-width="90px" align="center" prop="createTime" />
  163. <el-table-column
  164. :label="$t('supplier.slsx')" min-width="90px" align="center" prop="createTime" />
  165. <el-table-column :label="$t('InventoryManagement.silc')" min-width="90px" align="center" prop="createTime" />
  166. <el-table-column
  167. :label="$t('supplier.wlzl')" min-width="90px" align="center" prop="createTime" />
  168. <el-table-column :label="$t('supplier.zbl1')" min-width="90px" align="center" prop="createTime" />
  169. <el-table-column :label="$t('supplier.zbl2')" min-width="90px" align="center" prop="createTime" />
  170. <el-table-column :label="$t('supplier.zbl3')" min-width="90px" align="center" prop="createTime" />
  171. <el-table-column :label="$t('supplier.sjzljz')"min-width="90px" align="center" prop="createTime" />
  172. <el-table-column :label="$t('formulationEvaluation.xgsj')" min-width="90px" align="center" prop="createTime" />
  173. </el-table>
  174. </div>
  175. <div class="table" v-else>
  176. <el-table
  177. :key="type.table.tableKey"
  178. v-loading="type.table.listLoading"
  179. :element-loading-text="$t('common.tableMsg')"
  180. :data="type.table.list"
  181. border
  182. fit
  183. highlight-current-row
  184. style="width: 100%;"
  185. :row-style="rowStyle"
  186. :cell-style="cellStyle"
  187. class="elTable table-fixed"
  188. >
  189. <el-table-column :label="$t('formulationEvaluation.xh')" min-width="90px" align="center" prop="pastureName" />
  190. <el-table-column :label="$t('errorAnalysis.date')" min-width="90px" align="center" prop="status" />
  191. <el-table-column :label="$t('errorAnalysis.pen')" min-width="90px" align="center" prop="msgtext" />
  192. <el-table-column :label="$t('premixedPlan.weight')" min-width="90px" align="center" prop="url" />
  193. </el-table>
  194. </div>
  195. <span v-if="type.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">{{$t('processAnalysis.total')}}{{ type.table.total }}{{$t('processAnalysis.tiao')}}</span>
  196. <div slot="footer" class="dialog-footer">
  197. <el-button class="cancelClose1" @click="type.dialogFormVisible = false;getList()">{{$t('common.closed')}}</el-button>
  198. </div>
  199. </div>
  200. </el-dialog>
  201. </div>
  202. </template>
  203. <script>
  204. import { GetDataByName,GetDataByNames } from '@/api/common'
  205. import { parseTime } from '@/utils/index.js'
  206. import Cookies from 'js-cookie'
  207. export default {
  208. name: 'SapLog',
  209. data() {
  210. return {
  211. table:{
  212. getdataListParm:{
  213. name: 'getSaplogList',
  214. page: 1,
  215. offset: 1,
  216. pagecount: parseInt(Cookies.get('pageCount')),
  217. returntype: 'Map',
  218. parammaps: {
  219. pastureid: Cookies.get('pastureid'),
  220. startTime:'',
  221. endTime:'',
  222. inputDatetime:''
  223. }
  224. },
  225. tableKey: 0,
  226. list: [],
  227. total: 0,
  228. listLoading: true,
  229. temp: {}
  230. },
  231. requestParams:[
  232. { name: 'getSapPullDown', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  233. { name: 'getPastureList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  234. ],
  235. dataTypeList:[],pastureList:[],
  236. textMap: {
  237. type: '搅拌数据类型详情',
  238. },
  239. type:{
  240. dialogFormVisible: false,
  241. dialogStatus: '',
  242. table:{
  243. tableKey: 0,
  244. list: [],
  245. total: 0,
  246. listLoading: false,
  247. },
  248. temp:{}
  249. },
  250. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  251. cellStyle: { padding: 0 + 'px' },
  252. }
  253. },
  254. created() {
  255. this.getDownList()
  256. this.getList()
  257. },
  258. methods: {
  259. getDownList(){
  260. GetDataByNames(this.requestParams).then(response => {
  261. this.dataTypeList = response.data.getSapPullDown.list
  262. this.pastureList = response.data.getPastureList.list
  263. })
  264. },
  265. getList() {
  266. this.table.listLoading = true
  267. GetDataByName(this.table.getdataListParm).then(response => {
  268. console.log('table数据', response.data.list)
  269. if (response.data.list !== null) {
  270. this.table.list = response.data.list
  271. this.table.pageNum = response.data.pageNum
  272. this.table.pageSize = response.data.pageSize
  273. } else {
  274. this.table.list = []
  275. }
  276. this.table.total = response.data.total
  277. setTimeout(() => {
  278. this.table.listLoading = false
  279. }, 100)
  280. })
  281. },
  282. handleSearch(){
  283. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  284. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  285. this.table.getdataListParm.parammaps.endTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  286. } else {
  287. this.table.getdataListParm.parammaps.inputDatetime = ''
  288. this.table.getdataListParm.parammaps.startTime = ''
  289. this.table.getdataListParm.parammaps.endTime = ''
  290. }
  291. this.table.getdataListParm.offset = 1
  292. this.getList()
  293. },
  294. handleRefresh(){
  295. },
  296. clickType(row){
  297. this.type.temp = Object.assign({},row)
  298. this.type.temp.msgtypeName = '搅拌'
  299. this.type.dialogStatus = 'type'
  300. this.type.dialogFormVisible = true
  301. }
  302. }
  303. }
  304. </script>