queryPart.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <template>
  2. <div class="partQuery-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form-model
  6. ref="ruleForm"
  7. class="form-model-con"
  8. layout="inline"
  9. :rules="rules"
  10. :model="queryParam"
  11. @keyup.enter.native="$refs.table.refresh(true)" >
  12. <a-row type="flex" :gutter="5">
  13. <a-col :lg="4" :md="6" :sm="12">
  14. <a-form-model-item label="产品编码">
  15. <a-input id="partQuery-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
  16. </a-form-model-item>
  17. </a-col>
  18. <a-col :lg="4" :md="6" :sm="12">
  19. <a-form-model-item label="产品名称">
  20. <a-input id="partQuery-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :lg="4" :md="6" :sm="12">
  24. <a-form-model-item label="原厂编码">
  25. <a-input id="partQuery-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :lg="4" :md="6" :sm="12">
  29. <a-form-model-item label="产品分类">
  30. <ProductType id="partQuery-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
  31. </a-form-model-item>
  32. </a-col>
  33. <template v-if="advanced">
  34. <a-col :lg="4" :md="6" :sm="12">
  35. <a-form-model-item label="产品品牌">
  36. <ProductBrand id="partQuery-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :lg="4" :md="6" :sm="12">
  40. <a-form-model-item label="仓库">
  41. <a-select
  42. placeholder="请选择仓库"
  43. id="partQuery-warehouseSn"
  44. allowClear
  45. v-model="queryParam.warehouseSn"
  46. :showSearch="true"
  47. option-filter-prop="children"
  48. :filter-option="filterOption">
  49. <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
  50. </a-select>
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :lg="6" :md="8" :sm="12" v-if="$hasPermissions('B_salerVinFindProduct')">
  54. <a-form-model-item label="车架号(VIN)" prop="vinCode">
  55. <a-input id="partQuery-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
  56. <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
  57. </a-input>
  58. <input type="file" id="partQuery-filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :md="6" :sm="24">
  62. <a-form-item label="是否有库存">
  63. <a-select @change="handleHasQty" id="partQuery-existStockFlag" allowClear :value="queryParam.existStockFlag" placeholder="请选择查看是否有库存">
  64. <a-select-option value="1">
  65. </a-select-option>
  66. <a-select-option value="0">
  67. </a-select-option>
  68. </a-select>
  69. </a-form-item>
  70. </a-col>
  71. </template>
  72. <a-col flex="200px" style="margin-bottom: 10px;">
  73. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="partQuery-refresh">查询</a-button>
  74. <a-button style="margin-left: 5px" @click="resetSearchForm" id="partQuery-reset">重置</a-button>
  75. <a @click="advanced=!advanced" style="margin:0 0 0 10px" id="partQuery-advanced">
  76. {{ advanced ? '收起' : '展开' }}
  77. <a-icon :type="advanced ? 'up' : 'down'"/>
  78. </a>
  79. </a-col>
  80. <a-col flex="auto" style="margin-bottom: 15px;display:flex;align-items:center;">
  81. <a-checkbox v-model="cost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
  82. <a-checkbox v-model="cityPrice" v-if="$hasPermissions('M_ShowAllCityPrice')&&$store.state.user.dealerLevel != 'SPECIAL'" id="salesQuery-cityPrice">市级价</a-checkbox>
  83. <a-checkbox v-model="tyuePrice" v-if="$store.state.user.isShowSpecialPrice==1" id="salesQuery-tyuePrice">特约价</a-checkbox>
  84. <a-checkbox v-model="zdPrice" id="salesQuery-zdPrice">终端价</a-checkbox>
  85. </a-col>
  86. </a-row>
  87. </a-form-model>
  88. </div>
  89. <a-alert type="error" style="margin-bottom: 10px;" v-if="vinInfoData&&!vinInfoData.vinInfo">
  90. <template slot="message"><a-icon type="exclamation-circle" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!</template>
  91. </a-alert>
  92. <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" id="partQuery-alert" v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
  93. <template slot="message">
  94. <div id="partQuery-openCarInfoModal" style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
  95. <div>
  96. <img :src="vinInfoData.vinInfo && vinInfoData.vinInfo.icon?(vinInfoData.vinInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
  97. <span style="vertical-align: middle;">{{ vinInfoData.vinInfo.text }}</span>
  98. </div>
  99. <div style="color: #f90;">
  100. <span>查看更多</span> >
  101. </div>
  102. </div>
  103. </template>
  104. </a-alert>
  105. <!-- 列表 -->
  106. <s-table
  107. class="sTable"
  108. ref="table"
  109. size="small"
  110. :rowKey="(record) => record.no"
  111. rowKeyName="no"
  112. :columns="columns"
  113. :data="loadData"
  114. @dblclick="handleClickRow"
  115. :defaultLoadData="false"
  116. :pageSize="10"
  117. :scroll="{ y: 149 }"
  118. bordered>
  119. <div slot="costTitle">
  120. <a-tooltip placement="top">
  121. <template slot="title">
  122. 产品所在仓库仓位的最近一次入库成本,不包含盘盈入库和仓库调拨入库。
  123. </template>
  124. <span style="margin-right: 5px;">参考成本价</span> <a-icon type="question-circle" />
  125. </a-tooltip>
  126. </div>
  127. <!-- 售价 -->
  128. <template slot="salePrice" slot-scope="text, record">
  129. <div style="display: flex;align-items: center;" @dblclick.stop>
  130. <a-input-number
  131. size="small"
  132. v-model="record.price"
  133. :id="'partQuery-price-'+record.productSn"
  134. :precision="2"
  135. :min="0"
  136. :max="999999"
  137. style="width: 100%;"
  138. placeholder="请输入" />
  139. <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
  140. <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  141. </div>
  142. </template>
  143. <!-- 销售数量 -->
  144. <template slot="nums" slot-scope="text, record">
  145. <div @dblclick.stop>
  146. <a-input-number
  147. size="small"
  148. :id="'partQuery-salesNums-'+record.productSn"
  149. v-model="record.salesNums"
  150. :precision="0"
  151. :min="0"
  152. :max="999999"
  153. style="width: 100%;"
  154. placeholder="请输入" />
  155. </div>
  156. </template>
  157. <!-- 操作 -->
  158. <template slot="action" slot-scope="text, record">
  159. <a-button
  160. size="small"
  161. type="link"
  162. class="button-primary"
  163. @click="handleAdd(record)"
  164. id="partQuery-edit-btn">添加</a-button>
  165. <a-button
  166. size="small"
  167. type="link"
  168. class="button-primary"
  169. @click="handleDetail(record)"
  170. id="partQuery-detail-btn"
  171. style="margin-left: 5px;">销售记录</a-button>
  172. </template>
  173. </s-table>
  174. <!-- 销售记录 -->
  175. <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
  176. <!-- 查看车辆信息 -->
  177. <car-info-modal ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.vinInfo" @close="openCarInfoModal=false" />
  178. </div>
  179. </template>
  180. <script>
  181. import { commonMixin } from '@/utils/mixin'
  182. import defImg from '@/assets/def_img@2x.png'
  183. // 组件
  184. import { STable, VSelect, Upload } from '@/components'
  185. import productSalesRecordModal from './productSalesRecordModal.vue' // 产品销售记录弹框
  186. import carInfoModal from './carInfoModal.vue' // 车型信息弹框
  187. import ProductType from '../../common/productType.js' // 产品分类下拉
  188. import ProductBrand from '../../common/productBrand.js' // 产品品牌下拉
  189. // 接口
  190. import { supperCodeByVin, vinCodeParse } from '@/api/sales'
  191. import { querySumByProductLocation } from '@/api/stock'
  192. import { warehouseAllList } from '@/api/warehouse'
  193. export default {
  194. name: 'QueryPart',
  195. components: { STable, VSelect, Upload, productSalesRecordModal, carInfoModal, ProductType, ProductBrand },
  196. mixins: [commonMixin],
  197. props: {
  198. newLoading: Boolean
  199. },
  200. data () {
  201. return {
  202. advanced: false, // 高级搜索 展开/关闭
  203. vinLoading: false, // vin 按钮loading
  204. productType: [], // 产品分类
  205. defImg, // 默认图片
  206. queryParam: { // 查询条件
  207. customerSn: '', // 客户sn
  208. salesBillSn: '', // 销售单sn
  209. salePriceType: '', // 销售价格类型
  210. productCode: '', // 产品编码
  211. productName: '', // 产品名称
  212. productOrigCode: '', // 原厂编码
  213. vinCode: '', // vin码
  214. productCodeList: undefined, // 车架号
  215. brandSn: undefined, // 产品品牌
  216. productTypeSn1: '', // 产品一级分类
  217. productTypeSn2: '', // 产品二级分类
  218. productTypeSn3: '', // 产品三级分类
  219. warehouseSn: undefined, // 仓库、
  220. enableFlag: '1', // 启用禁用
  221. existStockFlag: undefined// 是否存在库存
  222. },
  223. sourceType: null, // 单据来源
  224. priceType: '', // 价格类型
  225. buyerSn: '', // 客户sn
  226. rules: { // 校验
  227. vinCode: [ { len: 17, message: '请输入正确的车架号(VIN)', trigger: 'change' } ]
  228. },
  229. disabled: false, // 查询、重置按钮是否可操作
  230. warehouseList: [], // 仓库列表
  231. vinInfoData: null, // 车辆信息
  232. // 加载数据方法 必须为 Promise 对象
  233. loadData: parameter => {
  234. const _this = this
  235. // 价格类型
  236. _this.queryParam.salePriceType = _this.priceType
  237. // 客户sn
  238. _this.queryParam.customerSn = _this.buyerSn
  239. // 单据来源
  240. _this.queryParam.sourceType = _this.sourceType
  241. // 产品编码排序
  242. if (parameter.sortField == 'productCode') {
  243. parameter.sortField = 'code'
  244. parameter.sortAlias = 'product '
  245. }
  246. // 产品品牌名称排序
  247. if (parameter.sortField == 'brandName') {
  248. parameter.sortField = 'firstChar'
  249. parameter.sortAlias = 'brand'
  250. }
  251. // 仓库排序
  252. if (parameter.sortField == 'warehouseName') {
  253. parameter.sortField = 'warehouseSn'
  254. parameter.sortAlias = 'sd'
  255. }
  256. // 转单时,productTypeSn3:543766811373752320
  257. if (_this.sourceType === 'TRANSFER_ORDER') {
  258. _this.queryParam.productTypeSn3 = '543766811373752320'
  259. }
  260. const params = Object.assign(parameter, _this.queryParam)
  261. // 输入vin,查出vin码信息后请求列表数据
  262. if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) {
  263. _this.disabled = true
  264. return supperCodeByVin({ vin: _this.queryParam.vinCode }).then(res => {
  265. if (res.status == 200) {
  266. _this.vinInfoData = res.data
  267. params.productCodeList = res.data.partCodeList || []
  268. return _this.getList(params)
  269. } else {
  270. _this.vinInfoData = null
  271. _this.$refs.table.localLoading = false
  272. _this.$refs.table.clearTable()
  273. }
  274. })
  275. // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
  276. } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) {
  277. _this.$refs.table.localLoading = false
  278. _this.$refs.table.clearTable()
  279. // 清空查询条件
  280. } else if (this.onlyList) {
  281. _this.disabled = true
  282. // ,按车型查询
  283. if (_this.queryParam.vinCode && _this.vinInfoData) {
  284. return _this.getList(Object.assign(params, { productCodeList: _this.vinInfoData.partCodeList }))
  285. } else {
  286. return _this.getList(params)
  287. }
  288. } else { // 未输入vin码信息,只查列表数据
  289. _this.disabled = true
  290. return _this.getList(params)
  291. }
  292. },
  293. openModal: false, // 查看客户详情 弹框
  294. cost: false, // 成本价
  295. cityPrice: false, // 城市价
  296. tyuePrice: false, // 特约价
  297. zdPrice: false, // 终端价
  298. openCarInfoModal: false, // 车型弹框
  299. onlyList: false // 是否情况查询条件
  300. }
  301. },
  302. computed: {
  303. columns () {
  304. const _this = this
  305. const arr = [
  306. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  307. { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
  308. { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  309. { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  310. { title: '品牌', dataIndex: 'brandName', width: '11%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
  311. { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  312. { title: '仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  313. ]
  314. // 成本价权限
  315. if (this.cost) {
  316. arr.push({ slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  317. }
  318. if (this.cityPrice && this.$hasPermissions('M_ShowAllCityPrice')) {
  319. arr.push({ title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  320. }
  321. if (this.tyuePrice) {
  322. arr.push({ title: '特约价', dataIndex: 'dealerProduct.specialPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  323. }
  324. if (this.zdPrice) {
  325. arr.push({ title: '终端价', dataIndex: 'dealerProduct.terminalPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  326. }
  327. return arr.concat([
  328. { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
  329. { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: '7%', align: 'center' },
  330. { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '6%', align: 'center' },
  331. { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  332. { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  333. ])
  334. }
  335. },
  336. created () {
  337. // 仓库
  338. if (this.warehouseList.length == 0) {
  339. this.getWarehouse()
  340. }
  341. },
  342. methods: {
  343. // 查询产品列表
  344. getList (params) {
  345. const _this = this
  346. return querySumByProductLocation(params).then(res => {
  347. let data
  348. this.onlyList = false
  349. if (res.status == 200) {
  350. data = res.data
  351. data.list = data.list.filter(item => item != null)
  352. const no = (data.pageNo - 1) * data.pageSize
  353. for (var i = 0; i < data.list.length; i++) {
  354. data.list[i].no = no + i + 1
  355. data.list[i].salesNums = 1
  356. data.list[i].currentQty = data.list[i].currentQty || 0 // 库存数量
  357. // 价格
  358. data.list[i].price = data.list[i].origSalePriceFlag == 0 ? data.list[i].lastSalePrice : data.list[i].origSalePriceFlag == 1 ? data.list[i].salePrice : data.list[i].selfSaleprice
  359. // 原厂编码
  360. data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
  361. }
  362. if (!params.vinCode) {
  363. _this.vinInfoData = null
  364. }
  365. } else {
  366. data = {
  367. list: [],
  368. pageNo: 1,
  369. pageSize: 10
  370. }
  371. }
  372. _this.disabled = false
  373. return data
  374. })
  375. },
  376. // 车型vin码变更时
  377. vinCodeChange (e) {
  378. if (e.target.value.length == 17) {
  379. supperCodeByVin({ vin: e.target.value }).then(res => {
  380. if (res.status == 200) {
  381. this.queryParam.productCodeList = res.data
  382. } else {
  383. this.queryParam.productCodeList = undefined
  384. }
  385. })
  386. } else {
  387. this.queryParam.productCodeList = undefined
  388. }
  389. },
  390. // 双击列表
  391. handleClickRow (record) {
  392. this.$emit('add', record)
  393. },
  394. // 重置列表
  395. resetSearchForm () {
  396. this.queryParam.productCode = ''
  397. this.queryParam.productName = ''
  398. this.queryParam.productOrigCode = ''
  399. this.queryParam.brandSn = undefined
  400. this.queryParam.productTypeSn1 = ''
  401. this.queryParam.productTypeSn2 = ''
  402. this.queryParam.productTypeSn3 = ''
  403. this.queryParam.warehouseSn = undefined
  404. this.queryParam.productCodeList = undefined
  405. this.queryParam.existStockFlag = undefined
  406. this.queryParam.vinCode = ''
  407. this.productType = []
  408. this.$refs.ruleForm.resetFields()
  409. this.$refs.table.refresh(true)
  410. this.vinInfoData = null
  411. },
  412. // 初始页面
  413. pageInit (buyerSn, priceType, salesBillSn, sourceType) {
  414. this.sourceType = sourceType
  415. this.priceType = priceType || ''
  416. this.buyerSn = buyerSn || ''
  417. this.queryParam.salesBillSn = salesBillSn || ''
  418. if (this.onlyList) { // 不清空查询条件
  419. this.$refs.table.refresh()
  420. } else {
  421. this.resetSearchForm()
  422. }
  423. this.$refs.searchProductCode.focus()
  424. },
  425. // 刷新当前页面
  426. resetCurForm () {
  427. this.$refs.table.refresh()
  428. },
  429. // 清空数据
  430. clearTable () {
  431. this.vinInfoData = null
  432. this.$refs.ruleForm.resetFields()
  433. this.$refs.table.clearTable()
  434. },
  435. // 仓库按名称筛选
  436. filterOption (input, option) {
  437. return (
  438. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  439. )
  440. },
  441. // 选择配件
  442. handleAdd (row) {
  443. const _this = this
  444. // console.log(row.price, row.lastSalePrice, row.salePrice, row.lastSalePrice < row.salePrice)
  445. // 售价低于定价
  446. if (row.lastSalePrice && (row.price < row.salePrice)) {
  447. _this.$confirm({
  448. title: '提示',
  449. content: '售价低于定价,是否仍继续添加?',
  450. centered: true,
  451. closable: true,
  452. onOk () {
  453. _this.$emit('add', row)
  454. }
  455. })
  456. } else {
  457. _this.$emit('add', row)
  458. }
  459. },
  460. // 销售记录
  461. handleDetail (row) {
  462. this.openModal = true
  463. this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn, row)
  464. },
  465. // 关闭销售记录弹框
  466. closeModal () {
  467. this.openModal = false
  468. },
  469. // 上传图片
  470. uploadFun () {
  471. document.getElementById('partQuery-filed').click()
  472. },
  473. // 文件上传后
  474. filePreview (e) {
  475. const _this = this
  476. var files = e.target.files[0]
  477. const formData = new FormData()
  478. formData.append('savePathType', 'local')
  479. formData.append('file', files)
  480. this.vinLoading = true
  481. // 识别图片中的vin
  482. vinCodeParse(formData).then(res => {
  483. if (res.type == 'application/json') {
  484. var reader = new FileReader()
  485. reader.addEventListener('loadend', function () {
  486. const obj = JSON.parse(reader.result)
  487. if (obj.status == 200) {
  488. _this.queryParam.vinCode = obj.data || ''
  489. // 移除表单项的校验结果
  490. _this.$refs.ruleForm.clearValidate('vinCode')
  491. } else {
  492. _this.$notification.error({
  493. message: '提示',
  494. description: obj.message
  495. })
  496. }
  497. _this.vinLoading = false
  498. document.getElementById('filed').value = ''
  499. })
  500. reader.readAsText(res)
  501. } else {
  502. _this.vinLoading = false
  503. }
  504. })
  505. },
  506. // 仓库变更
  507. getWarehouse () {
  508. warehouseAllList({ wasteFlag: 0 }).then(res => {
  509. if (res.status == 200) {
  510. this.warehouseList = res.data
  511. } else {
  512. this.warehouseList = []
  513. }
  514. })
  515. },
  516. // 产品分类变更
  517. changeProductType (val, opt) {
  518. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  519. this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
  520. this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
  521. },
  522. // 查看是否有库存、
  523. handleHasQty (val) {
  524. this.queryParam.existStockFlag = val
  525. }
  526. },
  527. watch: {
  528. // 成本显示变化
  529. cost (newValue, oldValue) {
  530. this.$emit('isCost', newValue)
  531. }
  532. }
  533. }
  534. </script>