warehouseManagementIossRecord.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <!--仓库管理-->
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">盘损详情</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnWarehouse()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <div class="connert">
  25. <h2>
  26. <img
  27. style="position: relative; top: 2px"
  28. width="19"
  29. height="19"
  30. src="../../../public/img/cangku.png"
  31. alt=""
  32. />
  33. <span style="color: #323233">{{ deptBudgetList.warehouseName }}</span>
  34. <span class="ware">{{ binNumber }}仓位</span>
  35. </h2>
  36. <el-table
  37. class="wenzi"
  38. :data="contractList.records"
  39. style="width: 100%; margin-top: 20px"
  40. height="630"
  41. >
  42. <el-table-column type="index" label="序号">
  43. <template scope="scope">
  44. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  45. <span v-else>{{ scope.$index + 1 }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="goodsName" label="货名"> </el-table-column>
  49. <el-table-column prop="cumulativeStockIn" label="当前累计入库(吨)">
  50. </el-table-column>
  51. <el-table-column prop="cumulativeStockOut" label="当前累计出库(吨)">
  52. </el-table-column>
  53. <el-table-column prop="surplusInventory" label="应余库存">
  54. </el-table-column>
  55. <el-table-column prop="physicalInventory" label="实际库存(吨)">
  56. <template slot-scope="scope">
  57. <span style="color: #5473e8">{{
  58. scope.row.physicalInventory
  59. }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="loss" label="损耗量(吨)">
  63. <template slot-scope="scope">
  64. <span style="color: #ff9f24">{{ scope.row.loss }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="inventoryRatio" label="库损比例(‰)">
  68. <template slot-scope="scope">
  69. <span v-if="scope.row.inventoryRatio < 3" style="color: #8890b1">{{
  70. scope.row.inventoryRatio
  71. }}</span>
  72. <span v-if="scope.row.inventoryRatio > 3" style="color: #fc5061">{{
  73. scope.row.inventoryRatio
  74. }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="qualityInspector" label="操作人">
  78. </el-table-column>
  79. <el-table-column prop="createDate" label="录入时间"> </el-table-column>
  80. </el-table>
  81. <div style="text-align: center; padding: 10px">
  82. <el-pagination
  83. @size-change="handleSizeChange"
  84. @current-change="handleCurrentChange"
  85. :current-page="currentPage"
  86. :page-size="deptCircularPage.pageSize"
  87. layout="total, sizes, prev, pager, next, jumper"
  88. :total="deptBudgetTotal"
  89. >
  90. </el-pagination>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import { adjustmentrecordList } from '@/model/warehouse/index'
  97. import { downloadFile } from '@/utils/batchDown'
  98. import Pagination from '@/components/Pagination'
  99. import WsUpload from '@/components/WsUpload'
  100. //import { dayjs, fmoney, EventBus } from 'base-core-lib'
  101. import { dayjs, EventBus } from 'base-core-lib'
  102. export default {
  103. name: 'viewSpareMoney',
  104. components: {
  105. WsUpload,
  106. Pagination,
  107. },
  108. watch: {
  109. vesselId(val) {
  110. this.getList()
  111. },
  112. isShow(val) {
  113. this.showType = val
  114. },
  115. },
  116. data() {
  117. return {
  118. //弹出框
  119. dialogViewSpareMoney: false,
  120. dialogApproveFormVisible: false,
  121. // 船舶类型
  122. monetaryKey: null,
  123. // 表格显示数据
  124. tableDate: [],
  125. // 是否显示
  126. showType: true,
  127. // 年
  128. year: '',
  129. currentPage: 1,
  130. pageSize: 10,
  131. searchType: '',
  132. searchTypeText: '未完成',
  133. searchKeyWord: '',
  134. contractType: 2,
  135. startDate: null,
  136. endDate: null,
  137. // 提交类型
  138. submitType: true,
  139. size: 10,
  140. compId: localStorage.getItem('ws-pf_compId'),
  141. deptCircularPage: {},
  142. date: {
  143. year: dayjs().format('YYYY'),
  144. month: dayjs().format('MM'),
  145. },
  146. contractList: [],
  147. deptBudgetList: {},
  148. historyList: [],
  149. binNumber: '',
  150. deptBudgetTotal: 0,
  151. currentPage: 1,
  152. pageSize: 10,
  153. accessoryTFs: false,
  154. }
  155. },
  156. activated() {
  157. //cg.viewBudget
  158. //cg.viewSpareMoney
  159. // this.getVesselData();
  160. this.deptBudgetList.baseId = this.$route.query.baseId
  161. this.deptBudgetList.positionId = this.$route.query.positionId
  162. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  163. this.binNumber = this.$route.query.binNumber
  164. this.getList()
  165. this.showType = this.isShow
  166. },
  167. methods: {
  168. returnWarehouse() {
  169. this.$router.go(-1)
  170. },
  171. dateFormat(fmt, date) {
  172. let ret
  173. const opt = {
  174. 'Y+': date.getFullYear().toString(), // 年
  175. 'm+': (date.getMonth() + 1).toString(), // 月
  176. 'd+': date.getDate().toString(), // 日
  177. 'H+': date.getHours().toString(), // 时
  178. // "M+": date.getMinutes().toString(), // 分
  179. // "S+": date.getSeconds().toString() // 秒
  180. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  181. }
  182. for (let k in opt) {
  183. ret = new RegExp('(' + k + ')').exec(fmt)
  184. if (ret) {
  185. fmt = fmt.replace(
  186. ret[1],
  187. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  188. )
  189. }
  190. }
  191. return fmt
  192. },
  193. handleClose() {
  194. this.accessoryTFs = false
  195. },
  196. handleSizeChange(val) {
  197. console.log(`每页 ${val} 条`)
  198. this.pageSize = val
  199. this.getList()
  200. },
  201. handleCurrentChange(val) {
  202. this.currentPage = val
  203. console.log(`当前页: ${val}`)
  204. this.getList()
  205. },
  206. getList() {
  207. adjustmentrecordList({
  208. compId: localStorage.getItem('ws-pf_compId'),
  209. baseId: this.deptBudgetList.baseId,
  210. positionId: this.deptBudgetList.positionId,
  211. warehouseName: this.deptBudgetList.warehouseName,
  212. searchType: this.searchType,
  213. currentPage: this.currentPage,
  214. pageSize: this.pageSize,
  215. })
  216. .toPromise()
  217. .then((response) => {
  218. for (var i = 0; i < response.records.length; i++) {
  219. if (response.records[i].addressUrl != null) {
  220. response.records[i].addressUrlArray = response.records[
  221. i
  222. ].addressUrl.split(',')
  223. } else {
  224. response.records[i].addressUrlArray = []
  225. }
  226. }
  227. this.deptCircularPage.currentPage = response.current
  228. this.deptCircularPage.pageSize = response.size
  229. this.deptBudgetTotal = response.total
  230. this.contractList = response
  231. })
  232. },
  233. editClick(row) {
  234. var status = ''
  235. if (row.status == '待执行' || row.status == '已完成') {
  236. status = '执行中'
  237. } else if (row.status == '执行中') {
  238. status = '已完成'
  239. }
  240. //cancelButtonClass: "btn-custom-cancel"
  241. this.$confirm(`是否将状态改为${status}`, {
  242. confirmButtonText: '确定',
  243. cancelButtonText: '取消',
  244. type: 'warning',
  245. })
  246. .then(() => {
  247. editstatus({ id: row.id })
  248. .toPromise()
  249. .then((response) => {
  250. this.$notify.success({
  251. title: '成功',
  252. message: '状态修改成功',
  253. })
  254. this.getList()
  255. })
  256. .catch((response) => {
  257. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  258. })
  259. })
  260. .catch(() => {
  261. return false
  262. })
  263. },
  264. selecttaskType(e) {
  265. for (var i = 0; i < this.taskTypeList.length; i++) {
  266. if (this.taskTypeList[i].value == e) {
  267. this.searchType = this.taskTypeList[i].type
  268. }
  269. }
  270. },
  271. fujian(row) {
  272. if (
  273. row.receiveAttachmentPath === null ||
  274. row.receiveAttachmentPath === ''
  275. ) {
  276. EventBus.$emit(
  277. 'warning',
  278. this.$t('system.noticeCircular.NoInformation')
  279. )
  280. } else {
  281. this.accessoryTFs = true
  282. }
  283. this.appendixIdss = row.receiveAttachmentPath
  284. },
  285. handleExamine(row) {
  286. this.$router.push({
  287. name: 'salesContractExamine',
  288. query: { id: row.id },
  289. })
  290. },
  291. // 关闭 dialog时 处理文件url 初始化upload组件
  292. handleCloe() {
  293. this.dialogViewSpareMoney = false
  294. },
  295. history(row) {
  296. console.log(row)
  297. billoperatehis({ id: row.id })
  298. .toPromise()
  299. .then((response) => {
  300. this.historyList = response
  301. })
  302. },
  303. find() {
  304. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  305. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  306. this.currentPage = 1
  307. this.getList()
  308. },
  309. async exportlist() {
  310. const { data } = await export1(
  311. {
  312. compId: localStorage.getItem('ws-pf_compId'),
  313. contractType: this.contractType,
  314. currentPage: this.currentPage,
  315. pageSize: this.pageSize,
  316. searchType: this.searchType,
  317. searchKeyWord: this.searchKeyWord,
  318. startDate: this.startDate,
  319. endDate: this.endDate,
  320. },
  321. {},
  322. { responseType: 'blob' }
  323. ).toPromise()
  324. downloadFile({
  325. res: data,
  326. fileName: `${
  327. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  328. }_采购合同`,
  329. type: 'xls',
  330. })
  331. },
  332. },
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. .bg-left {
  337. padding-left: 10px;
  338. }
  339. .bg-right {
  340. padding: 16px;
  341. text-align: right;
  342. }
  343. .connert {
  344. width: 90%;
  345. margin: 0 auto;
  346. }
  347. .vertical-text-left {
  348. width: 62px;
  349. text-align: right;
  350. }
  351. .ware {
  352. font-size: 12px;
  353. color: rgb(255, 255, 255);
  354. background: rgb(175, 181, 203);
  355. padding: 3px;
  356. position: relative;
  357. top: -1px;
  358. border-radius: 3px;
  359. text-align: center;
  360. }
  361. .title {
  362. position: relative;
  363. }
  364. .title::before {
  365. content: '';
  366. display: inline-block;
  367. width: 5px;
  368. height: 30px;
  369. background: #5473e8;
  370. position: absolute;
  371. left: 0;
  372. }
  373. .ws-info-table {
  374. border-left: 1px solid transparent;
  375. border-top: 1px solid transparent;
  376. }
  377. .el-button--primary {
  378. background-color: #5878e8;
  379. border-color: #5878e8;
  380. }
  381. .el-col {
  382. background: #f6f7fc;
  383. }
  384. </style>