6caac54368955e8205a9aaa2b2df504fab65cbbe.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button class="success" @click="handleFormulaDistribution">配方下发</el-button>
  5. </div>
  6. <div class="search">
  7. <el-input v-model="table.getdataListParm.parammaps.fname" placeholder="配方名称" style="width: 180px;" class="filter-item" clearable />
  8. <el-select v-model="table.getdataListParm.parammaps.ccname" placeholder="牲畜类别" class="filter-item" style="width: 120px;" clearable>
  9. <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.classname" />
  10. </el-select>
  11. <el-select v-model="table.getdataListParm.parammaps.fttype" placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
  12. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
  13. </el-select>
  14. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  15. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  16. </div>
  17. <div class="table">
  18. <el-table
  19. :key="table.tableKey"
  20. v-loading="table.listLoading"
  21. element-loading-text="给我一点时间"
  22. :data="table.list"
  23. border
  24. fit
  25. highlight-current-row
  26. style="width: 100%;"
  27. :row-style="rowStyle"
  28. :cell-style="cellStyle"
  29. class="elTable table-fixed"
  30. >
  31. <el-table-column label="序号" align="center" type="index" width="50px">
  32. <template slot-scope="scope">
  33. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="配方名称" min-width="130px" align="center" prop="tname" />
  37. <el-table-column label="牲畜类别" min-width="130px" align="center" prop="ccname" />
  38. <el-table-column label="配方类型" min-width="130px" align="center" prop="fttype" />
  39. <el-table-column label="是否为当前配方" min-width="130px" align="center">
  40. <template slot-scope="scope">
  41. <span v-if="scope.row.isissue == 0">否</span>
  42. <span v-else>是</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="已下发牧场" min-width="130px" align="center" prop="grouppastures" />
  46. <el-table-column label="备注" min-width="130px" align="center" prop="remark" />
  47. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  48. <template slot-scope="{row}">
  49. <el-button class="miniPrimary" @click="handleSee(row)">查看</el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  54. </div>
  55. <!-- 配方下发 -->
  56. <el-dialog :title="textMap[formulaDistribution.dialogStatus]" :visible.sync="formulaDistribution.dialogFormVisible" :close-on-click-modal="false" width="70%">
  57. <div class="app-formulaDistribution">
  58. <h4>请选择下发配方:</h4>
  59. <div class="table">
  60. <el-table
  61. :key="formulaDistribution.table.tableKey"
  62. v-loading="formulaDistribution.table.listLoading"
  63. element-loading-text="给我一点时间"
  64. :data="formulaDistribution.table.list"
  65. border
  66. fit
  67. highlight-current-row
  68. style="width: 100%;"
  69. :row-style="rowStyle"
  70. :cell-style="cellStyle"
  71. class="elTable table-fixed"
  72. @selection-change="handleSelectionChange"
  73. >
  74. <el-table-column type="selection" width="55" />
  75. <el-table-column label="序号" align="center" type="index" width="50px" />
  76. <el-table-column label="配方名称" min-width="130px" align="center" prop="tname" />
  77. <el-table-column label="牲畜类别" min-width="130px" align="center" prop="ccname" />
  78. <el-table-column label="配方类型" min-width="130px" align="center" prop="fttype" />
  79. <el-table-column label="备注" min-width="130px" align="center" prop="remark" />
  80. <el-table-column label="是否启用" min-width="110px" align="center">
  81. <template slot-scope="scope">
  82. <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. </div>
  87. </div>
  88. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  89. <el-button class="cancelClose" @click="formulaDistribution.dialogFormVisible = false; ">关闭</el-button>
  90. <el-button class="success" :disabled="isokDisable" @click="nextData()">下一步</el-button>
  91. </div>
  92. </el-dialog>
  93. <!-- 牧场 -->
  94. <el-dialog :title="textMap[formulaDistribution.pasture.dialogStatus]" :visible.sync="formulaDistribution.pasture.dialogFormVisible" :close-on-click-modal="false" width="40%">
  95. <div class="app-pasture">
  96. <h4>选择下发牧场:</h4>
  97. <el-checkbox v-model="formulaDistribution.pasture.checkAll" :indeterminate="formulaDistribution.pasture.isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
  98. <div style="margin: 15px 0;" />
  99. <el-checkbox-group v-model="formulaDistribution.pasture.checkedList" @change="handlePastureChange">
  100. <el-checkbox v-for="item in formulaDistribution.pasture.list" :key="item.id" :label="item" :value="item.id">{{ item.pasturename }}</el-checkbox>
  101. </el-checkbox-group>
  102. </div>
  103. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  104. <el-button class="cancelClose" @click="formulaDistribution.pasture.dialogFormVisible = false; ">关闭</el-button>
  105. <el-button class="success" :disabled="isokDisable" @click="formulaDistributionData()">确认</el-button>
  106. </div>
  107. </el-dialog>
  108. <!-- 查看 -->
  109. <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="70%">
  110. <div class="app-see">
  111. <el-tabs v-model="see.activeName" @tab-click="handleSeeTabClick">
  112. <el-tab-pane label="下发记录" name="first">
  113. <div class="search">
  114. <el-select v-model="see.tab1.table.getdataListParm.parammaps.pasturename" placeholder="牧场" class="filter-item" style="width: 120px;" clearable>
  115. <el-option v-for="item in formulaDistribution.pasture.list" :key="item.id" :label="item.pasturename" :value="item.pasturename" />
  116. </el-select>
  117. <el-button class="successBorder" @click="handleSeeTab1Search">查询</el-button>
  118. </div>
  119. <div class="table">
  120. <el-table
  121. :key="see.tab1.table.tableKey"
  122. v-loading="see.tab1.table.listLoading"
  123. element-loading-text="给我一点时间"
  124. :data="see.tab1.table.list"
  125. border
  126. fit
  127. highlight-current-row
  128. style="width: 100%;"
  129. :row-style="rowStyle"
  130. :cell-style="cellStyle"
  131. class="elTable table-fixed"
  132. @row-click="handleSeeTab1RowClick"
  133. >
  134. <el-table-column label="序号" align="center" type="index" width="50px">
  135. <template slot-scope="scope">
  136. <span>{{ scope.$index + (see.tab1.table.pageNum-1) * see.tab1.table.pageSize + 1 }}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="牧场" min-width="130px" align="center" prop="pasturename" />
  140. <el-table-column label="下发时间" min-width="130px" align="center" prop="date" />
  141. </el-table>
  142. </div>
  143. <pagination v-show="see.tab1.table.total>0" :total="see.tab1.table.total" :page.sync="see.tab1.table.getdataListParm.offset" :limit.sync="see.tab1.table.getdataListParm.pagecount" @pagination="getSeeTab1List" />
  144. </el-tab-pane>
  145. <el-tab-pane label="使用情况" name="second">
  146. <div class="search">
  147. <el-autocomplete v-model="see.tab2.table.getdataListParm.parammaps.date" value-key="date" class="inline-input filter-item" :fetch-suggestions="dateSearch" placeholder="日期" style="width:250px" @select="handleSelectDate">
  148. <template slot-scope="{ item }">
  149. <span>{{ item.date }}</span>
  150. </template>
  151. </el-autocomplete>
  152. <el-button class="successBorder" @click="handleSeeTab2Search">查询</el-button>
  153. </div>
  154. <div class="table">
  155. <el-table
  156. id="table"
  157. :key="see.tab2.table.tableKey"
  158. ref="table"
  159. v-loading="see.tab2.table.listLoading"
  160. element-loading-text="给我一点时间"
  161. :data="see.tab2.table.list"
  162. border
  163. highlight-current-row
  164. style="width: 100%;"
  165. :height="height"
  166. :row-style="rowStyle"
  167. :cell-style="cellStyle"
  168. class="elTable table-fixed"
  169. row-key="id"
  170. :show-header="false"
  171. >
  172. <el-table-column label="1" width="100px" align="center" prop="pasturename" />
  173. <el-table-column label="1" width="120px" align="center" prop="tname" />
  174. <el-table-column label="1" width="130px" align="center" prop="datestr" />
  175. <el-table-column label="1" min-width="800px" align="center">
  176. <template slot-scope="scope">
  177. <div v-for="element in scope.row.arrList" :key="element.concatname" class="list-group-item2 item" style="width: 100px;float: left;margin: 5px 5px;padding: 0;height: 30px;">
  178. <el-tooltip placement="top">
  179. <div slot="content">{{ element.concatname }}</div>
  180. <span :style="{'color':element.color}" style="display: block;height:30px;line-height: 30px;">
  181. {{ element.concatname }}
  182. </span>
  183. </el-tooltip>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. </el-table>
  188. </div>
  189. </el-tab-pane>
  190. </el-tabs>
  191. </div>
  192. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  193. <el-button class="cancelClose" @click="see.dialogFormVisible = false; ">关闭</el-button>
  194. </div>
  195. </el-dialog>
  196. </div>
  197. </template>
  198. <script>
  199. import { GetDataByName, GetDataByNames, GetArrList, ExecDataByConfig } from '@/api/common'
  200. import Pagination from '@/components/Pagination'
  201. import { parseTime } from '@/utils/index.js'
  202. import Cookies from 'js-cookie'
  203. export default {
  204. name: 'FormulaDistribution',
  205. components: { Pagination },
  206. data() {
  207. return {
  208. formulaTypeList: '',
  209. livestockList: '',
  210. requestParams: [
  211. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
  212. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
  213. ],
  214. table: {
  215. getdataListParm: {
  216. name: 'getFTListXF',
  217. page: 1,
  218. offset: 1,
  219. pagecount: 10,
  220. returntype: 'Map',
  221. parammaps: {
  222. pastureid: Cookies.get('pastureid'),
  223. tname: '',
  224. ccname: '',
  225. fttype: '',
  226. remark: ''
  227. }
  228. },
  229. tableKey: 0,
  230. list: [],
  231. total: 0,
  232. listLoading: true
  233. },
  234. formulaDistribution: {
  235. dialogFormVisible: false,
  236. dialogStatus: '',
  237. table: {
  238. getdataListParm: {
  239. name: 'getFTListXF',
  240. page: 1,
  241. offset: 1,
  242. pagecount: 0,
  243. returntype: 'Map',
  244. parammaps: {
  245. pastureid: Cookies.get('pastureid')
  246. }
  247. },
  248. tableKey: 1,
  249. list: [],
  250. total: 0,
  251. listLoading: true
  252. },
  253. selectList: [],
  254. pasture: {
  255. dialogFormVisible: false,
  256. dialogStatus: '',
  257. getdataListParm: {
  258. name: 'getgroupsPasture',
  259. page: 1,
  260. offset: 1,
  261. pagecount: 0,
  262. returntype: 'Map',
  263. parammaps: {
  264. pastureid: Cookies.get('pastureid')
  265. }
  266. },
  267. total: 0,
  268. listLoading: true,
  269. // 牧场
  270. checkAll: false,
  271. checkedList: [],
  272. list: [],
  273. isIndeterminate: false
  274. }
  275. },
  276. see: {
  277. dialogFormVisible: false,
  278. dialogStatus: '',
  279. activeName: 'first',
  280. temp: {},
  281. tab1: {
  282. table: {
  283. getdataListParm: {
  284. name: 'getFTListXFhis',
  285. page: 1,
  286. offset: 1,
  287. pagecount: 10,
  288. returntype: 'Map',
  289. parammaps: {
  290. pastureid: '',
  291. ftid: '',
  292. pasturename: ''
  293. }
  294. },
  295. tableKey: 2,
  296. list: [],
  297. total: 0,
  298. listLoading: true
  299. }
  300. },
  301. tab2: {
  302. table: {
  303. getdataListParm: {
  304. name: 'getFTusageList',
  305. name1: 'getFTdusageList',
  306. page: 1,
  307. offset: 1,
  308. pagecount: 0,
  309. returntype: 'Map',
  310. parammaps: {
  311. pastureid: Cookies.get('pastureid'),
  312. date: ''
  313. }
  314. },
  315. tableKey: 3,
  316. list: [],
  317. total: 0,
  318. listLoading: true
  319. },
  320. date: {
  321. getdataListParm: {
  322. name: 'getFTListXFhisTime',
  323. page: 1,
  324. offset: 1,
  325. pagecount: 10,
  326. returntype: 'Map',
  327. parammaps: {
  328. pastureid: Cookies.get('pastureid'),
  329. date: ''
  330. }
  331. },
  332. list: []
  333. }
  334. }
  335. },
  336. textMap: {
  337. formulaDistribution: '配方下发',
  338. see: '查看',
  339. pasture: '配方下发'
  340. },
  341. requestParam: {},
  342. isokDisable: false,
  343. height: document.body.clientHeight,
  344. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  345. cellStyle: { padding: 0 + 'px' }
  346. }
  347. },
  348. created() {
  349. this.getDownList()
  350. this.getList()
  351. },
  352. methods: {
  353. getDownList() {
  354. GetDataByNames(this.requestParams).then(response => {
  355. console.log(response)
  356. this.livestockList = response.data.getCowclassListEnable.list
  357. this.formulaTypeList = response.data.getDictByName2.list
  358. })
  359. },
  360. getList() {
  361. this.table.listLoading = true
  362. GetDataByName(this.table.getdataListParm).then(response => {
  363. console.log('table数据', response.data.list)
  364. if (response.data.list !== null) {
  365. this.table.list = response.data.list
  366. this.table.pageNum = response.data.pageNum
  367. this.table.pageSize = response.data.pageSize
  368. this.table.total = response.data.total
  369. } else {
  370. this.table.list = []
  371. }
  372. setTimeout(() => {
  373. this.table.listLoading = false
  374. }, 100)
  375. })
  376. },
  377. handleSearch() {
  378. this.table.getdataListParm.offset = 1
  379. this.getList()
  380. },
  381. handleRefresh() {
  382. this.table.getdataListParm.parammaps.tname = ''
  383. this.table.getdataListParm.parammaps.ccname = ''
  384. this.table.getdataListParm.parammaps.fttype = ''
  385. this.table.getdataListParm.parammaps.remark = ''
  386. },
  387. // 配方下发
  388. handleFormulaDistribution() {
  389. this.formulaDistribution.dialogStatus = 'formulaDistribution'
  390. this.formulaDistribution.dialogFormVisible = true
  391. this.getFormulaDistributionList()
  392. },
  393. handleSelectionChange(item) {
  394. this.formulaDistribution.selectList = item
  395. },
  396. getFormulaDistributionList() {
  397. this.formulaDistribution.table.listLoading = true
  398. GetDataByName(this.formulaDistribution.table.getdataListParm).then(response => {
  399. console.log('table数据', response.data.list)
  400. if (response.data.list !== null) {
  401. this.formulaDistribution.table.list = response.data.list
  402. } else {
  403. this.formulaDistribution.table.list = []
  404. }
  405. setTimeout(() => {
  406. this.formulaDistribution.table.listLoading = false
  407. }, 100)
  408. })
  409. },
  410. nextData() {
  411. if (this.formulaDistribution.selectList.length == 0) {
  412. this.$message({ type: 'error', message: '请选择下发配方', duration: 2000 })
  413. return false
  414. } else {
  415. for (let i = 0; i < this.formulaDistribution.selectList.length; i++) {
  416. if (this.formulaDistribution.selectList[i].enable == 0) {
  417. this.$message({ type: 'error', message: '配方未启用不可下发', duration: 2000 })
  418. return false
  419. }
  420. }
  421. this.formulaDistribution.pasture.dialogStatus = 'pasture'
  422. this.formulaDistribution.pasture.dialogFormVisible = true
  423. this.getPastureList()
  424. }
  425. },
  426. getPastureList() {
  427. GetDataByName(this.formulaDistribution.pasture.getdataListParm).then(response => {
  428. if (response.data.list !== null) {
  429. this.formulaDistribution.pasture.list = response.data.list
  430. } else {
  431. this.formulaDistribution.pasture.list = []
  432. }
  433. })
  434. },
  435. handleCheckAllChange(val) {
  436. this.formulaDistribution.pasture.checkedList = val ? this.formulaDistribution.pasture.list : []
  437. this.formulaDistribution.pasture.isIndeterminate = false
  438. },
  439. handlePastureChange(value) {
  440. const checkedCount = value.length
  441. this.formulaDistribution.pasture.checkAll = checkedCount === this.formulaDistribution.pasture.list.length
  442. this.formulaDistribution.pasture.isIndeterminate = checkedCount > 0 && checkedCount < this.formulaDistribution.pasture.list.length
  443. },
  444. formulaDistributionData() {
  445. if (this.formulaDistribution.pasture.checkedList.length == 0) {
  446. this.$message({ type: 'error', message: '请选择下发牧场', duration: 2000 })
  447. return false
  448. } else {
  449. this.isokDisable = true
  450. setTimeout(() => {
  451. this.isokDisable = false
  452. }, 1000)
  453. this.requestParam.common = { 'returnmap': '0' }
  454. this.requestParam.data = []
  455. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.formulaDistribution.selectList }}
  456. this.requestParam.data[0].children = []
  457. this.requestParam.data[0].children[0] = { 'name': 'insertfeedtemplet_issue', 'type': 'e', 'parammaps': {
  458. pastureid: Cookies.get('pastureid'),
  459. ftid: '@insertSpotList.id'
  460. }}
  461. this.requestParam.data[0].children[1] = { 'name': 'insertftdetail_issue', 'type': 'e', 'parammaps': {
  462. pastureid: Cookies.get('pastureid'),
  463. ftid: '@insertSpotList.id'
  464. }}
  465. this.requestParam.data[1] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.formulaDistribution.pasture.checkedList }}
  466. this.requestParam.data[1].children = []
  467. this.requestParam.data[1].children[0] = { 'name': 'deleteFTissue', 'type': 'e', 'parammaps': {
  468. pastureid: '@insertSpotList2.id',
  469. groupsid: Cookies.get('pastureid')
  470. }}
  471. this.requestParam.data[1].children[1] = { 'name': 'insertfeedtempletISS', 'type': 'e', 'parammaps': {
  472. pastureid: '@insertSpotList2.id',
  473. groupsid: Cookies.get('pastureid')
  474. }}
  475. this.requestParam.data[1].children[2] = { 'name': 'insertftdetailISS', 'type': 'e', 'parammaps': {
  476. pastureid: '@insertSpotList2.id',
  477. groupsid: Cookies.get('pastureid')
  478. }}
  479. this.requestParam.data[1].children[3] = { 'name': 'insertfeedtemplet_pastureISS', 'type': 'e', 'parammaps': {
  480. pastureid: '@insertSpotList2.id',
  481. pasturename: '@insertSpotList2.pasturename',
  482. groupsid: Cookies.get('pastureid')
  483. }}
  484. this.requestParam.data[1].children[4] = { 'name': 'deleteFeedissue', 'type': 'e', 'parammaps': {
  485. pastureid: '@insertSpotList2.id',
  486. groupsid: Cookies.get('pastureid')
  487. }}
  488. this.requestParam.data[1].children[5] = { 'name': 'insertFeedissue', 'type': 'e', 'parammaps': {
  489. pastureid: '@insertSpotList2.id',
  490. groupsid: Cookies.get('pastureid')
  491. }}
  492. this.requestParam.data[1].children[6] = { 'name': 'insertFeednurissue', 'type': 'e', 'parammaps': {
  493. pastureid: '@insertSpotList2.id',
  494. groupsid: Cookies.get('pastureid')
  495. }}
  496. ExecDataByConfig(this.requestParam).then(response => {
  497. console.log('配方下发保存发送参数', this.requestParam)
  498. if (response.msg === 'fail') {
  499. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  500. } else {
  501. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  502. this.formulaDistribution.dialogFormVisible = false
  503. this.formulaDistribution.pasture.dialogFormVisible = false
  504. this.getList()
  505. }
  506. })
  507. }
  508. },
  509. // 查看
  510. handleSee(row) {
  511. this.see.dialogStatus = 'see'
  512. this.see.dialogFormVisible = true
  513. this.see.temp = Object.assign({}, row)
  514. this.see.activeName = 'first'
  515. this.getSeeTab1List()
  516. this.getPastureList()
  517. this.getSeeTab2DateList()
  518. },
  519. getSeeTab1List() {
  520. this.see.tab1.table.listLoading = true
  521. this.see.tab1.table.getdataListParm.parammaps.ftid = this.see.temp.id
  522. this.see.tab1.table.getdataListParm.parammaps.pastureid = this.see.temp.pastureid
  523. GetDataByName(this.see.tab1.table.getdataListParm).then(response => {
  524. console.log('下发记录数据', response.data.list)
  525. if (response.data.list !== null) {
  526. this.see.tab1.table.list = response.data.list
  527. this.see.tab1.table.pageNum = response.data.pageNum
  528. this.see.tab1.table.pageSize = response.data.pageSize
  529. this.see.tab1.table.total = response.data.total
  530. } else {
  531. this.see.tab1.table.list = []
  532. }
  533. setTimeout(() => {
  534. this.see.tab1.table.listLoading = false
  535. }, 100)
  536. })
  537. },
  538. handleSeeTab1Search() {
  539. this.getSeeTab1List()
  540. },
  541. getSeeTab2List() {
  542. this.see.tab2.table.listLoading = true
  543. GetArrList(this.see.tab2.table.getdataListParm).then(response => {
  544. console.log('table数据', response.data.list)
  545. if (response.data.list !== null) {
  546. for (let i = 0; i < response.data.list.length; i++) {
  547. if (response.data.list[i].arrList == null) {
  548. this.$set(response.data.list[i], 'Disabled', false)
  549. this.$set(response.data.list[i], 'arrList', [])
  550. }
  551. }
  552. this.see.tab2.table.list = response.data.list
  553. if (response.data.total) {
  554. this.see.tab2.table.total = response.data.total
  555. }
  556. } else {
  557. this.see.tab2.table.list = []
  558. }
  559. setTimeout(() => {
  560. this.see.tab2.table.listLoading = false
  561. }, 100)
  562. })
  563. },
  564. handleSeeTab2Search() {
  565. if (this.see.tab2.table.getdataListParm.parammaps.date == '') {
  566. this.see.tab2.table.getdataListParm.parammaps.date = this.see.tab2.date.list[0].date
  567. }
  568. this.getSeeTab2List()
  569. },
  570. getSeeTab2DateList() {
  571. GetDataByName(this.see.tab2.date.getdataListParm).then(response => {
  572. console.log('table数据', response.data.list)
  573. if (response.data.list !== null) {
  574. this.see.tab2.date.list = response.data.list
  575. } else {
  576. this.see.tab2.table.list = []
  577. }
  578. })
  579. },
  580. dateSearch(queryString, cb) {
  581. this.see.tab2.date.getdataListParm.parammaps['date'] = queryString
  582. GetDataByName(this.see.tab2.date.getdataListParm).then(response => {
  583. console.log('模糊查询搜索data', response.data.list)
  584. if (response.data.list == null) {
  585. cb([])
  586. } else {
  587. cb(response.data.list)
  588. }
  589. })
  590. },
  591. handleSelectDate(item) {
  592. this.see.tab2.table.getdataListParm.parammaps.date = item.date
  593. },
  594. handleSeeTabClick() {
  595. if (this.see.activeName == 'first') {
  596. this.getSeeTab1List()
  597. } else {
  598. this.see.tab2.table.getdataListParm.parammaps.date = this.see.tab2.date.list[0].date
  599. this.getSeeTab2List()
  600. }
  601. },
  602. handleSeeTab1RowClick(row) {
  603. console.log(row)
  604. this.see.activeName = 'second'
  605. this.see.tab2.table.getdataListParm.parammaps.date = row.date
  606. this.getSeeTab2List()
  607. }
  608. }
  609. }
  610. </script>
  611. <style lang="scss" scoped>
  612. .search { clear: both;margin-top:10px; }
  613. .table { margin-top: 10px; }
  614. </style>