edit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
  9. </template>
  10. <!-- 操作区,位于 title 行的行尾 -->
  11. <template slot="extra" v-if="$hasPermissions('B_storeCallOutPrint')">
  12. <a-radio-group key="3" v-model="printerType">
  13. <a-radio value="NEEDLE">针式</a-radio>
  14. <a-radio value="INK">喷墨</a-radio>
  15. </a-radio-group>
  16. <a-button key="2" id="storeTransferOutEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
  17. <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
  18. </template>
  19. </a-page-header>
  20. <!-- 选择产品 -->
  21. <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
  22. <a-collapse :activeKey="['1']">
  23. <a-collapse-panel key="1" header="选择产品">
  24. <!-- 筛选条件 -->
  25. <div class="table-page-search-wrapper">
  26. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  27. <a-row :gutter="15">
  28. <a-col :md="6" :sm="24">
  29. <a-form-item label="产品编码" prop="productCode">
  30. <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
  31. </a-form-item>
  32. </a-col>
  33. <a-col :md="6" :sm="24">
  34. <a-form-item label="产品名称" prop="productName">
  35. <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="24">
  39. <a-form-item label="仓库">
  40. <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
  41. <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
  42. </a-select>
  43. </a-form-item>
  44. </a-col>
  45. <template v-if="advanced">
  46. <a-col :md="6" :sm="24">
  47. <a-form-item label="产品分类">
  48. <a-cascader
  49. @change="changeProductType"
  50. change-on-select
  51. v-model="productType"
  52. expand-trigger="hover"
  53. :options="productTypeList"
  54. :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
  55. id="storeTransferOutEdit-productType"
  56. placeholder="请选择产品分类"
  57. allowClear />
  58. </a-form-item>
  59. </a-col>
  60. <a-col :md="6" :sm="24">
  61. <a-form-item label="产品品牌">
  62. <a-select
  63. placeholder="请选择产品品牌"
  64. id="storeTransferOutEdit-brandSn"
  65. allowClear
  66. v-model="queryParam.brandSn"
  67. :showSearch="true"
  68. option-filter-prop="children"
  69. :filter-option="filterOption">
  70. <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
  71. </a-select>
  72. </a-form-item>
  73. </a-col>
  74. </template>
  75. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  76. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
  77. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
  78. <a @click="advanced=!advanced" style="margin-left: 8px">
  79. {{ advanced ? '收起' : '展开' }}
  80. <a-icon :type="advanced ? 'up' : 'down'"/>
  81. </a>
  82. </a-col>
  83. </a-row>
  84. </a-form>
  85. </div>
  86. <!-- 列表 -->
  87. <s-table
  88. class="sTable"
  89. ref="table"
  90. size="small"
  91. :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
  92. :columns="columns"
  93. :customRow="handleClickRow"
  94. :data="loadData"
  95. :scroll="{ x: 1180, y: 300 }"
  96. :defaultLoadData="false"
  97. bordered>
  98. <!-- 操作 -->
  99. <template slot="action" slot-scope="text, record">
  100. <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
  101. </template>
  102. </s-table>
  103. </a-collapse-panel>
  104. </a-collapse>
  105. </a-card>
  106. <!-- 已选产品 -->
  107. <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
  108. <a-collapse :activeKey="['1']">
  109. <a-collapse-panel key="1" header="已选产品">
  110. <!-- 总计 -->
  111. <a-alert type="info" showIcon style="margin-bottom:15px">
  112. <div slot="message">
  113. 总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong>
  114. 总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
  115. 总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
  116. </div>
  117. </a-alert>
  118. <!-- 筛选条件 -->
  119. <a-row :gutter="15">
  120. <a-col :span="20">
  121. <div class="table-page-search-wrapper">
  122. <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
  123. <a-row :gutter="15">
  124. <a-col :md="6" :sm="24">
  125. <a-form-item label="产品编码" prop="productCode">
  126. <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
  127. </a-form-item>
  128. </a-col>
  129. <a-col :md="6" :sm="24">
  130. <a-form-item label="产品名称" prop="productName">
  131. <a-input id="storeTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
  132. </a-form-item>
  133. </a-col>
  134. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  135. <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
  136. <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
  137. </a-col>
  138. </a-row>
  139. </a-form>
  140. </div>
  141. </a-col>
  142. <a-col :span="4" style="text-align: right;">
  143. <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
  144. </a-col>
  145. </a-row>
  146. <!-- 列表 -->
  147. <a-table
  148. class="sTable"
  149. ref="chooseTable"
  150. size="small"
  151. :rowKey="(record) => record.id"
  152. :columns="chooseColumns"
  153. :dataSource="chooseLoadData"
  154. :scroll="{ x: 1335, y: 300 }"
  155. :pagination="choosePaginationProps"
  156. bordered>
  157. <!-- 调出数量 -->
  158. <template slot="outQty" slot-scope="text, record">
  159. <a-input-number
  160. id="storeTransferOutEdit-outQty"
  161. v-model="record.outQty"
  162. :precision="0"
  163. :min="1"
  164. :max="999999"
  165. placeholder="请输入"
  166. @blur="e => outQtyBlur(e.target.value, record)"
  167. style="width: 100%;" />
  168. </template>
  169. <!-- 操作 -->
  170. <template slot="action" slot-scope="text, record">
  171. <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
  172. </template>
  173. </a-table>
  174. </a-collapse-panel>
  175. </a-collapse>
  176. </a-card>
  177. <a-affix :offset-bottom="0">
  178. <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
  179. <a-button
  180. type="primary"
  181. id="storeTransferOutEdit-submit"
  182. size="large"
  183. class="button-primary"
  184. @click="handleSubmit"
  185. style="padding: 0 60px;">提交</a-button>
  186. </div>
  187. </a-affix>
  188. </a-spin>
  189. <!-- 打印 -->
  190. <div id="print"></div>
  191. </div>
  192. </template>
  193. <script>
  194. import { STable, VSelect } from '@/components'
  195. import { getOperationalPrecision } from '@/libs/tools.js'
  196. import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit, storeCallOutDetailPrint } from '@/api/storeCallOut'
  197. import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
  198. import { dealerProductTypeList } from '@/api/dealerProductType'
  199. import { warehouseAllList } from '@/api/warehouse'
  200. import { productQuery } from '@/api/allocWarehouse'
  201. export default {
  202. components: { STable, VSelect },
  203. data () {
  204. return {
  205. spinning: false,
  206. queryParam: {
  207. productCode: '',
  208. productName: '',
  209. warehouseSn: undefined,
  210. brandSn: undefined,
  211. productTypeSn1: undefined,
  212. productTypeSn2: undefined,
  213. productTypeSn3: undefined
  214. },
  215. chooseQueryParam: {
  216. productCode: '',
  217. productName: ''
  218. },
  219. disabled: false, // 查询、重置按钮是否可操作
  220. chooseDisabled: false, // 查询、重置按钮是否可操作
  221. advanced: false, // 高级搜索 展开/关闭
  222. productBrandList: [], // 产品品牌 下拉数据
  223. productTypeList: [], // 产品分类 下拉数据
  224. productType: [],
  225. warehouseList: [], // 仓库 下拉数据
  226. // 表头
  227. columns: [
  228. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  229. { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  230. { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  231. { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  232. { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  233. { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  234. { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  235. { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  236. { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
  237. ],
  238. // 加载数据方法 必须为 Promise 对象
  239. loadData: parameter => {
  240. this.disabled = true
  241. return productQuery(Object.assign(parameter, this.queryParam)).then(res => {
  242. const data = res.data
  243. const no = (data.pageNo - 1) * data.pageSize
  244. for (var i = 0; i < data.list.length; i++) {
  245. data.list[i].no = no + i + 1
  246. }
  247. this.disabled = false
  248. return data
  249. })
  250. },
  251. // 表头
  252. chooseColumns: [
  253. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  254. { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  255. { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  256. { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  257. { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  258. { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  259. { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  260. { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
  261. { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  262. { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
  263. ],
  264. chooseLoadData: [],
  265. choosePageNo: 1, // 分页页码
  266. choosePageSize: 10, // 分页 每页多少条
  267. choosePaginationProps: {
  268. showSizeChanger: true, // 是否可以改变 pageSize
  269. total: 0, // 分页总条数
  270. current: 1,
  271. onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
  272. onChange: (current) => this.changeChoosePage(current)
  273. },
  274. basicInfoData: null, // 基本信息
  275. productTotal: null, // 合计
  276. printerType: 'NEEDLE' // 打印机类型
  277. }
  278. },
  279. methods: {
  280. // 重置
  281. resetSearchForm () {
  282. this.queryParam.productCode = ''
  283. this.queryParam.productName = ''
  284. this.queryParam.warehouseSn = undefined
  285. this.queryParam.brandSn = undefined
  286. this.queryParam.productTypeSn1 = undefined
  287. this.queryParam.productTypeSn2 = undefined
  288. this.queryParam.productTypeSn3 = undefined
  289. this.productType = []
  290. this.$refs.table.refresh(true)
  291. },
  292. // 打印预览/快捷打印
  293. handlePrint (type) {
  294. const _this = this
  295. _this.spinning = true
  296. storeCallOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType, costFlag: '0' }).then(res => {
  297. _this.spinning = false
  298. if (res.type == 'application/json') {
  299. var reader = new FileReader()
  300. reader.addEventListener('loadend', function () {
  301. const obj = JSON.parse(reader.result)
  302. _this.$notification.error({
  303. message: '提示',
  304. description: obj.message
  305. })
  306. })
  307. reader.readAsText(res)
  308. } else {
  309. this.print(res, type)
  310. }
  311. })
  312. },
  313. print (data, type) {
  314. if (!data) {
  315. return
  316. }
  317. const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
  318. document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
  319. if (type == 'preview') { // 预览
  320. window.open(url)
  321. } else if (type == 'print') { // 打印
  322. window.frames['printf'].focus()
  323. window.frames['printf'].print()
  324. }
  325. },
  326. // 双击快速添加
  327. handleClickRow (record) {
  328. return {
  329. on: {
  330. dblclick: (event) => {
  331. this.handleAdd(record)
  332. }
  333. }
  334. }
  335. },
  336. // 已选产品 重置
  337. chooseResetSearchForm () {
  338. this.chooseQueryParam.productCode = ''
  339. this.chooseQueryParam.productName = ''
  340. this.choosePageNo = 1
  341. this.choosePageSize = 10
  342. this.choosePaginationProps.total = 0
  343. this.choosePaginationProps.current = 1
  344. this.getChooseProductList(1)
  345. },
  346. // 基本信息
  347. getDetail () {
  348. storeCallOutDetail({ id: this.$route.params.id }).then(res => {
  349. if (res.status == 200) {
  350. this.basicInfoData = res.data
  351. } else {
  352. this.basicInfoData = null
  353. }
  354. })
  355. },
  356. // 添加/编辑
  357. handleAdd (row, isEdit) {
  358. const params = {
  359. id: isEdit ? row.id : undefined,
  360. storeCallOutSn: this.$route.params.sn,
  361. outCost: isEdit ? row.outCost : row.putCost,
  362. outQty: isEdit ? row.outQty : 1, // 添加时调出数量默认为1
  363. productSn: row.productSn,
  364. productCode: row.productCode,
  365. productOrigCode: row.productOrigCode || undefined,
  366. productTypeSn1: row.productTypeSn1,
  367. productTypeSn2: row.productTypeSn2,
  368. productTypeSn3: row.productTypeSn3,
  369. brandSn: row.brandSn,
  370. warehouseSn: row.warehouseSn,
  371. warehouseLocationSn: row.warehouseLocationSn
  372. }
  373. if (isEdit) { // 编辑
  374. // 清空数量时,值应保持未清空前的值,因数量不可为空
  375. if (!row.outQty || row.outQty == row.outQtyBackups) {
  376. row.outQty = row.outQtyBackups
  377. return
  378. }
  379. }
  380. this.spinning = true
  381. storeCallOutDetailSave(params).then(res => {
  382. if (res.status == 200) {
  383. this.$message.success(res.message)
  384. this.$refs.table.refresh()
  385. this.getChooseProductList()
  386. this.spinning = false
  387. } else {
  388. this.spinning = false
  389. }
  390. })
  391. },
  392. // 删除
  393. handleDel (row) {
  394. const _this = this
  395. this.$confirm({
  396. title: '提示',
  397. content: '删除后不可恢复,确定要进行删除吗?',
  398. centered: true,
  399. onOk () {
  400. _this.spinning = true
  401. storeCallOutDetailDel({ id: row.id }).then(res => {
  402. if (res.status == 200) {
  403. _this.$message.success(res.message)
  404. _this.$refs.table.refresh()
  405. _this.getChooseProductList()
  406. _this.spinning = false
  407. } else {
  408. _this.spinning = false
  409. }
  410. })
  411. }
  412. })
  413. },
  414. // 提交
  415. handleSubmit () {
  416. const _this = this
  417. _this.spinning = true
  418. storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
  419. if (res.status == 200) {
  420. this.$message.success(res.message)
  421. setTimeout(() => {
  422. _this.handleBack()
  423. _this.spinning = false
  424. }, 1000)
  425. } else {
  426. _this.spinning = false
  427. }
  428. })
  429. },
  430. // 合计
  431. getDetailCount (params) {
  432. storeCallOutDetailCount(params).then(res => {
  433. if (res.status == 200) {
  434. this.productTotal = res.data
  435. } else {
  436. this.productTotal = null
  437. }
  438. })
  439. },
  440. // 导入明细
  441. handleImport () {
  442. console.log(333)
  443. },
  444. // 返回列表
  445. handleBack () {
  446. this.$router.push({ path: '/allocationManagement/storeTransferOut/list' })
  447. },
  448. // 已选产品 分页 一页多少条change
  449. changeChoosePageSize (current, pageSize) {
  450. this.choosePageNo = current
  451. this.choosePageSize = pageSize
  452. this.getChooseProductList()
  453. },
  454. // 已选产品 分页 页码change
  455. changeChoosePage (current) {
  456. this.choosePageNo = current
  457. this.getChooseProductList()
  458. },
  459. // 已选产品列表数据
  460. getChooseProductList (pageNo) {
  461. this.choosePageNo = this.choosePageNo || pageNo
  462. this.chooseDisabled = true
  463. const params = {
  464. pageNo: this.choosePageNo,
  465. pageSize: this.choosePageSize,
  466. storeCallOutSn: this.$route.params.sn
  467. }
  468. storeCallOutDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
  469. if (res.status == 200) {
  470. // 合计
  471. this.getDetailCount(Object.assign(params, this.chooseQueryParam))
  472. const data = res.data
  473. this.choosePaginationProps.total = Number(res.data.count) || 0
  474. this.choosePaginationProps.current = data.pageNo
  475. const no = (data.pageNo - 1) * data.pageSize
  476. for (var i = 0; i < data.list.length; i++) {
  477. data.list[i].no = no + i + 1
  478. data.list[i].outQtyBackups = data.list[i].outQty
  479. // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
  480. data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
  481. }
  482. this.chooseLoadData = data.list
  483. this.chooseDisabled = false
  484. } else {
  485. this.choosePaginationProps.total = 0
  486. this.choosePaginationProps.current = 1
  487. this.chooseLoadData = []
  488. }
  489. })
  490. },
  491. // 已选产品 调出数量 blur
  492. outQtyBlur (val, record) {
  493. // 光标移出,值发生改变再调用编辑接口
  494. if (val != record.outQtyBackups) {
  495. this.handleAdd(record, 'edit')
  496. }
  497. },
  498. // 产品分类 change
  499. changeProductType (val, opt) {
  500. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  501. this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
  502. this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
  503. },
  504. // 产品品牌 列表
  505. getProductBrand () {
  506. // sysFlag不传,此处应查询所有产品
  507. dealerProductBrandQuery({}).then(res => {
  508. if (res.status == 200) {
  509. this.productBrandList = res.data
  510. } else {
  511. this.productBrandList = []
  512. }
  513. })
  514. },
  515. // 产品分类 列表
  516. getProductType () {
  517. dealerProductTypeList({}).then(res => {
  518. if (res.status == 200) {
  519. this.productTypeList = res.data
  520. } else {
  521. this.productTypeList = []
  522. }
  523. })
  524. },
  525. // 仓库下拉数据
  526. getWarehouseList (type) {
  527. warehouseAllList({}).then(res => {
  528. if (res.status == 200) {
  529. this.warehouseList = res.data
  530. } else {
  531. this.warehouseList = []
  532. }
  533. })
  534. },
  535. filterOption (input, option) {
  536. return (
  537. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  538. )
  539. }
  540. },
  541. beforeRouteEnter (to, from, next) {
  542. next(vm => {
  543. vm.getDetail()
  544. vm.getChooseProductList(1)
  545. vm.getWarehouseList()
  546. vm.getProductBrand()
  547. vm.getProductType()
  548. })
  549. }
  550. }
  551. </script>
  552. <style lang="less">
  553. .storeTransferOutEdit-wrap{
  554. .storeTransferOutEdit-back{
  555. margin-bottom: 15px;
  556. }
  557. .storeTransferOutEdit-cont{
  558. margin-bottom: 15px;
  559. .sub-title{
  560. font-size: 12px;
  561. color: #808695;
  562. margin-left: 10px;
  563. }
  564. .tag-txt{
  565. font-size: 12px;
  566. color: #ed1c24;
  567. }
  568. .edit-circle-btn{
  569. margin-left: 15px;
  570. i{
  571. vertical-align: text-bottom;
  572. }
  573. }
  574. .import-btn{
  575. margin-left: 15px;
  576. }
  577. }
  578. }
  579. </style>