Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

consumables.vue 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div class="page_consumables">
  3. <div class="cell clearfix">
  4. <label class="title"> <span class="name">排班班次</span> : </label>
  5. <div class="time">
  6. <ul class>
  7. <li
  8. :class="item.value == schedulType ? 'active' : ''"
  9. @click="selectSchedulType(item.value)"
  10. v-for="item in schedulArr"
  11. :key="item.value"
  12. >
  13. {{ item.label }}
  14. </li>
  15. </ul>
  16. </div>
  17. <label class="title"><span class="name">日期查询</span> : </label>
  18. <el-date-picker size="small" v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange"
  19. :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date"
  20. format="yyyy-MM-dd"
  21. value-format="yyyy-MM-dd"
  22. placeholder="选择日期时间" align="right"></el-date-picker>
  23. <el-input size="small" style="width: 180px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
  24. class="filter-item" v-model="query.keywords"/>
  25. <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  26. </div>
  27. <div class="cell clearfix" style="justify-content: space-between;">
  28. <div style="display:flex;">
  29. <label class="title"> <span class="name">分区</span> : </label>
  30. <div class="time">
  31. <ul class>
  32. <li
  33. :class="item.id == partitionType ? 'active' : ''"
  34. @click="selectPartitionType(item.id)"
  35. v-for="item in partitionArr"
  36. :key="item.id"
  37. >
  38. {{ item.name }}
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. <div>
  44. <!--<el-button size="small" icon="el-icon-printer" type="primary">打印</el-button>-->
  45. <el-button size="small" type="primary" @click="statistics">统计表</el-button>
  46. </div>
  47. </div>
  48. <div>
  49. <el-table
  50. :data="list"
  51. height="350"
  52. border
  53. >
  54. <el-table-column
  55. align="center"
  56. type="selection"
  57. width="55">
  58. </el-table-column>
  59. <el-table-column
  60. align="center"
  61. prop="name"
  62. v-for="item,index in good_types"
  63. :key="index"
  64. :label="item"
  65. >
  66. <template slot-scope="scope">
  67. <span>{{scope.row.good_type[index].name}}</span>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. </div>
  72. <el-pagination
  73. @size-change="handleSizeChange"
  74. @current-change="handleCurrentChange"
  75. :page-sizes="[10, 50, 100]"
  76. :page-size="10"
  77. background
  78. align="right"
  79. style="margin-top:20px;"
  80. layout="total, sizes, prev, pager, next, jumper"
  81. :total="total"
  82. >
  83. </el-pagination>
  84. <consumables-dialog ref="consumables" :list="new_list"></consumables-dialog>
  85. </div>
  86. </template>
  87. <script>
  88. import { GetAllZone,GetDialysisgoods } from '@/api/dialysis'
  89. import consumablesDialog from './consumablesDialog'
  90. import { uParseTime } from "@/utils/tools";
  91. export default {
  92. components: {
  93. consumablesDialog
  94. },
  95. data() {
  96. return {
  97. query:{
  98. total:"",
  99. schedule_date:"",
  100. schedule_type:0,
  101. partition_id:0,
  102. page:1,
  103. limit:10,
  104. keywords:"",
  105. },
  106. schedulType: 0,
  107. schedulArr: [
  108. { value: 0, label: '全部' },
  109. { value: 1, label: '上午' },
  110. { value: 2, label: '下午' },
  111. { value: 3, label: '晚上' }
  112. ],
  113. selected_date: "",
  114. partitionArr: [],
  115. partitionType: 0,
  116. tableData: [{
  117. date: '2016-05-03',
  118. name: '王小虎',
  119. address: '上海市普陀区金沙江路 1518 弄'
  120. }
  121. ],
  122. search_input: '',
  123. searchAction: '',
  124. allGoodInfo:[],
  125. list:[],
  126. new_list:[],
  127. good_types: [],
  128. }
  129. },
  130. created() {
  131. this.getAllZone()
  132. let date = uParseTime(new Date(), "{y}-{m}-{d}")
  133. var newDate = new Date();
  134. var y = newDate.getFullYear();
  135. var m = newDate.getMonth() + 1;
  136. var d = newDate.getDate();
  137. var schedule_date =
  138. y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
  139. this.query.schedule_date = schedule_date
  140. this.query.schedule_type = 0
  141. this.query.partition_id = 0
  142. this.query.page = 1
  143. this.GetDialysisgoods()
  144. },
  145. methods: { handleSizeChange(val) {
  146. this.query.limit = val;
  147. this.GetDialysisgoods();
  148. },
  149. handleCurrentChange(val) {
  150. this.query.page = val;
  151. this.GetDialysisgoods();
  152. },
  153. calCount(query_warehouseout_info) {
  154. let total = 0
  155. var array = []
  156. array = query_warehouseout_info
  157. for (let i = 0; i < array.length; i++) {
  158. total = total + array[i].count
  159. }
  160. return total
  161. },
  162. getGoodUserInfo(good_type_id,good_user,last_good_user) {
  163. if (good_user != null && good_user.length > 0) {
  164. let desc = ""
  165. for (let b = 0; b < good_user.length; b++){
  166. if(good_type_id == good_user[b].good_type_id)
  167. desc = desc + "\n" + good_user[b].info.specification_name +"*" +good_user[b].count
  168. }
  169. console.log(desc)
  170. return desc
  171. } else if (good_user != null && good_user.length <= 0) {
  172. if (last_good_user != null && last_good_user.length > 0) {
  173. let desc = ""
  174. for (let b = 0; b < last_good_user.length; b++){
  175. if(good_type_id == last_good_user[b].good_type_id)
  176. desc = desc+ "\n" + last_good_user[b].info.specification_name +"*" +last_good_user[b].count
  177. }
  178. console.log(desc)
  179. return desc
  180. }
  181. return ""
  182. }
  183. },
  184. GetDialysisgoods() {
  185. GetDialysisgoods(this.query).then(response => {
  186. if (response.data.state == 0) {
  187. this.$message.error(response.data.msg)
  188. return false
  189. } else {
  190. this.list = []
  191. this.good_types = []
  192. this.allGoodInfo = []
  193. var res = response.data
  194. this.total = res.data.total
  195. this.good_types.push("姓名")
  196. for (let a = 0; a < res.data.good_type.length; a++){
  197. this.good_types.push(res.data.good_type[a].type_name)
  198. }
  199. this.allGoodInfo = res.data.dialysis_goods
  200. for(let i = 0; i < res.data.dialysis_goods.length; i++){
  201. let arr =[]
  202. let obj = {
  203. id:0,
  204. name: res.data.dialysis_goods[i].patient.name
  205. }
  206. arr.push(obj)
  207. for (let a = 0; a < res.data.good_type.length; a++){
  208. let obj = {
  209. id:res.data.good_type[a].id,
  210. name:""
  211. }
  212. arr.push(obj)
  213. }
  214. let newObj = {
  215. "good_type":arr,
  216. "good_user":res.data.dialysis_goods[i].good_user,
  217. "last_good_user":res.data.dialysis_goods[i].last_good_user,
  218. "good_user_detail":res.data.dialysis_goods[i].good_user_detail,
  219. "last_good_user_detail":res.data.dialysis_goods[i].last_good_user_detail,
  220. }
  221. this.list.push(newObj)
  222. }
  223. for (let a = 0; a < this.list.length; a++){
  224. for (let b = 0; b < this.list[a].good_type.length; b++){
  225. if(this.list[a].good_type[b].id > 0){
  226. this.list[a].good_type[b].name = this.getGoodUserInfo(this.list[a].good_type[b].id,this.list[a].good_user,this.list[a].last_good_user)
  227. }
  228. }
  229. }
  230. }
  231. })
  232. },
  233. selectSchedulType(scheduleType) {
  234. this.schedulType = scheduleType
  235. this.query.schedule_type = scheduleType
  236. this.query.page = 1
  237. this.GetDialysisgoods()
  238. },
  239. selectPartitionType(partitionType) {
  240. this.partitionType = partitionType
  241. this.query.partition_id = partitionType
  242. this.query.page = 1
  243. this.GetDialysisgoods()
  244. },
  245. getAllZone: function() {
  246. GetAllZone().then(response => {
  247. if (response.data.state == 0) {
  248. this.$message.error(response.data.msg)
  249. return false
  250. } else {
  251. this.partitionArr = response.data.data.zone
  252. this.partitionArr.unshift({ id: 0, name: '全部' })
  253. }
  254. })
  255. },
  256. statistics() {
  257. this.$refs.consumables.show()
  258. },
  259. handleScheduleDateChange(val) {
  260. this.query.schedule_date = val
  261. this.query.page = 1
  262. this.GetDialysisgoods()
  263. },
  264. search() {
  265. this.query.page = 1
  266. this.GetDialysisgoods()
  267. }
  268. }
  269. }
  270. </script>
  271. <style lang="scss" scoped>
  272. .page_consumables {
  273. .clearfix:after {
  274. content: none;
  275. }
  276. }
  277. </style>