血透系统PC前端

stockOutOrderDetail.vue 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="filter-container">
  8. <span style="font-size: 18px">出库单详情</span>
  9. <el-row style="float:right;">
  10. <span>{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
  11. </el-row>
  12. </div>
  13. <div class="cell">
  14. <span style="width: 300px;">单据日期: {{warehousingOutInfo.info.warehouse_out_time | parseTime('{y}-{m}-{d}')}} </span>
  15. <span style="width: 300px;">厂商 {{getManufactuerName(warehousingOutInfo.info.manufacturer)}}</span>
  16. <span style="width: 300px;">经销商 {{getDealerName(warehousingOutInfo.info.dealer)}}</span>
  17. </div>
  18. <div class="filter-container" style="margin-top: 10px">
  19. <el-button size="small" icon="el-icon-edit" @click="editRecord">编辑</el-button>
  20. <el-button size="small" icon="el-icon-delete" @click="deleteRecord">删除</el-button>
  21. </div>
  22. <el-row :gutter="12" style="margin-top: 10px">
  23. <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
  24. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  25. >
  26. <el-table-column min-width="35" align="center">
  27. <template slot="header" slot-scope="scope">
  28. <span>物品类型</span>
  29. </template>
  30. <template slot-scope="scope">
  31. <span v-if="scope.row.good_type_id != 0">{{getTypeName(scope.row.good_type_id)}}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column min-width="35" align="center">
  35. <template slot="header" slot-scope="scope">
  36. <span>规格名称</span>
  37. </template>
  38. <template slot-scope="scope">
  39. <span v-if="scope.row.good_id != 0">{{getSpecificationName(scope.row.good_id)}}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column min-width="23" align="center">
  43. <template slot="header" slot-scope="scope">
  44. <span>单价</span>
  45. </template>
  46. <template slot-scope="scope">
  47. <span>{{scope.row.price}}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column min-width="23" align="center">
  51. <template slot="header" slot-scope="scope">
  52. <span>出库数量</span>
  53. </template>
  54. <template slot-scope="scope">
  55. <span>{{scope.row.count}}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="总价" min-width="20" align="center">
  59. <template slot-scope="scope">
  60. {{calculate(scope.row.price*scope.row.count)}}
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="备注" min-width="20" align="center">
  64. <template slot-scope="scope">
  65. <el-popover placement="top-start" width="250" trigger="hover">
  66. <div>{{scope.row.remark}}</div>
  67. <span slot="reference"
  68. v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
  69. <span slot="reference" v-else>{{ scope.row.remark}}</span>
  70. </el-popover>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. </el-row>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { uParseTime } from '@/utils/tools'
  80. import { deleteWarehouseOut, GetAllConfig, getWarehouseOutInfo } from '@/api/stock'
  81. import BreadCrumb from '../components/bread-crumb'
  82. export default {
  83. name: 'stockInOrderDetail',
  84. components: { BreadCrumb },
  85. created() {
  86. const order_id = this.$route.query.id
  87. this.GetConfigInfo()
  88. this.GetOrderDetail(order_id)
  89. },
  90. data() {
  91. return {
  92. crumbs: [
  93. { path: false, name: '库存管理' },
  94. { path: '/stock/out', name: '出库单' },
  95. { path: '/stock/out/detail', name: '出库单详情' }
  96. ],
  97. isEdit: 0,
  98. checked: false,
  99. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  100. goodType: [],
  101. goodInfo: [],
  102. manufacturer: [],
  103. dealer: [],
  104. warehousingOutInfo: {
  105. loading: false,
  106. warehousingOutData: [],
  107. info: {}
  108. }
  109. }
  110. },
  111. methods: {
  112. getSpecificationName: function(id) {
  113. let name = ''
  114. for (let i = 0; i < this.goodInfo.length; i++) {
  115. if (this.goodInfo[i].id == id) {
  116. name = this.goodInfo[i].specification_name
  117. }
  118. }
  119. return name
  120. }, getTypeName: function(id) {
  121. let name = ''
  122. for (let i = 0; i < this.goodType.length; i++) {
  123. if (this.goodType[i].id == id) {
  124. name = this.goodType[i].type_name
  125. }
  126. }
  127. return name
  128. }, GetConfigInfo: function() {
  129. GetAllConfig().then(response => {
  130. if (response.data.state == 0) {
  131. this.$message.error(response.data.msg)
  132. return false
  133. } else {
  134. this.manufacturer = response.data.data.manufacturer
  135. this.dealer = response.data.data.dealer
  136. this.goodInfo = response.data.data.goodInfo
  137. this.goodType = response.data.data.goodType
  138. }
  139. })
  140. }, getManufactuerName: function(manufacturer_id) {
  141. for (let i = 0; i < this.manufacturer.length; i++) {
  142. if (this.manufacturer[i].id == manufacturer_id) {
  143. return this.manufacturer[i].manufacturer_name
  144. }
  145. }
  146. }, getDealerName: function(dealer_id) {
  147. for (let i = 0; i < this.dealer.length; i++) {
  148. if (this.dealer[i].id == dealer_id) {
  149. return this.dealer[i].dealer_name
  150. }
  151. }
  152. }, calculate: function(val) {
  153. if (val == 0) {
  154. return ''
  155. }
  156. return Math.round(parseFloat(val) * 100) / 100
  157. }, GetOrderDetail: function(order_id) {
  158. const params = {
  159. 'id': order_id
  160. }
  161. getWarehouseOutInfo(params).then(response => {
  162. if (response.data.state == 0) {
  163. this.$message.error(response.data.msg)
  164. return false
  165. } else {
  166. for (let i = 0; i < response.data.data.list.length; i++) {
  167. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  168. }
  169. this.warehousingOutInfo.info = response.data.data.info
  170. }
  171. })
  172. }, deleteRecord: function() {
  173. const ids = []
  174. ids.push(this.warehousingOutInfo.info.id)
  175. const idStr = ids.join(',')
  176. const params = {
  177. ids: idStr
  178. }
  179. this.$confirm('确认删除退货单?', '删除退货单记录', {
  180. confirmButtonText: '确定',
  181. cancelButtonText: '取消',
  182. type: 'warning'
  183. }).then(() => {
  184. deleteWarehouseOut(params).then(response => {
  185. if (response.data.state == 0) {
  186. this.$message.error(response.data.msg)
  187. return false
  188. } else {
  189. this.$notify({
  190. title: '成功',
  191. message: '删除成功',
  192. type: 'success',
  193. duration: 2000
  194. })
  195. this.$router.back(-1)
  196. }
  197. })
  198. }).catch(() => {
  199. })
  200. }, editRecord: function() {
  201. this.$emit('edit-record')
  202. }
  203. }
  204. }
  205. </script>
  206. <style rel="stylesheet/css" lang="scss" scoped>
  207. .information {
  208. border: 1px #dcdfe6 solid;
  209. padding: 30px 20px 30px 20px;
  210. .border {
  211. border-bottom: 1px #dcdfe6 solid;
  212. margin: 0px 0 20px 0;
  213. }
  214. }
  215. .edit_separater {
  216. border-top: 1px solid rgb(233, 233, 233);
  217. margin-top: 15px;
  218. margin-bottom: 15px;
  219. }
  220. </style>
  221. <style>
  222. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  223. font-size: 12px;
  224. }
  225. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  226. background: #6fb5fa;
  227. }
  228. .count {
  229. color: #bd2c00;
  230. }
  231. </style>