uniqueCodeList.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="searchBoxNormal">
  4. <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
  5. <template slot="subTitle">
  6. <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  7. <span style="margin: 0 15px;color: #666;font-weight: bold;">出库单号:{{ detailData&&detailData.salesBillNo }}</span>
  8. <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
  9. <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
  10. <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
  11. </a-button>
  12. </template>
  13. </a-page-header>
  14. </a-card>
  15. <!-- 基础信息 -->
  16. <div ref="detailInfo" style="margin-bottom: 6px;" v-if="showDetail">
  17. <a-card size="small" :bordered="false" class="pages-wrap" >
  18. <div style="padding: 0;">
  19. <a-descriptions size="small" :column="3">
  20. <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="销售单号">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="备货单号">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="收货客户名称">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="发货编号">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="收货人">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
  27. <a-descriptions-item label="收货电话">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
  28. <a-descriptions-item label="收货地址">{{ shippingAddress||'--' }}</a-descriptions-item>
  29. <a-descriptions-item label="业务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
  30. <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
  31. </a-descriptions>
  32. </div>
  33. </a-card>
  34. </div>
  35. <a-card size="small" :bordered="false">
  36. <a-spin :spinning="spinning" tip="Loading...">
  37. <!-- 搜索条件 -->
  38. <div ref="tableSearch" class="table-page-search-wrapper">
  39. <a-form layout="inline">
  40. <a-row :gutter="15">
  41. <a-col :md="6" :sm="24">
  42. <a-form-item label="产品编码">
  43. <a-input v-model.trim="queryParam.outBizSubNo" allowClear placeholder="请输入产品编码"/>
  44. </a-form-item>
  45. </a-col>
  46. <a-col :md="6" :sm="24">
  47. <a-form-item label="唯一码">
  48. <a-input v-model.trim="queryParam.demanderName" allowClear placeholder="请输入唯一码"/>
  49. </a-form-item>
  50. </a-col>
  51. <a-col :md="6" :sm="24">
  52. <a-form-item label="产品名称">
  53. <a-input v-model.trim="queryParam.demanderName" allowClear placeholder="请输入产品名称"/>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :md="6" :sm="24">
  57. <span class="table-page-search-submitButtons">
  58. <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
  59. <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
  60. </span>
  61. </a-col>
  62. </a-row>
  63. </a-form>
  64. <div style="margin-bottom:10px;">
  65. <a-button
  66. type="primary"
  67. id="outboundOrder-export"
  68. :loading="loading"
  69. @click="openGuideModal = true">导入</a-button>
  70. <span style="margin-left:6px;color:#f30;">每次都需全部导完,请在导入列表中修改后重新全部导入。</span>
  71. </div>
  72. </div>
  73. <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">
  74. <div slot="message">
  75. <span v-if="$route.params.type!='stockOut'">
  76. 轮胎款数:<strong>{{ detailData&&(detailData.totalSalesQty || detailData.totalSalesQty==0) ? detailData.totalSalesQty : '--' }}</strong>;
  77. </span>
  78. 轮胎总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
  79. </div>
  80. </a-alert>
  81. <!-- 表格数据 -->
  82. <s-table
  83. class="sTable"
  84. ref="table"
  85. :style="{ height: tableHeight+70+'px' }"
  86. size="small"
  87. :rowKey="(record) => record.id"
  88. :columns="columns"
  89. :data="loadData"
  90. :pageSize="30"
  91. :scroll="{ y: tableHeight }"
  92. bordered>
  93. </s-table>
  94. </a-spin>
  95. </a-card>
  96. <!-- 导入轮胎唯一码 -->
  97. <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="handleGuideOk" />
  98. </div>
  99. </template>
  100. <script>
  101. import { commonMixin } from '@/utils/mixin'
  102. import { STable } from '@/components'
  103. import { stockOutList } from '@/api/stockOut'
  104. import importGuideModal from './importGuideModal.vue'
  105. export default {
  106. name: 'UniqueCodeList',
  107. mixins: [commonMixin],
  108. components: { STable, importGuideModal },
  109. data () {
  110. return {
  111. disabled: false,
  112. spinning: false,
  113. handlePlData: [],
  114. queryParam: {
  115. outBizSubNo: '',
  116. demanderName: '',
  117. receiverSn: undefined,
  118. warehouseSn: undefined,
  119. outBizTypeList: ['SALES', 'ALLOCATE']
  120. },
  121. orginData: [],
  122. // 加载数据方法 必须为 Promise 对象
  123. loadData: parameter => {
  124. this.disabled = true
  125. this.spinning = true
  126. return stockOutList(Object.assign(parameter, this.queryParam)).then(res => {
  127. let data
  128. if (res.status == 200) {
  129. data = res.data
  130. const no = (data.pageNo - 1) * data.pageSize
  131. for (var i = 0; i < data.list.length; i++) {
  132. data.list[i].no = no + i + 1
  133. }
  134. this.disabled = false
  135. }
  136. this.spinning = false
  137. this.orginData = data.list
  138. return data
  139. })
  140. },
  141. snList: [],
  142. openGuideModal: false,
  143. columns: [
  144. { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
  145. { title: '产品编码', dataIndex: 'stockOutNo', width: '25%', align: 'center' },
  146. { title: '唯一码', dataIndex: 'outBizSubNo', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
  147. { title: '产品名称', dataIndex: 'demanderName', width: '50%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
  148. ],
  149. detailData: null,
  150. tableHeight: 0,
  151. isHasId: true,
  152. showDetail:false
  153. }
  154. },
  155. watch: {
  156. showDetail (newValue, oldValue) {
  157. const _this = this
  158. this.$nextTick(() => { // 页面渲染完成后的回调
  159. _this.setTableH()
  160. })
  161. },
  162. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  163. this.setTableH()
  164. }
  165. },
  166. methods: {
  167. // 返回
  168. handleBack () {
  169. this.$router.push({ name: 'outboundOrder' })
  170. },
  171. handleGuideOk () {
  172. },
  173. custChange (val) {
  174. this.queryParam.receiverSn = val.key || ''
  175. },
  176. // 删除
  177. handleDel (row) {
  178. const i = this.chooseData.findIndex(item => row.stockOutSn == item.stockOutSn)
  179. this.chooseData.splice(i, 1)
  180. const oi = this.orginData.findIndex(item => row.stockOutSn == item.stockOutSn)
  181. if (oi >= 0) {
  182. this.orginData[oi].checked = false
  183. }
  184. },
  185. // 选择
  186. handleChoose (row) {
  187. row.checked = true
  188. this.chooseData.push(row)
  189. this.$emit('choose')
  190. },
  191. // 取消
  192. handleCommonCancel () {
  193. this.$emit('cancel')
  194. },
  195. // 重置
  196. resetSearchForm () {
  197. this.queryParam = {
  198. outBizSubNo: '',
  199. demanderName: '',
  200. receiverSn: undefined,
  201. warehouseSn: undefined,
  202. outBizTypeList: ['SALES', 'ALLOCATE']
  203. }
  204. this.orginData = []
  205. if (this.$refs.table) {
  206. this.$refs.table.refresh(true)
  207. }
  208. },
  209. pageInit () {
  210. const _this = this
  211. this.$nextTick(() => { // 页面渲染完成后的回调
  212. _this.setTableH()
  213. })
  214. },
  215. setTableH () {
  216. const tableSearchH = this.$refs.tableSearch.offsetHeight
  217. const detailInfoH = this.showDetail? this.$refs.detailInfo.offsetHeight : 0
  218. this.tableHeight = window.innerHeight - tableSearchH - detailInfoH -255
  219. }
  220. },
  221. mounted () {
  222. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  223. this.pageInit()
  224. this.resetSearchForm()
  225. }
  226. },
  227. activated () {
  228. // 如果是新页签打开,则重置当前页面
  229. if (this.$store.state.app.isNewTab) {
  230. this.pageInit()
  231. this.resetSearchForm()
  232. }
  233. // 仅刷新列表,不重置页面
  234. if (this.$store.state.app.updateList) {
  235. this.pageInit()
  236. this.$refs.table.refresh()
  237. }
  238. },
  239. beforeRouteEnter (to, from, next) {
  240. next(vm => {})
  241. }
  242. }
  243. </script>
  244. <style lang="less">
  245. </style>