902fe382a129808ebafb112eea79ae33db9758e8.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button class="success" @click="handleCreate">新增</el-button>
  5. <el-button class="danger" @click="handleDelete">删除</el-button>
  6. <el-button class="success" @click="handleFeedBank">饲料库</el-button>
  7. </div>
  8. <div class="search">
  9. <el-input v-model="table.getdataListParm.parammaps.assetCode" placeholder="饲料名称" style="width: 130px;" class="filter-item" clearable />
  10. <tree-select
  11. class="filter-item typeSelect"
  12. :height="150"
  13. :width="150"
  14. size="small"
  15. clearable
  16. :data="type.parentDept"
  17. :disabled="type.disabled"
  18. :placeholder="type.placeholder"
  19. style="display:inline-block;"
  20. :default-props="type.defaultProps"
  21. :node-key="type.nodeKey"
  22. :checked-keys="type.defaultCheckedKeys"
  23. @popoverHide="popoverHide"
  24. />
  25. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="饲料来源" class="filter-item" style="width: 120px;" clearable>
  26. <el-option v-for="item in feedSourcesList" :key="item.id" :label="item.name" :value="item.name" />
  27. </el-select>
  28. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
  29. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.name" />
  30. </el-select>
  31. <div ref="selectInput" class="filter-item selectInput">
  32. <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  33. <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  34. <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  35. <ul v-if="arrowUp" class="selectUl">
  36. <li><a>允许误差数</a><el-input type="text" name="" value="" style="width: 245px;" /></li>
  37. <li><a>跳转重量域</a><el-input type="text" name="" value="" style="width: 245px;" /></li>
  38. <li>
  39. <a>跳转延时</a>
  40. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 245px;" clearable>
  41. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.name" />
  42. </el-select>
  43. </li>
  44. <li>
  45. <div style="float: right;">
  46. <el-button class="minCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
  47. <el-button class="miniSuccess" @click="handleSearch">搜索</el-button>
  48. </div>
  49. </li>
  50. </ul>
  51. </div>
  52. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  53. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  54. </div>
  55. <div class="table">
  56. <el-table
  57. :key="table.tableKey"
  58. v-loading="table.listLoading"
  59. element-loading-text="给我一点时间"
  60. :data="table.list"
  61. border
  62. fit
  63. highlight-current-row
  64. style="width: 100%;"
  65. :row-style="rowStyle"
  66. :cell-style="cellStyle"
  67. class="elTable table-fixed"
  68. @selection-change="handleSelectionChange"
  69. >
  70. <el-table-column type="selection" align="center" width="50" />
  71. <el-table-column label="序号" align="center" type="index" width="50px">
  72. <template slot-scope="scope">
  73. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="饲料名称" min-width="130px" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.brandName }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="饲料分类" min-width="130px" align="center">
  82. <template slot-scope="scope">
  83. <span>{{ scope.row.brandName }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="唯一编码" min-width="110px" align="center">
  87. <template slot-scope="scope">
  88. <span>{{ scope.row.brandName }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="饲料来源" min-width="110px" align="center">
  92. <template slot-scope="scope">
  93. <span>{{ scope.row.brandName }}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="计划类型" min-width="110px" align="center">
  97. <template slot-scope="scope">
  98. <span>{{ scope.row.brandName }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="允许误差数(kg)" min-width="110px" align="center">
  102. <template slot-scope="scope">
  103. <span>{{ scope.row.brandName }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="包装单位重量(kg)" min-width="110px" align="center">
  107. <template slot-scope="scope">
  108. <span>{{ scope.row.brandName }}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="单价" min-width="110px" align="center">
  112. <template slot-scope="scope">
  113. <span>{{ scope.row.brandName }}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="跳转重量(kg)" min-width="110px" align="center">
  117. <template slot-scope="scope">
  118. <span>{{ scope.row.brandName }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="跳转延时" min-width="110px" align="center">
  122. <template slot-scope="scope">
  123. <span>{{ scope.row.brandName }}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="确认开始" min-width="110px" align="center">
  127. <template slot-scope="scope">
  128. <el-switch v-model="scope.row.confirmStart" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="继电器位置" min-width="110px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.brandName }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="备用字段01" min-width="110px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.brandName }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="备用字段02" min-width="110px" align="center">
  142. <template slot-scope="scope">
  143. <span>{{ scope.row.brandName }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="备用字段03" min-width="110px" align="center">
  147. <template slot-scope="scope">
  148. <span>{{ scope.row.brandName }}</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="是否启用" min-width="110px" align="center">
  152. <template slot-scope="scope">
  153. <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="操作" align="center" width="320" class-name="small-padding fixed-width" fixed="right">
  157. <template slot-scope="{row}">
  158. <el-button class="miniSuccess" @click="handleNutritive (row)">营养价值</el-button>
  159. <el-button class="miniSuccess" @click="handleRelation(row)">关联</el-button>
  160. <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  161. <el-button class="miniDanger" @click="handleRowDelete(row)">删除</el-button>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  166. </div>
  167. <!-- 新增/编辑 -->
  168. <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  169. <div class="app-add">
  170. <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
  171. <el-row>
  172. <el-col :span="24">
  173. <h3 style="width: 160px;text-align: right;">基础信息</h3>
  174. </el-col>
  175. </el-row>
  176. <el-row>
  177. <el-col :span="6">
  178. <el-form-item label="饲料名称:" prop="location">
  179. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入饲料名称" type="textarea" :autosize="{ minRows:1}" maxlength="32" />
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="6">
  183. <el-form-item label="饲料类别:" prop="location">
  184. <tree-select
  185. class="filter-item typeSelect"
  186. :height="150"
  187. :width="150"
  188. size="small"
  189. clearable
  190. :data="type.parentDept"
  191. :disabled="type.disabled"
  192. :placeholder="type.placeholder"
  193. style="display:inline-block;"
  194. :default-props="type.defaultProps"
  195. :node-key="type.nodeKey"
  196. :checked-keys="type.defaultCheckedKeys"
  197. @popoverHide="popoverHide"
  198. />
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="6">
  202. <el-form-item label="唯一编码:" prop="location">
  203. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入唯一编码" type="text" />
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="6">
  207. <el-form-item label="饲料来源:" prop="location">
  208. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="用户自定义" type="text" />
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. <el-row>
  213. <el-col :span="6">
  214. <el-form-item label="计划类型:" prop="location">
  215. <el-select v-model="create.temp.location" placeholder="计划类型" class="filter-item" style="width: 100%;">
  216. <el-option v-for="item in create.planTypeList" :key="item.id" :label="item.name" :value="item.name" />
  217. </el-select>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="6">
  221. <el-form-item label="包装单位重量(kg):" prop="location">
  222. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="正整数" type="text" style="width: 100%;" />
  223. </el-form-item>
  224. </el-col>
  225. <el-col :span="6">
  226. <el-form-item label="单价:" prop="location">
  227. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="最多俩位小数" type="text" style="width: 100%;" />
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. <el-row>
  232. <el-col :span="6">
  233. <el-form-item label="允许误差数(kg):" prop="location">
  234. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="正整数" type="text" />
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="6">
  238. <el-form-item label="跳转重量域(kg):" prop="location">
  239. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="最多俩位小数" type="text" />
  240. </el-form-item>
  241. </el-col>
  242. <el-col :span="6">
  243. <el-form-item label="跳转延时:" prop="location">
  244. <el-select v-model="create.temp.location" placeholder="跳转延时" class="filter-item" style="width: 100%;">
  245. <el-option v-for="item in jumpDelayList" :key="item.id" :label="item.name" :value="item.name" />
  246. </el-select>
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="6">
  250. <el-form-item label="确认开始:" prop="location">
  251. <el-select v-model="create.temp.location" placeholder="确认开始" class="filter-item" style="width: 100%;">
  252. <el-option v-for="item in confirmStartList" :key="item.id" :label="item.name" :value="item.name" />
  253. </el-select>
  254. </el-form-item>
  255. </el-col>
  256. </el-row>
  257. <el-row>
  258. <el-col :span="6">
  259. <el-form-item label="是否启用:" prop="location">
  260. <el-select v-model="create.temp.location" placeholder="是否启用" class="filter-item" style="width: 100%;">
  261. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.name" />
  262. </el-select>
  263. </el-form-item>
  264. </el-col>
  265. <el-col :span="6">
  266. <el-form-item label="继电器位置:" prop="location">
  267. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="继电器位置" type="text" />
  268. </el-form-item>
  269. </el-col>
  270. </el-row>
  271. <el-row>
  272. <h3 style="width: 160px;text-align: right;">备用字段</h3>
  273. </el-row>
  274. <el-row>
  275. <el-col :span="6">
  276. <el-form-item label="备用字段01:" prop="location">
  277. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="备用字段01" type="text" />
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="6">
  281. <el-form-item label="备用字段02:" prop="location">
  282. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="备用字段02" type="text" />
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="6">
  286. <el-form-item label="备用字段03:" prop="location">
  287. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="备用字段03" type="text" />
  288. </el-form-item>
  289. </el-col>
  290. </el-row>
  291. </el-form>
  292. <div slot="footer" class="dialog-footer">
  293. <el-button class="cancel" @click="create.dialogFormVisible = false; ">关闭</el-button>
  294. <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
  295. </div>
  296. </div>
  297. </el-dialog>
  298. <!-- 饲料库/关联 -->
  299. <el-dialog :title="textMap[feedBank.dialogStatus]" :visible.sync="feedBank.dialogFormVisible" :close-on-click-modal="false" width="90%">
  300. <div class="app-add">
  301. <div class="search">
  302. <el-input v-model="feedBank.getdataListParm.parammaps.assetCode" placeholder="饲料名称" style="width: 130px;" class="filter-item" clearable />
  303. <el-select v-if="feedBank.dialogStatus==='feedBank'" v-model="feedBank.getdataListParm.parammaps.enable" placeholder="关联状态" class="filter-item" style="width: 120px;" clearable>
  304. <el-option v-for="item in associationStatusList" :key="item.id" :label="item.name" :value="item.name" />
  305. </el-select>
  306. <el-button class="successBorder" @click="handleFeedBankSearch">查询</el-button>
  307. <el-button class="successBorder" @click="handleFeedBankRefresh">重置</el-button>
  308. </div>
  309. <div class="table">
  310. <el-table
  311. :key="feedBank.tableKey"
  312. v-loading="feedBank.listLoading"
  313. element-loading-text="给我一点时间"
  314. :data="feedBank.list"
  315. border
  316. fit
  317. highlight-current-row
  318. style="width: 100%;margin: 0 auto 50px;"
  319. :row-style="rowStyle"
  320. :cell-style="cellStyle"
  321. class="elTable table-fixed"
  322. >
  323. <el-table-column label="序号" align="center" type="index" width="50px">
  324. <template slot-scope="scope">
  325. <span>{{ scope.$index + (feedBank.pageNum-1) * feedBank.pageSize + 1 }}</span>
  326. </template>
  327. </el-table-column>
  328. <el-table-column label="来源" min-width="90" align="center">
  329. <template slot-scope="scope">
  330. <span>{{ scope.row.brandName }}</span>
  331. </template>
  332. </el-table-column>
  333. <el-table-column label="中国饲料号" min-width="100px" align="center">
  334. <template slot-scope="scope">
  335. <span>{{ scope.row.brandName }}</span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column label="饲料名称" min-width="90px" align="center">
  339. <template slot-scope="scope">
  340. <span>{{ scope.row.brandName }}</span>
  341. </template>
  342. </el-table-column>
  343. <el-table-column label="价格" min-width="80px" align="center">
  344. <template slot-scope="scope">
  345. <span>{{ scope.row.brandName }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="样品说明" min-width="90px" align="center">
  349. <template slot-scope="scope">
  350. <span>{{ scope.row.brandName }}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column label="干物质(DM%)" min-width="70px" align="center">
  354. <template slot-scope="scope">
  355. <span>{{ scope.row.brandName }}</span>
  356. </template>
  357. </el-table-column>
  358. <el-table-column label="淀粉(%DM)" min-width="70px" align="center">
  359. <template slot-scope="scope">
  360. <span>{{ scope.row.brandName }}</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column label="粗蛋白(CP%DM)" min-width="75px" align="center">
  364. <template slot-scope="scope">
  365. <span>{{ scope.row.brandName }}</span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="钙(Ca%DM)" min-width="80px" align="center">
  369. <template slot-scope="scope">
  370. <span>{{ scope.row.brandName }}</span>
  371. </template>
  372. </el-table-column>
  373. <el-table-column label="磷(P%DM)" min-width="80px" align="center">
  374. <template slot-scope="scope">
  375. <span>{{ scope.row.brandName }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column label="产奶净能(%DM)" min-width="80px" align="center">
  379. <template slot-scope="scope">
  380. <span>{{ scope.row.brandName }}</span>
  381. </template>
  382. </el-table-column>
  383. <el-table-column label="脂肪(%DM)" min-width="70px" align="center">
  384. <template slot-scope="scope">
  385. <span>{{ scope.row.brandName }}</span>
  386. </template>
  387. </el-table-column>
  388. <el-table-column label="ADF(%DM)" min-width="80px" align="center">
  389. <template slot-scope="scope">
  390. <span>{{ scope.row.brandName }}</span>
  391. </template>
  392. </el-table-column>
  393. <el-table-column label="NDF(%DM)" min-width="80px" align="center">
  394. <template slot-scope="scope">
  395. <span>{{ scope.row.brandName }}</span>
  396. </template>
  397. </el-table-column>
  398. <el-table-column label="NDIP%" min-width="80px" align="center">
  399. <template slot-scope="scope">
  400. <span>{{ scope.row.brandName }}</span>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="粗灰分(Ash%)" min-width="70px" align="center">
  404. <template slot-scope="scope">
  405. <span>{{ scope.row.brandName }}</span>
  406. </template>
  407. </el-table-column>
  408. <el-table-column label="粗料" min-width="70px" align="center">
  409. <template slot-scope="scope">
  410. <span>{{ scope.row.brandName }}</span>
  411. </template>
  412. </el-table-column>
  413. <el-table-column v-if="feedBank.dialogStatus=='relation'" label="操作" min-width="70px" align="center">
  414. <template slot-scope="{row}">
  415. <el-button class="miniSuccess" @click="disassociateData (row)">取消关联</el-button>
  416. <el-button class="miniSuccess" @click="relationData(row)">关联</el-button>
  417. </template>
  418. </el-table-column>
  419. </el-table>
  420. </div>
  421. <div slot="footer" class="dialog-footer">
  422. <el-button class="cancel" @click="feedBank.dialogFormVisible = false; ">关闭</el-button>
  423. </div>
  424. </div>
  425. </el-dialog>
  426. <!-- 营养价值 -->
  427. <el-dialog :title="textMap[nutritive.dialogStatus]" :visible.sync="nutritive.dialogFormVisible" :close-on-click-modal="false" width="90%">
  428. <div class="app-add">
  429. <el-form ref="temp" :rules="nutritive.rules" :model="nutritive.temp" label-position="right" label-width="160px" style="width: 100%;margin:0 auto 50px">
  430. <el-row>
  431. <el-col :span="6">
  432. <el-form-item label="干物质(DM%):" prop="location">
  433. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入干物质" type="text" />
  434. </el-form-item>
  435. </el-col>
  436. <el-col :span="6">
  437. <el-form-item label="淀粉(%DM):" prop="location">
  438. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入淀粉" type="text" />
  439. </el-form-item>
  440. </el-col>
  441. <el-col :span="6">
  442. <el-form-item label="粗蛋白(CP%DM):" prop="location">
  443. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入粗蛋白" type="text" />
  444. </el-form-item>
  445. </el-col>
  446. <el-col :span="6">
  447. <el-form-item label="钙(Ca%DM):" prop="location">
  448. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入钙" type="text" />
  449. </el-form-item>
  450. </el-col>
  451. </el-row>
  452. <el-row>
  453. <el-col :span="6">
  454. <el-form-item label="磷(P%DM):" prop="location">
  455. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入磷" type="text" />
  456. </el-form-item>
  457. </el-col>
  458. <el-col :span="6">
  459. <el-form-item label="产奶净能(%DM):" prop="location">
  460. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入产奶净能" type="text" />
  461. </el-form-item>
  462. </el-col>
  463. <el-col :span="6">
  464. <el-form-item label="脂肪(%DM):" prop="location">
  465. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入脂肪" type="text" />
  466. </el-form-item>
  467. </el-col>
  468. <el-col :span="6">
  469. <el-form-item label="ADF(%DM):" prop="location">
  470. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入ADF" type="text" />
  471. </el-form-item>
  472. </el-col>
  473. </el-row>
  474. <el-row>
  475. <el-col :span="6">
  476. <el-form-item label="NDF(%DM):" prop="location">
  477. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入NDF" type="text" />
  478. </el-form-item>
  479. </el-col>
  480. <el-col :span="6">
  481. <el-form-item label="NDIP(%):" prop="location">
  482. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入NDIP" type="text" />
  483. </el-form-item>
  484. </el-col>
  485. <el-col :span="6">
  486. <el-form-item label="粗灰分(Ash%):" prop="location">
  487. <el-input ref="location" v-model="create.temp.location" class="filter-item" placeholder="请输入粗灰分" type="text" />
  488. </el-form-item>
  489. </el-col>
  490. </el-row>
  491. </el-form>
  492. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
  493. <el-button @click="nutritive.dialogFormVisible = false; ">关闭</el-button>
  494. <el-button v-if="nutritive.dialogStatus==='nutritive'" type="success" :disabled="isokDisable" @click="nutritiveData()">确认</el-button>
  495. </div>
  496. </div>
  497. </el-dialog>
  498. </div>
  499. </template>
  500. <script>
  501. import { GetDataByName, transData } from '@/api/common'
  502. import Pagination from '@/components/Pagination'
  503. import TreeSelect from '@/components/TreeSelect'
  504. export default {
  505. name: 'FeedTable',
  506. components: { Pagination, TreeSelect },
  507. data() {
  508. return {
  509. enableList: [{ id: 0, name: '是' }, { id: 1, name: '否' }], // 是否启用
  510. jumpDelayList: [{ id: 0, name: '禁用' }, { id: 1, name: '3秒' }, { id: 2, name: '6秒' }, { id: 3, name: '9秒' }], // 跳转延时
  511. feedSourcesList: [{ id: 0, name: '系统内置' }, { id: 1, name: '用户自定义' }], // 饲料来源
  512. confirmStartList: [{ id: 0, name: '禁用' }, { id: 1, name: '启用' }], // 确认开始
  513. associationStatusList: [{ id: 0, name: '是' }, { id: 1, name: '否' }], // 关联状态
  514. table: {
  515. tableKey: 0,
  516. list: [],
  517. total: 0,
  518. listLoading: true,
  519. getdataListParm: {
  520. name: 'getAssetList',
  521. page: 1,
  522. offset: 1,
  523. pagecount: 10,
  524. returntype: 'Map',
  525. parammaps: {
  526. enable: ''
  527. }
  528. }
  529. },
  530. // 饲料类别
  531. type: {
  532. getDeptListParm: { name: 'getpart_classList' },
  533. listType: [],
  534. parentDept: [],
  535. disabled: false,
  536. placeholder: '请选择饲料类别',
  537. defaultProps: {
  538. children: 'children',
  539. label: 'partClassNameCode'
  540. },
  541. nodeKey: 'id',
  542. defaultCheckedKeys: []
  543. },
  544. // 多项搜索显示隐藏
  545. arrowDown: true,
  546. arrowUp: false,
  547. // 新增/编辑
  548. create: {
  549. dialogFormVisible: false,
  550. dialogStatus: '',
  551. temp: {},
  552. planTypeList: [{ id: 0, name: '无' }, { id: 1, name: '铲车' }, { id: 2, name: '精料' }],
  553. rules: {}
  554. },
  555. // 关联/饲料库
  556. feedBank: {
  557. dialogFormVisible: false,
  558. dialogStatus: '',
  559. temp: {},
  560. rules: {},
  561. tableKey: 0,
  562. list: [],
  563. total: 0,
  564. listLoading: true,
  565. getdataListParm: {
  566. name: 'getAssetList',
  567. page: 1,
  568. offset: 1,
  569. pagecount: 10,
  570. returntype: 'Map',
  571. parammaps: {
  572. enable: ''
  573. }
  574. }
  575. },
  576. // 营养价值
  577. nutritive: {
  578. dialogFormVisible: false,
  579. dialogStatus: '',
  580. temp: {},
  581. rules: {}
  582. },
  583. textMap: {
  584. create: '新增',
  585. update: '编辑',
  586. feedBank: '饲料库',
  587. relation: '关联',
  588. nutritive: '营养价值'
  589. },
  590. isokDisable: false,
  591. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  592. cellStyle: { padding: 0 + 'px' }
  593. }
  594. },
  595. mounted() {
  596. document.addEventListener('click', (e) => {
  597. if (this.$refs.selectInput !== undefined) {
  598. if (!this.$refs.selectInput.contains(e.target)) {
  599. this.arrowDown = true
  600. this.arrowUp = false
  601. } else {
  602. this.arrowDown = false
  603. this.arrowUp = true
  604. }
  605. }
  606. })
  607. },
  608. created() {
  609. this.getList()
  610. this.getTypeList()
  611. },
  612. methods: {
  613. getTypeList() {
  614. this.type.getDeptListParm.parammaps = this.deptform
  615. GetDataByName(this.type.getDeptListParm).then(response => {
  616. this.type.listType = response.data
  617. if (response.data.list !== null) {
  618. this.type.listType = transData(response.data.list, 'id', 'pid', 'children')
  619. }
  620. this.type.parentDept = this.type.listType
  621. })
  622. },
  623. popoverHide(checkedIds, checkedData) {
  624. console.log(checkedIds, checkedData)
  625. if (checkedIds !== null) {
  626. if (checkedData.childrens == 0) {
  627. console.log(checkedData)
  628. } else {
  629. this.type.defaultCheckedKeys = []
  630. this.$message({ type: 'warning', message: '请选择饲料子类别' })
  631. }
  632. } else {
  633. this.type.defaultCheckedKeys = []
  634. }
  635. },
  636. getList() {
  637. this.table.listLoading = true
  638. GetDataByName(this.table.getdataListParm).then(response => {
  639. console.log('table数据', response.data.list)
  640. if (response.data.list !== null) {
  641. this.table.list = response.data.list
  642. this.table.pageNum = response.data.pageNum
  643. this.table.pageSize = response.data.pageSize
  644. this.table.total = response.data.total
  645. } else {
  646. this.table.list = []
  647. }
  648. setTimeout(() => {
  649. this.table.listLoading = false
  650. }, 100)
  651. })
  652. },
  653. handleSearch() {
  654. console.log('点击了查询')
  655. this.getList()
  656. this.arrowDown = true
  657. this.arrowUp = false
  658. },
  659. handleRefresh() {
  660. console.log('点击了重置')
  661. },
  662. handleSelectionChange(val) {
  663. console.log('勾选数据', val)
  664. },
  665. resetTemp() {
  666. },
  667. // 新增
  668. handleCreate() {
  669. console.log('点击了新增')
  670. this.resetTemp()
  671. this.create.dialogStatus = 'create'
  672. this.create.dialogFormVisible = true
  673. },
  674. createData() {
  675. console.log('点击了新增保存')
  676. },
  677. // 饲料库
  678. handleFeedBank() {
  679. console.log('点击了饲料库')
  680. this.feedBank.dialogStatus = 'feedBank'
  681. this.feedBank.dialogFormVisible = true
  682. this.getFeedBankList()
  683. },
  684. getFeedBankList() {
  685. this.feedBank.listLoading = true
  686. GetDataByName(this.feedBank.getdataListParm).then(response => {
  687. console.log('table数据', response.data.list)
  688. if (response.data.list !== null) {
  689. this.feedBank.list = response.data.list
  690. this.feedBank.pageNum = response.data.pageNum
  691. this.feedBank.pageSize = response.data.pageSize
  692. this.feedBank.total = response.data.total
  693. } else {
  694. this.feedBank.list = []
  695. }
  696. setTimeout(() => {
  697. this.feedBank.listLoading = false
  698. }, 100)
  699. })
  700. },
  701. handleFeedBankSearch() {
  702. console.log('点击了饲料库搜索')
  703. },
  704. handleFeedBankRefresh() {
  705. console.log('点击了饲料库重置')
  706. },
  707. // 关联
  708. handleRelation(row) {
  709. console.log('点击了关联')
  710. this.feedBank.dialogStatus = 'relation'
  711. this.feedBank.dialogFormVisible = true
  712. this.getFeedBankList()
  713. },
  714. disassociateData() {
  715. console.log('点击了取消关联')
  716. },
  717. relationData() {
  718. console.log('点击了关联保存')
  719. },
  720. // 编辑
  721. handleUpdate(row) {
  722. console.log('点击了编辑')
  723. this.create.dialogStatus = 'update'
  724. this.create.dialogFormVisible = true
  725. },
  726. updateData() {
  727. console.log('点击了编辑保存')
  728. },
  729. // 营养价值
  730. handleNutritive(row) {
  731. console.log('点击了营养价值')
  732. this.nutritive.dialogStatus = 'nutritive'
  733. this.nutritive.dialogFormVisible = true
  734. },
  735. nutritiveData() {
  736. console.log('点击了营养价值保存')
  737. },
  738. // 行内删除
  739. handleRowDelete() {
  740. console.log('点击了行内删除')
  741. },
  742. // 多项删除
  743. handleDelete() {
  744. console.log('点击了删除')
  745. }
  746. }
  747. }
  748. </script>
  749. <style lang="scss" scoped>
  750. .search{margin-top:10px;}
  751. .table{margin-top:10px;}
  752. $width:350px;
  753. $left:325px;
  754. .selectInput{
  755. position: relative;
  756. display: inline-block;
  757. .Input{width: $width;position: relative;}
  758. .el-icon-arrow-down{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  759. .el-icon-arrow-up{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  760. .selectUl{
  761. 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;
  762. li{
  763. 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;
  764. a{float:left;width: 80px;}
  765. a:hover{color: rgba(0, 204, 102, 0.71); font-weight: 700;}
  766. }
  767. }
  768. }
  769. </style>
  770. <style lang="scss">
  771. .typeSelect span .el-popover__reference .el-input--suffix {
  772. .el-input__inner{
  773. height:40px !important;
  774. }
  775. }
  776. </style>