detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <div class="billOfLadingDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="billOfLadingDetail-header" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="billOfLadingDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. </template>
  9. <!-- 操作区,位于 title 行的行尾 -->
  10. <template slot="extra">
  11. <a-button
  12. key="3"
  13. type="default"
  14. class="button-info"
  15. v-if="$hasPermissions('B_printPickUp')"
  16. id="billOfLadingDetail-preview-btn"
  17. @click="handlePrint('preview')">打印预览</a-button>
  18. <a-button
  19. key="2"
  20. type="primary"
  21. class="button-info"
  22. v-if="$hasPermissions('B_printPickUp')"
  23. id="billOfLadingDetail-print-btn"
  24. @click="handlePrint('print')">快捷打印</a-button>
  25. <a-divider type="vertical" />
  26. <a-button
  27. key="1"
  28. type="primary"
  29. class="button-warning"
  30. v-if="$hasPermissions('B_exportPickUp')"
  31. id="billOfLadingDetail-export-btn"
  32. @click="handlePrint('export')">导出Excel</a-button>
  33. </template>
  34. </a-page-header>
  35. <a-form-model
  36. ref="ruleForm"
  37. :model="form"
  38. :rules="rules"
  39. :label-col="formItemLayout.labelCol"
  40. :wrapper-col="formItemLayout.wrapperCol">
  41. <a-card :bordered="false" class="billOfLadingDetail-cont" v-if="form">
  42. <a-row>
  43. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  44. <a-form-model-item style="margin-bottom:0" label="提货单号">
  45. {{ form.pickUpNo||'--' }}
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  49. <a-form-model-item style="margin-bottom:0" label="创建时间">
  50. {{ form.createDate||'--' }}
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  54. <a-form-model-item style="margin-bottom:0" label="审核时间">
  55. {{ form.auditDate||'--' }}
  56. </a-form-model-item>
  57. </a-col>
  58. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  59. <a-form-model-item style="margin-bottom:0" label="状态">
  60. {{ form.stateDictValue||'--' }}
  61. </a-form-model-item>
  62. </a-col>
  63. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  64. <a-form-model-item style="margin-bottom:0" label="申请人">
  65. {{ form.applyPersonName||'--' }}
  66. </a-form-model-item>
  67. </a-col>
  68. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  69. <a-form-model-item style="margin-bottom:0" label="主题">
  70. {{ form.theme||'--' }}
  71. </a-form-model-item>
  72. </a-col>
  73. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  74. <a-form-model-item style="margin-bottom:0" label="物流公司">
  75. {{ form.logisticsCompany||'--' }}
  76. </a-form-model-item>
  77. </a-col>
  78. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  79. <a-form-model-item style="margin-bottom:0" label="物流点">
  80. {{ form.logisticsPoint }}
  81. </a-form-model-item>
  82. </a-col>
  83. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  84. <a-form-model-item style="margin-bottom:0" label="发货方">
  85. {{ form.dealerEntity&&form.dealerEntity.dealerName||'--' }}
  86. </a-form-model-item>
  87. </a-col>
  88. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  89. <a-form-model-item style="margin-bottom:0" label="收货人">
  90. {{ form.receiverName||'--' }}
  91. </a-form-model-item>
  92. </a-col>
  93. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  94. <a-form-model-item style="margin-bottom:0" label="电话">
  95. {{ form.receiverPhone||'--' }}
  96. </a-form-model-item>
  97. </a-col>
  98. <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  99. <a-form-model-item style="margin-bottom:0" label="件数">
  100. {{ form.goodsNum||'--' }} 件
  101. </a-form-model-item>
  102. </a-col>
  103. <a-col :span="24">
  104. <a-form-model-item style="margin-bottom:0" label="运费" :label-col="{span:2}" :wrapper-col="{span:20}">
  105. {{ form.freight||'--' }}
  106. </a-form-model-item>
  107. </a-col>
  108. </a-row>
  109. <a-row>
  110. <a-col :spna="24">
  111. <a-form-model-item style="margin-bottom:0" label="备注" prop="size" :label-col="{span:2}" :wrapper-col="{span:20}">
  112. <div style="word-break: break-all;line-height:normal;padding-top:10px;">{{ form.remarks||'--' }}</div>
  113. </a-form-model-item>
  114. </a-col>
  115. <a-col :spna="24">
  116. <a-form-model-item style="margin-bottom:10px" label="附件" :label-col="{span:2}" :wrapper-col="{span:20}">
  117. <div style="line-height:26px;">
  118. <div v-for="item in form.attachmentList" :key="item.id">
  119. <a :href="item.filePath">{{ item.fileName }}</a>
  120. </div>
  121. </div>
  122. </a-form-model-item>
  123. </a-col>
  124. <a-col :spna="24">
  125. <a-form-model-item label="关联销退单" :label-col="{span:2}" :wrapper-col="{span:20}">
  126. <a-table :columns="columns" :scroll="{ y: 400 }" :pagination="false" :data-source="chooseData" bordered>
  127. <!-- 编号 -->
  128. <template slot="no" slot-scope="text, record,index">
  129. <span>{{ index+1 }}</span>
  130. </template>
  131. <!-- 单号 -->
  132. <template slot="salesReturnBillNo" slot-scope="text, record">
  133. <span>{{ record.salesReturnBillNo }}</span>
  134. </template>
  135. </a-table>
  136. </a-form-model-item>
  137. </a-col>
  138. <a-col :spna="24" v-if="$hasPermissions('B_auditPickUp')&&form.state != 'WAIT_SUBMIT'">
  139. <a-form-model-item label="审核进度" :label-col="{span:2}" :wrapper-col="{span:20}">
  140. <div>以下信息来自钉钉</div>
  141. <s-table
  142. class="sTable fixPagination"
  143. ref="table"
  144. size="small"
  145. :rowKey="(record) => record.id"
  146. :columns="auditColumns"
  147. :data="loadData"
  148. :scroll="{ y: 400 }"
  149. :showPagination="false"
  150. :defaultLoadData="false"
  151. bordered>
  152. </s-table>
  153. </a-form-model-item>
  154. </a-col>
  155. </a-row>
  156. </a-card>
  157. </a-form-model>
  158. </a-spin>
  159. </div>
  160. </template>
  161. <script>
  162. import { commonMixin } from '@/utils/mixin'
  163. import { STable, VSelect, Upload } from '@/components'
  164. import { printFun, exportExcel } from '@/libs/JGPrint.js'
  165. import { pickUpDetail, pickUpDetailQueryList, pickUpExport, pickUpDetailPrint } from '@/api/pickUp'
  166. import { getProcessInstance } from '@/api/expenseManagement'
  167. export default {
  168. name: 'ProductInfoEdit',
  169. mixins: [commonMixin],
  170. components: { VSelect, Upload, STable },
  171. data () {
  172. return {
  173. spinning: false,
  174. showXtModal: false,
  175. formItemLayout: {
  176. labelCol: { span: 4 },
  177. wrapperCol: { span: 16 }
  178. },
  179. form: {
  180. applyPersonSn: undefined, // 申请人
  181. applyPersonName: undefined,
  182. theme: '', // 主题
  183. logisticsCompany: undefined, // 物流公司
  184. logisticsPoint: undefined, // 物流点
  185. senderName: '', // 发货方
  186. senderSn: '',
  187. receiverName: '', // 收货人
  188. receiverPhone: '', // 电话
  189. goodsNum: '', // 件数
  190. freight: '', // 运费
  191. remarks: '',
  192. attachmentList: [] // 附件
  193. },
  194. rules: {},
  195. chooseData: [],
  196. columns: [
  197. { title: '序号', scopedSlots: { customRender: 'no' }, width: '8%', align: 'center' },
  198. { title: '总部销退单号', dataIndex: 'salesReturnBillNo', width: '15%', align: 'center' },
  199. { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  200. { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  201. { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  202. { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
  203. ],
  204. auditData: [],
  205. auditColumns: [
  206. { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
  207. { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
  208. { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  209. { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  210. { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  211. { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
  212. { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
  213. ],
  214. // 加载数据方法 必须为 Promise 对象
  215. loadData: parameter => {
  216. this.spinning = true
  217. delete parameter.tableId
  218. delete parameter.index
  219. return getProcessInstance({ businessType: 'PICK_UP', businessSn: this.$route.params.sn }).then(res => {
  220. let data
  221. if (res.status == 200) {
  222. data = res.data
  223. const no = 0
  224. for (var i = 0; i < data.length; i++) {
  225. data[i].no = no + i + 1
  226. }
  227. this.disabled = false
  228. } else {
  229. this.isShow = false
  230. return []
  231. }
  232. this.spinning = false
  233. return data
  234. })
  235. }
  236. }
  237. },
  238. methods: {
  239. // 打印预览/快捷打印
  240. handlePrint (type) {
  241. const _this = this
  242. const params = { pickUpSn: this.$route.params.sn }
  243. _this.spinning = true
  244. // 导出
  245. if (type == 'export') {
  246. exportExcel(pickUpExport, params, '提货单', function () {
  247. _this.spinning = false
  248. })
  249. } else {
  250. // 打印或预览
  251. printFun(pickUpDetailPrint, params, type, '提货单', () => { _this.spinning = false })
  252. }
  253. },
  254. // 关联销售退货单
  255. getReturnOrderList () {
  256. pickUpDetailQueryList({ pickUpSn: this.$route.params.sn }).then(res => {
  257. this.chooseData = []
  258. res.data.map(item => {
  259. this.chooseData.push(item.salesReturnBillEntity)
  260. })
  261. })
  262. },
  263. // 详情
  264. getDetail () {
  265. this.spinning = true
  266. this.disabled = true
  267. pickUpDetail({ pickUpSn: this.$route.params.sn }).then(res => {
  268. if (res.status == 200) {
  269. const data = res.data
  270. this.form = Object.assign(this.form, data)
  271. if (this.form.state != 'WAIT_SUBMIT') {
  272. this.$refs.table.refresh()
  273. }
  274. } else {
  275. this.$refs.ruleForm.resetFields()
  276. }
  277. this.spinning = false
  278. this.disabled = false
  279. })
  280. },
  281. // 返回
  282. handleBack () {
  283. // this.$router.push({ name: 'billOfLadingList' })
  284. this.$router.go(-1)
  285. },
  286. pageInit () {
  287. this.form = {
  288. applyPersonSn: undefined, // 申请人
  289. applyPersonName: undefined,
  290. theme: '', // 主题
  291. logisticsCompany: undefined, // 物流公司
  292. logisticsPoint: undefined, // 物流点
  293. senderName: '', // 发货方
  294. senderSn: '',
  295. receiverName: '', // 收货人
  296. receiverPhone: '', // 电话
  297. goodsNum: '', // 件数
  298. freight: '', // 运费
  299. remarks: '',
  300. attachmentList: [] // 附件
  301. }
  302. this.$refs.ruleForm.resetFields()
  303. if (this.$route.params.sn) { // 编辑页
  304. this.getDetail()
  305. this.getReturnOrderList()
  306. }
  307. }
  308. },
  309. mounted () {
  310. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  311. this.pageInit()
  312. }
  313. },
  314. activated () {
  315. this.pageInit()
  316. },
  317. beforeRouteEnter (to, from, next) {
  318. next(vm => {})
  319. }
  320. }
  321. </script>
  322. <style lang="less">
  323. .billOfLadingDetail-wrap{
  324. position: relative;
  325. height: 100%;
  326. background-color:#fff;
  327. .billOfLadingDetail-cont{
  328. height:100%;
  329. overflow: auto;
  330. }
  331. .billOfLadingDetail-header{
  332. border-bottom: 8px solid #eee;
  333. }
  334. .affix{
  335. .ant-affix{
  336. z-index: 101;
  337. }
  338. }
  339. }
  340. </style>