69bc4360c9242ded401451c4854c181d46229bd8.svn-base 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <div class="app-history" style="height: 550px;overflow-y: auto;overflow-x: hidden;">
  3. <div ref="template" class="template">
  4. <div class="recipeTemplate">
  5. <p>配方模板表</p>
  6. </div>
  7. <div class="search">
  8. <el-select v-model="table.getdataListParm.parammaps.ccname" filterable placeholder="牲畜类别" class="filter-item" clearable>
  9. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
  10. </el-select>
  11. <el-select v-model="table.getdataListParm.parammaps.fttype" filterable placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
  12. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
  13. </el-select>
  14. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
  15. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
  16. </el-select>
  17. <div ref="selectInput" class="filter-item selectInput">
  18. <el-input type="text" placeholder="请点击选择搜索条件" class="Input" />
  19. <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  20. <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  21. <ul v-if="arrowUp" class="selectUl">
  22. <li><a>配方名称</a><el-input v-model="table.getdataListParm.parammaps.tname" style="width: 245px;" /></li>
  23. <li><a>备注</a><el-input v-model="table.getdataListParm.parammaps.remark" style="width: 245px;" /></li>
  24. <li><a>来源</a><el-input v-model="table.getdataListParm.parammaps.source" style="width: 245px;" /></li>
  25. <li>
  26. <div style="float: right;">
  27. <el-button class="minCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
  28. <el-button class="miniPrimary" @click="handleSearch">搜索</el-button>
  29. </div>
  30. </li>
  31. </ul>
  32. </div>
  33. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  34. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  35. </div>
  36. <div class="table">
  37. <el-table
  38. :key="table.tableKey"
  39. v-loading="table.listLoading"
  40. element-loading-text="给我一点时间"
  41. :data="table.list"
  42. border
  43. fit
  44. highlight-current-row
  45. style="width: 98%;"
  46. :row-style="rowStyle"
  47. :cell-style="cellStyle"
  48. class="elTable table-fixed"
  49. @row-click="tableRowClick"
  50. @selection-change="handleSelectionChange"
  51. >
  52. <el-table-column type="selection" align="center" width="50" />
  53. <el-table-column label="序号" align="center" type="index" width="50px">
  54. <template slot-scope="scope">
  55. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="配方名称" min-width="110px" align="center">
  59. <template slot-scope="scope">
  60. <span v-if="scope.row.NoEdit">{{ scope.row.tname }}</span>
  61. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="配方颜色" min-width="85px" align="center">
  65. <template slot-scope="scope">
  66. <el-color-picker v-model="scope.row.tcolor" size="mini" :disabled="scope.row.NoEdit" style="margin:10px 0;" />
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="牲畜类别" min-width="130px" align="center">
  70. <template slot-scope="scope">
  71. <span v-if="scope.row.NoEdit">{{ scope.row.ccname }}</span>
  72. <el-select v-if="scope.row.Edit" v-model="scope.row.ccid" filterable placeholder="牲畜类别" class="filter-item" style="width:95%;padding:10px 0;" @change="changeLivestockType">
  73. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
  74. </el-select>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="配方类型" min-width="130px" align="center">
  78. <template slot-scope="scope">
  79. <span v-if="scope.row.NoEdit">{{ scope.row.fttype }}</span>
  80. <el-select v-if="scope.row.Edit && scope.row.isCreate == true" v-model="scope.row.fttypeid" filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
  81. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
  82. </el-select>
  83. <el-select v-if="scope.row.Edit && scope.row.isUpdateSave == true" v-model="scope.row.fttypeid" disabled filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
  84. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
  85. </el-select>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="来源" min-width="90px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.source }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="备注" min-width="90px" align="center">
  94. <template slot-scope="scope">
  95. <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
  96. <el-input v-if="scope.row.Edit" v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" style="width:95%;padding:10px 0;" />
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="版本号" min-width="90px" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.source }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="版本时间" min-width="90px" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.source }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="是否启用" min-width="90px" align="center">
  110. <template slot-scope="scope">
  111. <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. </div>
  116. </div>
  117. <!-- 配方详情表 -->
  118. <div v-if="isDetail" id="detail" ref="detail" class="detail" style="margin-top: 30px;">
  119. <div class="recipeTemplate">
  120. <p>配方详情表</p>
  121. </div>
  122. <div class="operation">
  123. <div ref="selectInput2" class="filter-item selectInput" style="margin: 0 10px;">
  124. <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  125. <i v-if="arrowDown2" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  126. <i v-if="arrowUp2" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  127. <ul v-if="arrowUp2" class="selectUl" style="width: 400px;">
  128. <li>
  129. <a style="width: 130px;">饲料名称</a>
  130. <el-select v-model="table2.getdataListParm.parammaps.fname" filterable placeholder="" style="width:245px;">
  131. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.fname" />
  132. </el-select>
  133. </li>
  134. <li><a style="width: 130px;">饲料组名称</a><el-input v-model="table2.getdataListParm.parammaps.feedgroup" style="width: 245px;" /></li>
  135. <li><a style="width: 130px;">重量</a><el-input v-model="table2.getdataListParm.parammaps.fweight" style="width: 245px;" /></li>
  136. <li>
  137. <a style="width: 130px;">搅拌延时</a>
  138. <el-select v-model="table2.getdataListParm.parammaps.autosecondname" filterable placeholder="" style="width:245px;" clearable>
  139. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.name" />
  140. </el-select>
  141. </li>
  142. <li>
  143. <a style="width: 130px;">是否锁定牛头数比例</a>
  144. <el-select v-model="table2.getdataListParm.parammaps.islockcount" placeholder="" style="width:245px;" clearable>
  145. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  146. </el-select>
  147. </li>
  148. <li><a style="width: 130px;">顺序</a><el-input v-model="table2.getdataListParm.parammaps.sort" style="width: 245px;" /></li>
  149. <li>
  150. <div style="float: right;">
  151. <el-button class="minCancel" @click="arrowUp2=false;arrowDown2=true;">取消</el-button>
  152. <el-button class="miniSuccess" @click="handleSearch2">搜索</el-button>
  153. </div>
  154. </li>
  155. </ul>
  156. </div>
  157. <el-button class="successBorder" @click="handleSearch2">查询</el-button>
  158. <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
  159. </div>
  160. <div class="table2" style="min-height: 400px;">
  161. <el-table
  162. id="table2"
  163. ref="table2"
  164. :key="table2.tableKey"
  165. v-loading="table2.listLoading"
  166. element-loading-text="给我一点时间"
  167. :data="table2.list"
  168. border
  169. fit
  170. highlight-current-row
  171. style="width: 98%;"
  172. :row-style="rowStyle"
  173. :cell-style="cellStyle"
  174. class="elTable table-fixed"
  175. row-key="id"
  176. :summary-method="getSummaries"
  177. show-summary
  178. @selection-change="handleSelectionChange2"
  179. >
  180. <el-table-column type="selection" width="60" />
  181. <el-table-column label="序号" align="center" type="index" width="50px" />
  182. <el-table-column label="饲料组" min-width="110px" align="center">
  183. <template slot-scope="scope">
  184. <span v-if="scope.row.groupNoEdit">{{ scope.row.feedgroup }}</span>
  185. <el-input v-if="scope.row.groupEdit" v-model="scope.row.feedgroup" :disabled="scope.row.isGroupDisabled" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="饲料名称" min-width="130px" align="center">
  189. <template slot-scope="scope">
  190. <span v-if="scope.row.NoEdit">{{ scope.row.fname }}</span>
  191. <el-select v-if="scope.row.Edit" v-model="scope.row.fid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFname(value, scope.row)}">
  192. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
  193. </el-select>
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="重量(KG)" prop="fweight" min-width="100px" align="center">
  197. <template slot-scope="scope">
  198. <span v-if="scope.row.NoEdit">{{ scope.row.fweight }}</span>
  199. <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.01" type="number" style="width:95%;padding:10px 0;" />
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="搅拌延时(min)" min-width="110px" align="center">
  203. <template slot-scope="scope">
  204. <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
  205. <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
  206. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.id" />
  207. </el-select>
  208. </template>
  209. </el-table-column>
  210. <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="110px" align="center">
  211. <template slot-scope="scope">
  212. <span v-if="scope.row.NoEdit && scope.row.islockcount == '0'">否</span>
  213. <span v-if="scope.row.NoEdit && scope.row.islockcount == '1'">是</span>
  214. <el-select v-if="scope.row.Edit" v-model="scope.row.islockcount" placeholder="" class="filter-item" style="width:95%;padding:10px 0;">
  215. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  216. </el-select>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="顺序" min-width="100px" align="center">
  220. <template slot-scope="scope">
  221. <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
  222. <el-input v-if="scope.row.Edit" v-model="scope.row.sort" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" @blur="blurSort(scope.row)" />
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. </div>
  227. </div>
  228. </div>
  229. </template>
  230. <script>
  231. import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig, formatNum } from '@/api/common'
  232. import Sortable from 'sortablejs'
  233. import { MessageBox } from 'element-ui'
  234. import Cookies from 'js-cookie'
  235. import { json2excel } from '@/utils/index.js'
  236. import { getToken } from '@/utils/auth'
  237. export default {
  238. name: 'HistoryRecord',
  239. data() {
  240. return {
  241. requestParams: [
  242. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] },
  243. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
  244. { name: 'getFeedAndPre', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  245. ],
  246. enableList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否启用
  247. lockBullsList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否锁定牛头数比例
  248. livestockTypeList: [], // 牲畜类别
  249. formulaTypeList: [], // 配方类型
  250. feedNameList: [], // 饲料名称
  251. mixingDelayList: [{ id: '0', name: '0' }, { id: '1', name: '1' }, { id: '2', name: '2' }, { id: '3', name: '3' }, { id: '4', name: '4' }, { id: '5', name: '5' }, { id: '6', name: '6' }, { id: '7', name: '7' }, { id: '8', name: '8' }, { id: '9', name: '9' }, { id: '10', name: '10' }, { id: '11', name: '11' }, { id: '12', name: '12' }, { id: '13', name: '13' }, { id: '14', name: '14' }, { id: '15', name: '15' }], // 搅拌延时
  252. selectHistoryTimeList: [{ id: 0, name: '2020-06-10' }, { id: 1, name: '2020-06-11' }, { id: 2, name: '2020-06-12' }, { id: 3, name: '2020-06-13' }], // 请选择历史记录时间
  253. sourceList: [{ id: 0, name: '自定义' }, { id: 1, name: '集团下发' }, { id: 2, name: '导入' }], // 导入
  254. arrowDown: true,
  255. arrowUp: false,
  256. table: {
  257. getdataListParm: {
  258. name: 'getFTList',
  259. page: 1,
  260. offset: 1,
  261. pagecount: 30,
  262. returntype: 'Map',
  263. parammaps: {
  264. pastureid: Cookies.get('pastureid'),
  265. tname: '',
  266. ccid: '',
  267. ccname: '',
  268. fttypeid: '',
  269. fttype: '',
  270. remark: '',
  271. enable: ''
  272. }
  273. },
  274. tableKey: 0,
  275. list: [],
  276. total: 0,
  277. listLoading: true,
  278. temp: {}
  279. },
  280. lockCount: {
  281. getdataListParm: {
  282. name: 'getSysoptEnable',
  283. page: 1,
  284. offset: 1,
  285. pagecount: 30,
  286. returntype: 'Map',
  287. parammaps: {
  288. pastureid: Cookies.get('pastureid'),
  289. inforname: 'isLockCount'
  290. }
  291. },
  292. isLockCount: false // 是否显示是否锁定牛头数比例
  293. },
  294. isDetail: false,
  295. arrowDown2: true,
  296. arrowUp2: false,
  297. table2: {
  298. getdataListParm: {
  299. name: 'getFTdetailList',
  300. page: 1,
  301. offset: 1,
  302. pagecount: 10,
  303. returntype: 'Map',
  304. parammaps: {
  305. pastureid: Cookies.get('pastureid'),
  306. fname: '',
  307. feedgroup: '',
  308. fweight: '',
  309. autosecondname: '',
  310. islockcount: '',
  311. sort: ''
  312. }
  313. },
  314. tableKey: 0,
  315. list: [],
  316. total: 0,
  317. listLoading: true,
  318. temp: {}
  319. },
  320. isDetailDialog: false,
  321. detail: {
  322. dialogFormVisible: false,
  323. dialogStatus: '',
  324. tableKey: 0,
  325. total: 0,
  326. listLoading: true,
  327. list: [],
  328. tableKey2: 0,
  329. total2: 0,
  330. listLoading2: false,
  331. list2: [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }],
  332. getdataListParm: {
  333. name: 'getFTDetailCompare',
  334. page: 1,
  335. offset: 1,
  336. pagecount: 10,
  337. returntype: 'Map',
  338. parammaps: {}
  339. },
  340. list3: [],
  341. disabled: false,
  342. getdataListParm2: {
  343. name: 'getFTCompare',
  344. page: 1,
  345. offset: 1,
  346. pagecount: 10,
  347. returntype: 'Map',
  348. parammaps: {}
  349. }
  350. },
  351. selectList: [],
  352. selectList2: [],
  353. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  354. cellStyle: { padding: 0 + 'px' }
  355. }
  356. },
  357. mounted() {
  358. document.addEventListener('click', (e) => {
  359. if (this.$refs.selectInput !== undefined) {
  360. if (!this.$refs.selectInput.contains(e.target)) {
  361. this.arrowDown = true
  362. this.arrowUp = false
  363. } else {
  364. this.arrowDown = false
  365. this.arrowUp = true
  366. }
  367. }
  368. if (this.$refs.selectInput2 !== undefined) {
  369. if (!this.$refs.selectInput2.contains(e.target)) {
  370. this.arrowDown2 = true
  371. this.arrowUp2 = false
  372. } else {
  373. this.arrowDown2 = false
  374. this.arrowUp2 = true
  375. }
  376. }
  377. })
  378. },
  379. created() {
  380. this.getList()
  381. this.getDownList()
  382. this.getIsLockCount()
  383. },
  384. methods: {
  385. getSummaries(param) {
  386. console.log(param, '====')
  387. const { columns, data } = param
  388. const sums = []
  389. columns.forEach((column, index) => {
  390. if (index === 0) {
  391. sums[index] = '总价'
  392. return
  393. }
  394. const values = data.map(item => Number(item[column.property]))
  395. if (!values.every(value => isNaN(value))) {
  396. sums[index] = values.reduce((prev, curr) => {
  397. const value = Number(curr)
  398. if (!isNaN(value)) {
  399. return prev + curr
  400. } else {
  401. return prev
  402. }
  403. }, 0)
  404. sums[index] += '(干物质量:是待发值)'
  405. // 后台待发
  406. // sums[index] += '(干物质量:' + param.data[0].feedgroup + ')'
  407. } else {
  408. sums[index] = ''
  409. }
  410. })
  411. return sums
  412. },
  413. getDownList() {
  414. GetDataByNames(this.requestParams).then(response => {
  415. this.livestockTypeList = response.data.getDictByName.list
  416. this.formulaTypeList = response.data.getDictByName2.list
  417. this.feedNameList = response.data.getFeedAndPre.list
  418. })
  419. },
  420. // -------------------模板-----------------------------
  421. getList() {
  422. this.table.listLoading = true
  423. GetDataByName(this.table.getdataListParm).then(response => {
  424. console.log('table数据', response.data.list)
  425. if (response.data.list !== null) {
  426. for (let i = 0; i < response.data.list.length; i++) {
  427. this.$set(response.data.list[i], 'Edit', false) // 编辑
  428. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  429. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  430. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  431. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  432. }
  433. this.table.list = response.data.list
  434. this.table.pageNum = response.data.pageNum
  435. this.table.pageSize = response.data.pageSize
  436. this.table.total = response.data.total
  437. } else {
  438. this.table.list = []
  439. }
  440. setTimeout(() => {
  441. this.table.listLoading = false
  442. }, 100)
  443. })
  444. },
  445. handleSearch() {
  446. console.log('点击了查询')
  447. this.table.getdataListParm.offset = 1
  448. this.getList()
  449. this.arrowDown = true
  450. this.arrowUp = false
  451. },
  452. handleRefresh() {
  453. console.log('点击了重置')
  454. this.table.getdataListParm.offset = 1
  455. this.table.getdataListParm.parammaps.ccid = ''
  456. this.table.getdataListParm.parammaps.ccname = ''
  457. this.table.getdataListParm.parammaps.fttype = ''
  458. this.table.getdataListParm.parammaps.tname = ''
  459. this.table.getdataListParm.parammaps.remark = ''
  460. this.table.getdataListParm.parammaps.enable = ''
  461. this.table.getdataListParm.parammaps.source = ''
  462. this.getList()
  463. },
  464. handleSelectionChange(val) {
  465. console.log('勾选数据', val)
  466. this.selectList = val
  467. },
  468. // 模板行点击
  469. tableRowClick(row, column, event) {
  470. console.log(row, column, event)
  471. for (let i = 0; i < this.table.list.length; i++) {
  472. if (this.table.list[i].Edit == true) {
  473. return false
  474. }
  475. }
  476. if (column.label !== '操作') {
  477. this.isDetail = true // 点击行显示详情
  478. this.table2.getdataListParm.parammaps.ftid = row.id
  479. this.table2.getdataListParm.parammaps.fttypeid = row.fttypeid
  480. this.getList2()
  481. this.getDownList()
  482. }
  483. },
  484. // -------------------详情-----------------------------
  485. // 获取是否显示是否锁定牛头数
  486. getIsLockCount() {
  487. GetDataByName(this.lockCount.getdataListParm).then(response => {
  488. console.log(response.data.list)
  489. if (response.data.list[0].inforvalue == 0) {
  490. this.lockCount.isLockCount = false
  491. } else {
  492. this.lockCount.isLockCount = true
  493. }
  494. })
  495. },
  496. // 详情
  497. getList2() {
  498. this.table2.listLoading = true
  499. GetDataByName(this.table2.getdataListParm).then(response => {
  500. console.log('table数据', response.data.list)
  501. if (response.data.list !== null) {
  502. for (let i = 0; i < response.data.list.length; i++) {
  503. this.$set(response.data.list[i], 'Edit', false) // 编辑
  504. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  505. this.$set(response.data.list[i], 'groupEdit', false) // 饲料组编辑
  506. this.$set(response.data.list[i], 'isGroupDisabled', false) // 饲料组编辑禁止编辑
  507. this.$set(response.data.list[i], 'groupNoEdit', true) // 饲料组不可编辑
  508. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  509. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  510. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  511. }
  512. this.table2.list = response.data.list
  513. this.table2.pageNum = response.data.pageNum
  514. this.table2.pageSize = response.data.pageSize
  515. this.table2.total = response.data.total
  516. } else {
  517. this.table2.list = []
  518. }
  519. this.$nextTick(function() {
  520. document.querySelector('#detail').scrollIntoView()
  521. })
  522. setTimeout(() => {
  523. this.table2.listLoading = false
  524. }, 100)
  525. })
  526. },
  527. handleSearch2() {
  528. console.log('点击了查询')
  529. this.arrowDown2 = true
  530. this.arrowUp2 = false
  531. this.table2.getdataListParm.offset = 1
  532. this.getList2()
  533. },
  534. handleRefresh2() {
  535. console.log('点击了重置')
  536. this.table2.getdataListParm.parammaps.fname = ''
  537. this.table2.getdataListParm.parammaps.feedgroup = ''
  538. this.table2.getdataListParm.parammaps.fweight = ''
  539. this.table2.getdataListParm.parammaps.autosecondname = ''
  540. this.table2.getdataListParm.parammaps.islockcount = '0'
  541. this.table2.getdataListParm.parammaps.sort = ''
  542. this.table2.getdataListParm.offset = 1
  543. this.getList2()
  544. },
  545. handleSelectionChange2(val) {
  546. console.log('勾选数据', val)
  547. this.selectList2 = val
  548. }
  549. }
  550. }
  551. </script>
  552. <style lang="scss" scoped>
  553. .search{margin-top:10px;}
  554. .table{margin-top:10px;}
  555. .table2{margin-top:10px;}
  556. $width:350px;
  557. $left:325px;
  558. .selectInput{
  559. position: relative;
  560. display: inline-block;
  561. .Input{width: $width;position: relative;}
  562. .el-icon-arrow-down{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  563. .el-icon-arrow-up{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  564. .selectUl{
  565. z-index: 111;width: $width;background: #fff;border: 1px solid #E4E7ED;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);margin: -1px 0 0 0;padding: 6px 0; margin: 0;box-sizing: border-box;position: absolute;
  566. li{
  567. list-style: none;font-size: 14px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #606266; height: 50px; line-height: 50px; box-sizing: border-box; cursor: pointer;
  568. a{float:left;width: 80px;}
  569. a:hover{color: rgba(0, 204, 102, 0.71); font-weight: 700;}
  570. }
  571. }
  572. }
  573. .template{
  574. background: #fff;
  575. position: relative;
  576. }
  577. .detail{
  578. background: #fff;
  579. position: relative;
  580. }
  581. .templateDialog{
  582. background: #fff;
  583. position: relative;
  584. }
  585. .detailDialog{
  586. background: #fff;
  587. position: relative;
  588. }
  589. </style>