edit.vue 25 KB

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