血透系统PC前端

cancelStockRecord.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <div class="app-container sign-and-weigh-box">
  3. <div class="filter-container">
  4. <span>出库退库:</span>
  5. <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
  6. type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  7. value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
  8. <span class="">-</span>
  9. <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
  10. type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  11. value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
  12. <el-row style="float:right;">
  13. <el-button @click="handleBack">返回</el-button>
  14. </el-row>
  15. </div>
  16. <el-row :gutter="12">
  17. <el-col :span="8">
  18. <div class="title">出库退库记录
  19. </div>
  20. <div style="margin-bottom: 10px;">
  21. </div>
  22. <el-table :data="cancelStock.cancelStockDate" :class="signAndWeighBoxPatients" style="width: 100%" border
  23. @row-click="onRowClick"
  24. :row-class-name="tableRowClassName"
  25. highlight-current-row
  26. v-loading="cancelStock.loading"
  27. >
  28. <el-table-column label="退库单号" min-width="40" align="center">
  29. <template slot-scope="scope">
  30. {{scope.row.order_number}}
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="操作时间" min-width="40" align="center">
  34. <template slot-scope="scope">
  35. {{ scope.row.opera_time | parseTime("{y}-{m}-{d}")}}
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="退库总量" align="center" min-width="30">
  39. <template slot-scope="scope">
  40. {{scope.row.total}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="操作人" align="center" min-width="30">
  44. <template slot-scope="scope">
  45. {{getXuserName(scope.row.creater)}}
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <el-pagination
  50. @size-change="handleSizeChange"
  51. @current-change="handleCurrentChange"
  52. :page-sizes="[7]"
  53. :page-size="7"
  54. background
  55. style="margin-top:20px;"
  56. layout="total, sizes, prev, pager, next, jumper"
  57. :total="total">
  58. </el-pagination>
  59. </el-col>
  60. <el-col :span="16">
  61. <div class="title">物品详细信息
  62. </div>
  63. <el-table :data="cancelStockInfo.cancelStockInfoDate" :class="signAndWeighBoxPatients" style="width: 100%" border
  64. v-loading="cancelStockInfo.loading"
  65. @selection-change="handleSelectionChange"
  66. >
  67. <el-table-column
  68. type="selection"
  69. width="55">
  70. </el-table-column>
  71. <el-table-column label="规格名称" min-width="30" align="center">
  72. <template slot-scope="scope">
  73. {{getSpecificationName(scope.row.good_id)}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="物品类型" min-width="30" align="center">
  77. <template slot-scope="scope">
  78. {{getTypeName(scope.row.good_type_id)}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="退库数量" min-width="30" align="center">
  82. <template slot-scope="scope">
  83. {{scope.row.count}}
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="退库单价" min-width="30" align="center">
  87. <template slot-scope="scope">
  88. {{scope.row.price}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="退库总价" min-width="30" align="center">
  92. <template slot-scope="scope">
  93. {{scope.row.price * scope.row.count }}
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </el-col>
  98. </el-row>
  99. </div>
  100. </template>
  101. <script>
  102. import {uParseTime} from "@/utils/tools";
  103. import { fetchAllDoctorAndNurse,fetchAllAdminUsers } from "@/api/doctor";
  104. import {
  105. getCancelStockList,
  106. getCancelStockInfoList,
  107. GetAllGoodInfo,
  108. GetAllGoodType,
  109. } from "@/api/stock";
  110. export default {
  111. name: "stockIn",
  112. created(){
  113. var year = new Date().getFullYear();
  114. var month = new Date().getMonth() + 1;
  115. var day = new Date().getDate();
  116. if (parseInt(month) < 10) {
  117. month = "0" + month;
  118. }
  119. if (parseInt(day) < 10) {
  120. day = "0" + day;
  121. }
  122. let endTime = year + '-' + month + '-' + day;
  123. this.end_time = endTime
  124. var year = new Date().getFullYear();
  125. var month = new Date().getMonth();
  126. var day = new Date().getDate();
  127. if (parseInt(month) < 10) {
  128. month = "0" + month;
  129. }
  130. if (parseInt(day) < 10) {
  131. day = "0" + day;
  132. }
  133. let startTime = year + '-' + month + '-' + day;
  134. this.start_time = startTime
  135. this.GetAllGoodInfo()
  136. this.GetAllGoodType()
  137. this.GetCancelStockList()
  138. this.fetchAllAdminUsers()
  139. },
  140. data() {
  141. return {
  142. adminUserOptions:[],
  143. multipleSelection: [],
  144. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  145. start_time: '',
  146. end_time: '',
  147. goodType:[],
  148. goodInfo:[],
  149. cancelStock: {
  150. loading: false,
  151. cancelStockDate: [],
  152. tableCurrentIndex:''
  153. },
  154. cancelStockInfo: {
  155. loading: false,
  156. cancelStockInfoDate: [],
  157. },
  158. };
  159. },
  160. methods: {
  161. GetCancelStockList:function () {
  162. let Params = {
  163. page: this.page,
  164. limit: this.limit,
  165. start_time: this.start_time,
  166. end_time: this.end_time
  167. }
  168. this.cancelStock.cancelStockDate = []
  169. getCancelStockList(Params).then(response =>{
  170. if (response.data.state == 0) {
  171. this.cancelStock.loading = false
  172. this.$message.error(response.data.msg);
  173. return false;
  174. } else {
  175. this.cancelStock.loading = false
  176. this.total = response.data.data.total
  177. for (let i = 0; i < response.data.data.list.length; i++) {
  178. this.cancelStock.cancelStockDate.push(response.data.data.list[i])
  179. }
  180. }
  181. })
  182. }, tableRowClassName({row, rowIndex}) {
  183. //把每一行的索引放进row
  184. row.index = rowIndex;
  185. }, onRowClick(row, event, column) {
  186. this.cancelStockInfo.cancelStockInfoDate = []
  187. this.cancelStock.tableCurrentIndex = row.index;
  188. let params = {
  189. 'id': row.id
  190. }
  191. this.cancelStockInfo.loading = true
  192. getCancelStockInfoList(params).then(response => {
  193. if (response.data.state == 0) {
  194. this.cancelStockInfo.loading = false
  195. this.$message.error(response.data.msg);
  196. return false;
  197. } else {
  198. this.cancelStockInfo.loading = false
  199. for (let i = 0; i < response.data.data.info.length; i++) {
  200. this.cancelStockInfo.cancelStockInfoDate.push(response.data.data.info[i])
  201. }
  202. }
  203. });
  204. },getXuserName(id){
  205. if (id<=0) {
  206. return "";
  207. }
  208. var name = "";
  209. if (this.adminUserOptions==null || typeof(this.adminUserOptions.length) == "undefined") {
  210. return name;
  211. }
  212. var leng = this.adminUserOptions.length;
  213. if (leng==0) {
  214. return name;
  215. }
  216. for (let index = 0; index < leng; index++) {
  217. if (this.adminUserOptions[index].id == id) {
  218. name = this.adminUserOptions[index].name;
  219. break;
  220. }
  221. }
  222. return name;
  223. },fetchAllDoctorAndNurse() {
  224. fetchAllDoctorAndNurse().then(response => {
  225. if (response.data.state == 1) {
  226. this.doctorOptions = response.data.data.doctors;
  227. }
  228. });
  229. },
  230. fetchAllAdminUsers() {
  231. fetchAllAdminUsers().then(response => {
  232. if (response.data.state == 1) {
  233. this.adminUserOptions = response.data.data.users;
  234. var alen = this.adminUserOptions.length;
  235. for (let index = 0; index < alen; index++) {
  236. if (this.adminUserOptions[index].user_type==2) {
  237. this.doctorOptions.push(this.adminUserOptions[index]);
  238. }
  239. }
  240. }
  241. });
  242. },getSpecificationName:function (id) {
  243. let name = ''
  244. for (let i = 0; i< this.goodInfo.length; i++){
  245. if( this.goodInfo[i].id == id){
  246. name = this.goodInfo[i].specification_name
  247. }
  248. }
  249. return name
  250. },getTypeName:function (id) {
  251. let name = ''
  252. for (let i = 0; i< this.goodType.length; i++){
  253. if( this.goodType[i].id == id){
  254. name = this.goodType[i].type_name
  255. }
  256. }
  257. return name
  258. },GetAllGoodType:function () {
  259. GetAllGoodType().then(response => {
  260. if (response.data.state == 0) {
  261. this.$message.error(response.data.msg);
  262. return false;
  263. } else {
  264. for (let i = 0; i < response.data.data.goodType.length; i++) {
  265. this.goodType.push(response.data.data.goodType[i])
  266. }
  267. }
  268. });
  269. },GetAllGoodInfo:function () {
  270. GetAllGoodInfo().then(response => {
  271. if (response.data.state == 0) {
  272. this.$message.error(response.data.msg);
  273. return false;
  274. } else {
  275. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  276. this.goodInfo.push(response.data.data.goodInfo[i])
  277. }
  278. }
  279. });
  280. },handleSelectionChange:function (val) {
  281. this.multipleSelection = val
  282. },handleBack: function () {
  283. this.$router.go(-1)
  284. },startTimeChange(val) {
  285. this.GetWarehouse();
  286. }, endTimeChange(val) {
  287. this.GetWarehouse();
  288. }
  289. },
  290. watch: {
  291. $route() {
  292. if (this.$route.path == '/stock/in') {
  293. }
  294. }
  295. }
  296. };
  297. </script>
  298. <style rel="stylesheet/css" lang="scss" scoped>
  299. .information {
  300. border: 1px #dcdfe6 solid;
  301. padding: 30px 20px 30px 20px;
  302. .border {
  303. border-bottom: 1px #dcdfe6 solid;
  304. margin: 0px 0 20px 0;
  305. }
  306. }
  307. .title {
  308. background: #409eff;
  309. height: 44px;
  310. line-height: 44px;
  311. padding: 0 0 0 10px;
  312. color: #fff;
  313. margin: 0 0 10px 0;
  314. // border-radius: 4px 4px 0 0;
  315. }
  316. .edit_separater {
  317. border-top: 1px solid rgb(233, 233, 233);
  318. margin-top: 15px;
  319. margin-bottom: 15px;
  320. }
  321. </style>
  322. <style>
  323. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  324. font-size: 12px;
  325. }
  326. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  327. background: #6fb5fa;
  328. }
  329. .count{
  330. color: #bd2c00;
  331. }
  332. </style>