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

stockOutOrderDetail.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
  5. <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
  6. </div>
  7. <div class="app-container">
  8. <div class="filter-container">
  9. <span style="font-size: 18px;color: #606266">出库单详情</span>
  10. <el-row style="float:right;">
  11. <span style="color: #606266">出库单号:{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
  12. </el-row>
  13. </div>
  14. <div class="cell clearfix">
  15. <span style="width: 300px;color: #606266">单据日期: {{warehousingOutInfo.info.warehouse_out_time | parseTime('{y}-{m}-{d}')}} </span>
  16. <span style="width: 300px;color: #606266">厂商 {{getManufactuerName(warehousingOutInfo.info.manufacturer)}}</span>
  17. <span style="width: 300px;color: #606266">经销商 {{getDealerName(warehousingOutInfo.info.dealer)}}</span>
  18. </div>
  19. <div style="display:flex;justify-content: space-between;align-items: center;margin: 12px 0;">
  20. <div>
  21. <el-button size="small" icon="el-icon-edit" @click="editRecord" v-if="warehousingOutInfo.info.is_sys != 1">编辑</el-button>
  22. <el-button size="small" icon="el-icon-delete" @click="deleteRecord" v-if="warehousingOutInfo.info.is_sys != 1">删除</el-button>
  23. </div>
  24. <el-button size="small" type="primary" @click="printOrder">打印</el-button>
  25. </div>
  26. <el-row :gutter="12" style="margin-top: 10px">
  27. <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
  28. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  29. :span-method="merge"
  30. >
  31. <el-table-column min-width="35" align="center">
  32. <template slot="header" slot-scope="scope">
  33. <span>耗材类型</span>
  34. </template>
  35. <template slot-scope="scope">
  36. <span v-if="scope.row.good_type_id != 0">{{getTypeName(scope.row.good_type_id)}}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column min-width="35" align="center">
  40. <template slot="header" slot-scope="scope">
  41. <span>耗材名称</span>
  42. </template>
  43. <template slot-scope="scope">
  44. <span v-if="scope.row.good_id != 0">{{getTypeNameOne(scope.row.good_id)}}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column min-width="35" align="center">
  48. <template slot="header" slot-scope="scope">
  49. <span>规格型号</span>
  50. </template>
  51. <template slot-scope="scope">
  52. <span v-if="scope.row.good_id != 0">{{getSpecificationName(scope.row.good_id)}}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column min-width="23" align="center">
  56. <template slot="header" slot-scope="scope">
  57. <span>出货价</span>
  58. </template>
  59. <template slot-scope="scope">
  60. <span>{{scope.row.price}}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column min-width="23" align="center">
  64. <template slot="header" slot-scope="scope">
  65. <span>出库数量</span>
  66. </template>
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.is_sys == 0">{{scope.row.count}}</span>
  69. <span v-if="scope.row.is_sys == 1">{{getOutStockCount(scope.row.good_id)}}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="总价" min-width="20" align="center">
  73. <template slot-scope="scope">
  74. {{calculate(scope.row.price*scope.row.count)}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="备注" min-width="20" align="center">
  78. <template slot-scope="scope">
  79. <el-popover placement="top-start" width="250" trigger="hover">
  80. <div>{{scope.row.remark}}</div>
  81. <span slot="reference"
  82. v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
  83. <span slot="reference" v-else>{{ scope.row.remark}}</span>
  84. </el-popover>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="" align="center" >
  88. <template slot-scope="scope" v-if="scope.row.is_sys == 1">
  89. <div style="color: #589ff8" @click="jump(scope.row)">使用明细</div>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. </el-row>
  94. </div>
  95. </div>
  96. </template>
  97. <script>
  98. import { uParseTime } from '@/utils/tools'
  99. import { deleteWarehouseOut, GetAllConfig, getWarehouseOutInfo,GetOutStockTotalCount } from '@/api/stock'
  100. import BreadCrumb from '../components/bread-crumb'
  101. export default {
  102. name: 'stockInOrderDetail',
  103. components: { BreadCrumb },
  104. created() {
  105. const order_id = this.$route.query.id
  106. const warehouse_out_time = this.$route.query.warehouse_out_time
  107. console.log("时间搓",warehouse_out_time)
  108. this.GetConfigInfo()
  109. this.GetOrderDetail(order_id)
  110. this.GetTotalCount(warehouse_out_time)
  111. },
  112. data() {
  113. return {
  114. tempArr: [],
  115. sameRowArr: [],
  116. crumbs: [
  117. { path: false, name: '库存管理' },
  118. { path: false, name: '耗材出库单' },
  119. { path: false, name: '出库单详情' }
  120. ],
  121. crumbs2: [
  122. { path: false, name: '库存管理' },
  123. { path: false, name: '其他出库单' },
  124. { path: false, name: '出库单详情' }
  125. ],
  126. isEdit: 0,
  127. checked: false,
  128. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  129. goodType: [],
  130. goodInfo: [],
  131. manufacturer: [],
  132. dealer: [],
  133. warehousingOutInfo: {
  134. loading: false,
  135. warehousingOutData: [],
  136. info: {}
  137. },
  138. stockCount:[]
  139. }
  140. },
  141. methods: {
  142. getSpecificationName: function(id) {
  143. let name = ''
  144. for (let i = 0; i < this.goodInfo.length; i++) {
  145. if (this.goodInfo[i].id == id) {
  146. name = this.goodInfo[i].specification_name
  147. }
  148. }
  149. return name
  150. },
  151. getTypeName: function(id) {
  152. let name = ''
  153. for (let i = 0; i < this.goodType.length; i++) {
  154. if (this.goodType[i].id == id) {
  155. name = this.goodType[i].type_name
  156. }
  157. }
  158. return name
  159. },
  160. getTypeNameOne: function(id) {
  161. let name = ''
  162. for (let i = 0; i < this.goodInfo.length; i++) {
  163. if (this.goodInfo[i].id == id) {
  164. name = this.goodInfo[i].good_name
  165. }
  166. }
  167. return name
  168. },
  169. GetConfigInfo: function() {
  170. GetAllConfig().then(response => {
  171. if (response.data.state == 0) {
  172. this.$message.error(response.data.msg)
  173. return false
  174. } else {
  175. this.manufacturer = response.data.data.manufacturer
  176. this.dealer = response.data.data.dealer
  177. this.goodInfo = response.data.data.goodInfo
  178. this.goodType = response.data.data.goodType
  179. }
  180. })
  181. }, getManufactuerName: function(manufacturer_id) {
  182. for (let i = 0; i < this.manufacturer.length; i++) {
  183. if (this.manufacturer[i].id == manufacturer_id) {
  184. return this.manufacturer[i].manufacturer_name
  185. }
  186. }
  187. }, getDealerName: function(dealer_id) {
  188. for (let i = 0; i < this.dealer.length; i++) {
  189. if (this.dealer[i].id == dealer_id) {
  190. return this.dealer[i].dealer_name
  191. }
  192. }
  193. },
  194. calculate: function(val) {
  195. if (val == 0) {
  196. return ''
  197. }
  198. return Math.round(parseFloat(val) * 100) / 100
  199. },
  200. GetOrderDetail: function(order_id) {
  201. const params = {
  202. 'id': order_id
  203. }
  204. getWarehouseOutInfo(params).then(response => {
  205. if (response.data.state == 0) {
  206. this.$message.error(response.data.msg)
  207. return false
  208. } else {
  209. for (let i = 0; i < response.data.data.list.length; i++) {
  210. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  211. }
  212. this.warehousingOutInfo.info = response.data.data.info
  213. console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
  214. this.handleSpanTempArr()
  215. }
  216. })
  217. },
  218. deleteRecord: function() {
  219. const ids = []
  220. ids.push(this.warehousingOutInfo.info.id)
  221. const idStr = ids.join(',')
  222. const params = {
  223. ids: idStr
  224. }
  225. this.$confirm('确认删除出库单?', '删除出库单记录', {
  226. confirmButtonText: '确定',
  227. cancelButtonText: '取消',
  228. type: 'warning'
  229. }).then(() => {
  230. deleteWarehouseOut(params).then(response => {
  231. if (response.data.state == 0) {
  232. this.$message.error(response.data.msg)
  233. return false
  234. } else {
  235. this.$notify({
  236. title: '成功',
  237. message: '删除成功',
  238. type: 'success',
  239. duration: 2000
  240. })
  241. this.$router.back(-1)
  242. }
  243. })
  244. }).catch(() => {
  245. })
  246. },
  247. editRecord: function() {
  248. this.$emit('edit-record')
  249. },
  250. jump(row){
  251. this.$router.push({
  252. name: 'user_detail',
  253. query: { id: row.id }
  254. })
  255. },merge({ row, column, rowIndex, columnIndex }) {
  256. if (columnIndex === 0) {
  257. const _row = this.tempArr[rowIndex]
  258. const _col = _row > 0 ? 1 : 0
  259. return {
  260. rowspan: _row,
  261. colspan: _col
  262. }
  263. }
  264. },
  265. handleSpanTempArr(){
  266. this.tempArr = []
  267. for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
  268. if (i === 0) {
  269. this.tempArr.push(1)
  270. this.pos = 0
  271. } else {
  272. // 判断当前元素与上一个元素是否相同
  273. if (this.warehousingOutInfo.warehousingOutData[i].good_type_id === this.warehousingOutInfo.warehousingOutData[i - 1].good_type_id) {
  274. this.tempArr[this.pos] += 1
  275. this.tempArr.push(0)
  276. } else {
  277. this.tempArr.push(1)
  278. this.pos = i
  279. }
  280. }
  281. }
  282. let sameRowArr = [], sIdx = 0
  283. this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
  284. item.index = index
  285. if (index === 0) {
  286. sameRowArr.push([index])
  287. } else {
  288. if (item.good_type_id === this.warehousingOutInfo.warehousingOutData[index - 1].good_type_id) {
  289. sameRowArr[sIdx].push(index)
  290. } else {
  291. sIdx = sIdx + 1
  292. sameRowArr.push([index])
  293. }
  294. }
  295. })
  296. this.sameRowArr = sameRowArr
  297. },
  298. GetTotalCount(time){
  299. var params = {
  300. warehouse_out_time:time
  301. }
  302. GetOutStockTotalCount(params).then(response=>{
  303. if(response.data.state == 1){
  304. var stockCount = response.data.data.stockCount
  305. console.log("stockCount",stockCount)
  306. this.stockCount = stockCount
  307. }
  308. })
  309. },
  310. getOutStockCount(id){
  311. var count = 0
  312. for(let i=0;i<this.stockCount.length;i++){
  313. if(id == this.stockCount[i].good_id){
  314. count = this.stockCount[i].count
  315. }
  316. }
  317. return count
  318. },
  319. printOrder(){
  320. this.$router.push({
  321. name: "stockOutDetailPrint",
  322. query: { id: this.$route.query.id,warehouse_out_time:this.$route.query.warehouse_out_time }
  323. });
  324. }
  325. }
  326. }
  327. </script>
  328. <style rel="stylesheet/css" lang="scss" scoped>
  329. .information {
  330. border: 1px #dcdfe6 solid;
  331. padding: 30px 20px 30px 20px;
  332. .border {
  333. border-bottom: 1px #dcdfe6 solid;
  334. margin: 0px 0 20px 0;
  335. }
  336. }
  337. .edit_separater {
  338. border-top: 1px solid rgb(233, 233, 233);
  339. margin-top: 15px;
  340. margin-bottom: 15px;
  341. }
  342. </style>
  343. <style>
  344. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  345. font-size: 12px;
  346. }
  347. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  348. background: #6fb5fa;
  349. }
  350. .count {
  351. color: #bd2c00;
  352. }
  353. .el-table__body div > div:hover {
  354. background-color: #409eff !important;
  355. color: #fff !important;
  356. }
  357. </style>