edit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <div class="chainTransferOutEdit-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutEdit-back" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <a class="head-order-number">单号:{{ basicInfoData&&basicInfoData.allocationLinkageOutNo || '--' }}</a>
  9. <span style="margin: 0 15px;color: #666;">调往对象:{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</span>
  10. </template>
  11. <!-- 操作区,位于 title 行的行尾 -->
  12. <template slot="extra" v-if="$hasPermissions('B_allocLinkageOutPrint')">
  13. <Print :disabled="localDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print>
  14. </template>
  15. </a-page-header>
  16. <!-- 选择产品 -->
  17. <div class="chainTransferOutEdit-cont">
  18. <a-collapse :activeKey="['1']">
  19. <a-collapse-panel key="1" header="选择产品">
  20. <!-- 筛选条件 -->
  21. <div class="table-page-search-wrapper">
  22. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  23. <a-row :gutter="15">
  24. <a-col :md="6" :sm="24">
  25. <a-form-item label="产品编码" prop="productCode">
  26. <a-input id="chainTransferOutEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="产品名称" prop="productName">
  31. <a-input id="chainTransferOutEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
  32. </a-form-item>
  33. </a-col>
  34. <a-col :md="6" :sm="24">
  35. <a-form-item label="原厂编码" prop="productOrigCode">
  36. <a-input id="chainTransferOutEdit-productOrigCode" v-model.trim="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
  37. </a-form-item>
  38. </a-col>
  39. <template v-if="advanced">
  40. <a-col :md="6" :sm="24">
  41. <a-form-model-item label="产品品牌">
  42. <ProductBrand id="chainTransferOutEdit-brandSn" placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="24">
  46. <a-form-model-item label="产品分类">
  47. <ProductType id="chainTransferOutEdit-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
  48. </a-form-model-item>
  49. </a-col>
  50. <a-col :md="6" :sm="24">
  51. <a-form-item label="仓库">
  52. <a-select id="chainTransferOutEdit-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
  53. <a-select-option v-for="item in warehouseList" :id="'warehouseSn-'+item.warehouseSn" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
  54. </a-select>
  55. </a-form-item>
  56. </a-col>
  57. </template>
  58. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  59. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
  60. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
  61. <a @click="advanced=!advanced" style="margin-left: 8px" id="chainTransferOutEdit-advanced">
  62. {{ advanced ? '收起' : '展开' }}
  63. <a-icon :type="advanced ? 'up' : 'down'"/>
  64. </a>
  65. </a-col>
  66. </a-row>
  67. </a-form>
  68. </div>
  69. <!-- 列表 -->
  70. <s-table
  71. class="sTable"
  72. ref="table"
  73. size="small"
  74. :rowKey="(record) => record.stockDetailSn"
  75. rowKeyName="stockDetailSn"
  76. :columns="columns"
  77. @dblclick="handleClickRow"
  78. :data="loadData"
  79. :defaultLoadData="false"
  80. :scroll="{ y: 200 }"
  81. bordered>
  82. <!-- 调出数量 -->
  83. <template slot="outQty" slot-scope="text, record">
  84. <div @dblclick.stop>
  85. <a-input-number
  86. size="small"
  87. :id="'chainTransferOutEdit-outQty-'+record.stockDetailSn"
  88. v-model="record.outQty"
  89. :precision="0"
  90. :min="1"
  91. :max="record.currentQty"
  92. placeholder="请输入"
  93. style="width: 100%;" />
  94. </div>
  95. </template>
  96. <!-- 操作 -->
  97. <template slot="action" slot-scope="text, record">
  98. <a-button :id="'chainTransferOutEdit-add-'+record.stockDetailSn" size="small" type="link" class="button-primary" @click="handleAdd(record)">添加</a-button>
  99. </template>
  100. </s-table>
  101. </a-collapse-panel>
  102. </a-collapse>
  103. </div>
  104. <!-- 已选产品 -->
  105. <div class="chainTransferOutEdit-cont">
  106. <a-collapse :activeKey="['1']">
  107. <a-collapse-panel key="1" header="已选产品">
  108. <!-- 总计 -->
  109. <a-alert type="info" style="margin-bottom:10px">
  110. <div slot="message">
  111. 总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong> ,
  112. 总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
  113. <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
  114. ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? toThousands(productTotal.productTotalCost,2) : '--' }}</strong>
  115. </div>
  116. </div>
  117. </a-alert>
  118. <!-- 筛选条件 -->
  119. <a-row :gutter="15" justify="space-between">
  120. <a-col :span="17">
  121. <div class="table-page-search-wrapper">
  122. <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
  123. <a-row :gutter="15">
  124. <a-col :md="9" :sm="24">
  125. <a-form-item label="产品编码" prop="productCode">
  126. <a-input id="coe-choosed-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
  127. </a-form-item>
  128. </a-col>
  129. <a-col :md="9" :sm="24">
  130. <a-form-item label="产品名称" prop="productName">
  131. <a-input id="coe-choosed-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
  132. </a-form-item>
  133. </a-col>
  134. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  135. <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="coe-choosed-refresh">查询</a-button>
  136. <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="coe-choosed-reset">重置</a-button>
  137. </a-col>
  138. </a-row>
  139. </a-form>
  140. </div>
  141. </a-col>
  142. <a-col :span="7" style="text-align: right;">
  143. <a-button
  144. type="danger"
  145. ghost
  146. size="small"
  147. @click="openGuideModal=true"
  148. style="margin-right: 5px"
  149. id="coe-choosed-import-btn">导入产品</a-button>
  150. <a-button
  151. size="small"
  152. type="primary"
  153. ghost
  154. style="margin-left: 8px"
  155. :disabled="localDataSource.length==0"
  156. @click.stop="handleDel('', 'all')"
  157. id="coe-choosed-del-all-btn">清空列表</a-button>
  158. </a-col>
  159. </a-row>
  160. <!-- 列表 -->
  161. <s-table
  162. class="sTable"
  163. ref="chooseTable"
  164. size="small"
  165. :rowKey="(record) => record.id"
  166. :columns="chooseColumns"
  167. :data="chooseLoadData"
  168. :defaultLoadData="false"
  169. :scroll="{ y: 300 }"
  170. bordered>
  171. <!-- 操作 -->
  172. <template slot="action" slot-scope="text, record">
  173. <a-button size="small" type="link" class="button-error" @click="handleDel(record)" :id="'coe-choosed-del-btn-'+record.id">删除</a-button>
  174. </template>
  175. </s-table>
  176. </a-collapse-panel>
  177. </a-collapse>
  178. </div>
  179. </a-spin>
  180. <div class="affix-cont">
  181. <a-button
  182. type="primary"
  183. id="chainTransferOutEdit-submit"
  184. size="large"
  185. :disabled="spinning"
  186. class="button-primary"
  187. @click="handleSubmit"
  188. style="padding: 0 60px;">提交</a-button>
  189. </div>
  190. <!-- 导入产品 -->
  191. <importGuideModal :openModal="openGuideModal" :params="{allocationLinkageOutSn: $route.params.sn}" @close="openGuideModal=false" @ok="pageInit" />
  192. </div>
  193. </template>
  194. <script>
  195. import { commonMixin } from '@/utils/mixin'
  196. import { STable, VSelect } from '@/components'
  197. import { getOperationalPrecision } from '@/libs/tools.js'
  198. import { hdPrint } from '@/libs/JGPrint'
  199. // 组件
  200. import Print from '@/views/common/print.vue'
  201. import importGuideModal from './importGuideModal.vue'
  202. import ProductType from '../../common/productType.js'
  203. import ProductBrand from '../../common/productBrand.js'
  204. // 接口
  205. import { warehouseAllList } from '@/api/warehouse'
  206. import { productQuery } from '@/api/allocWarehouse'
  207. import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailSave, allocLinkageOutDetailDel, allocLinkageOutDetailCount, allocLinkageOutSubmit, allocLinkageOutDetailDelAll, allocLinkageOutDetailPrint, importProductInsertBatch } from '@/api/allocLinkageOut'
  208. export default {
  209. name: 'AllocLinkageOutEdit',
  210. components: { STable, VSelect, Print, ProductType, ProductBrand, importGuideModal },
  211. mixins: [commonMixin],
  212. data () {
  213. return {
  214. spinning: false,
  215. queryParam: {
  216. productCode: '', // 产品编码
  217. productName: '', // 产品名称
  218. productOrigCode: '', // 原厂编码
  219. warehouseSn: undefined, // 仓库sn
  220. brandSn: undefined, // 品牌sn
  221. productTypeSn1: undefined, // 产品类型1
  222. productTypeSn2: undefined, // 产品类型2
  223. productTypeSn3: undefined// 产品类型3
  224. },
  225. productType: [], // 产品分类默认值
  226. warehouseList: [], // 仓库 下拉数据
  227. disabled: false, // 查询、重置按钮是否可操作
  228. chooseDisabled: false, // 按钮禁用
  229. openGuideModal: false, // 打开导入产品弹框
  230. advanced: false, // 高级搜索 展开/关闭
  231. // 加载数据方法 必须为 Promise 对象
  232. loadData: parameter => {
  233. this.disabled = true
  234. // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
  235. this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
  236. const params = Object.assign(parameter, this.queryParam, { wasteFlag: 0 })
  237. return productQuery(params).then(res => {
  238. const data = res.data
  239. const no = (data.pageNo - 1) * data.pageSize
  240. for (var i = 0; i < data.list.length; i++) {
  241. data.list[i].no = no + i + 1
  242. }
  243. this.disabled = false
  244. return data
  245. })
  246. },
  247. chooseQueryParam: {
  248. productCode: '', // 产品编码
  249. productName: ''// 产品名称
  250. },
  251. // 加载数据方法 必须为 Promise 对象
  252. chooseLoadData: parameter => {
  253. this.chooseDisabled = true
  254. const params = Object.assign(parameter, this.chooseQueryParam, { allocationLinkageOutSn: this.$route.params.sn })
  255. return allocLinkageOutDetailList(params).then(res => {
  256. const data = res.data
  257. const no = (data.pageNo - 1) * data.pageSize
  258. for (var i = 0; i < data.list.length; i++) {
  259. data.list[i].no = no + i + 1
  260. // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
  261. data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
  262. }
  263. this.chooseDisabled = false
  264. this.getDetailCount(params)
  265. this.localDataSource = data.list
  266. return data
  267. })
  268. },
  269. basicInfoData: null, // 基本信息
  270. productTotal: null, // 合计
  271. localDataSource: [] // 原始数据
  272. }
  273. },
  274. computed: {
  275. columns () {
  276. const _this = this
  277. const arr = [
  278. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  279. { title: '产品编码', dataIndex: 'productCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
  280. { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  281. { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  282. { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  283. { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  284. { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  285. // { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  286. { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  287. { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
  288. { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
  289. { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
  290. ]
  291. if (this.$hasPermissions('M_ShowAllCost')) {
  292. arr.splice(7, 0, { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
  293. }
  294. return arr
  295. },
  296. // 已选列
  297. chooseColumns () {
  298. const _this = this
  299. const arr = [
  300. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  301. { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  302. { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  303. { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
  304. { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  305. { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  306. { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  307. { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
  308. // { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  309. { title: '调出数量', dataIndex: 'outQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  310. // { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  311. { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
  312. ]
  313. // 成本价权限
  314. if (this.$hasPermissions('M_ShowAllCost')) {
  315. arr.splice(8, 0, { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
  316. arr.splice(10, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
  317. }
  318. return arr
  319. }
  320. },
  321. methods: {
  322. // 重置
  323. resetSearchForm () {
  324. this.resetData()
  325. this.$refs.table.refresh(true)
  326. },
  327. // 重置数据
  328. resetData () {
  329. this.queryParam.productCode = ''
  330. this.queryParam.productName = ''
  331. this.queryParam.productOrigCode = ''
  332. this.queryParam.warehouseSn = undefined
  333. this.queryParam.brandSn = undefined
  334. this.queryParam.productTypeSn1 = undefined
  335. this.queryParam.productTypeSn2 = undefined
  336. this.queryParam.productTypeSn3 = undefined
  337. this.productType = []
  338. },
  339. // 已选产品 重置
  340. chooseResetSearchForm () {
  341. this.chooseQueryParam.productCode = ''
  342. this.chooseQueryParam.productName = ''
  343. this.$refs.chooseTable.refresh(true)
  344. },
  345. // 双击快速添加
  346. handleClickRow (record) {
  347. this.handleAdd(record)
  348. },
  349. // 基本信息
  350. getDetail () {
  351. allocLinkageOutDetailSn({ sn: this.$route.params.sn }).then(res => {
  352. if (res.status == 200) {
  353. this.basicInfoData = res.data
  354. this.$refs.table.refresh(true)
  355. } else {
  356. this.basicInfoData = null
  357. }
  358. })
  359. },
  360. // 添加/编辑
  361. handleAdd (row, isEdit) {
  362. if (!isEdit && !row.outQty) {
  363. this.$message.warning('请输入调出数量后再添加!')
  364. return
  365. }
  366. const params = {
  367. id: isEdit ? row.id : undefined,
  368. allocationLinkageOutSn: this.$route.params.sn,
  369. outCost: isEdit ? row.outCost : row.putCost,
  370. outQty: row.outQty,
  371. productSn: row.productSn,
  372. productProduceDate: row.productProduceDate,
  373. productExpiryDate: row.productExpiryDate,
  374. warehouseSn: row.warehouseSn,
  375. warehouseLocationSn: row.warehouseLocationSn
  376. }
  377. this.spinning = true
  378. allocLinkageOutDetailSave(params).then(res => {
  379. if (res.status == 200) {
  380. this.$message.success(res.message)
  381. if (isEdit) {
  382. this.$refs.table.refresh()
  383. }
  384. this.$refs.chooseTable.refresh()
  385. this.spinning = false
  386. } else {
  387. this.spinning = false
  388. }
  389. })
  390. },
  391. // 删除
  392. handleDel (row, isAll) {
  393. const _this = this
  394. const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
  395. this.$confirm({
  396. title: '提示',
  397. content: content,
  398. centered: true,
  399. onOk () {
  400. if (isAll) { // 清空列表
  401. _this.spinning = true
  402. allocLinkageOutDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
  403. if (res.status == 200) {
  404. _this.$message.success(res.message)
  405. _this.$refs.table.refresh()
  406. _this.$refs.chooseTable.refresh()
  407. _this.spinning = false
  408. } else {
  409. _this.spinning = false
  410. }
  411. })
  412. } else { // 单个删除
  413. _this.spinning = true
  414. allocLinkageOutDetailDel({ id: row.id }).then(res => {
  415. if (res.status == 200) {
  416. _this.$message.success(res.message)
  417. _this.$refs.table.refresh()
  418. _this.$refs.chooseTable.refresh()
  419. _this.spinning = false
  420. } else {
  421. _this.spinning = false
  422. }
  423. })
  424. }
  425. }
  426. })
  427. },
  428. // 提交
  429. handleSubmit () {
  430. const _this = this
  431. _this.spinning = true
  432. allocLinkageOutSubmit({ sn: this.$route.params.sn }).then(res => {
  433. if (res.status == 200) {
  434. this.$message.success(res.message)
  435. setTimeout(() => {
  436. _this.handleBack()
  437. _this.spinning = false
  438. }, 1000)
  439. } else {
  440. _this.spinning = false
  441. }
  442. })
  443. },
  444. // 返回列表
  445. handleBack () {
  446. this.$router.push({ name: 'chainTransferOutList' })
  447. },
  448. // 合计
  449. getDetailCount (params) {
  450. allocLinkageOutDetailCount(params).then(res => {
  451. if (res.status == 200) {
  452. this.productTotal = res.data
  453. } else {
  454. this.productTotal = null
  455. }
  456. })
  457. },
  458. // 产品分类 change
  459. changeProductType (val, opt) {
  460. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  461. this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
  462. this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
  463. },
  464. // 仓库下拉数据
  465. getWarehouseList (type) {
  466. warehouseAllList({ wasteFlag: 0 }).then(res => {
  467. if (res.status == 200) {
  468. this.warehouseList = res.data
  469. } else {
  470. this.warehouseList = []
  471. }
  472. })
  473. },
  474. // 打印预览/快捷打印
  475. handlePrint (type, printerType) {
  476. const _this = this
  477. _this.spinning = true
  478. const url = allocLinkageOutDetailPrint
  479. const params = { sn: this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
  480. // 打印或导出
  481. hdPrint(printerType, type, url, params, '连锁调出单', function () {
  482. _this.spinning = false
  483. })
  484. },
  485. // 页面初始化
  486. pageInit () {
  487. this.resetData()
  488. this.chooseResetSearchForm()
  489. this.getDetail()
  490. this.getWarehouseList()
  491. }
  492. },
  493. mounted () {
  494. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  495. this.pageInit()
  496. }
  497. },
  498. activated () {
  499. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  500. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  501. this.pageInit()
  502. }
  503. },
  504. beforeRouteEnter (to, from, next) {
  505. next(vm => {})
  506. }
  507. }
  508. </script>
  509. <style lang="less">
  510. .chainTransferOutEdit-wrap{
  511. position: relative;
  512. height: 100%;
  513. padding-bottom: 51px;
  514. box-sizing: border-box;
  515. .chainTransferOutEdit-back, .chainTransferOutEdit-cont{
  516. margin-bottom: 10px;
  517. }
  518. >.ant-spin-nested-loading{
  519. overflow-y: auto;
  520. height: 100%;
  521. }
  522. }
  523. </style>