productList.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <template>
  2. <div>
  3. <div class="table-page-search-wrapper" v-show="showDescBox&&descDetail">
  4. <a-descriptions :column="4">
  5. <a-descriptions-item label="促销类型">
  6. {{ descDetail.promotionRuleTypeDictValue }}
  7. </a-descriptions-item>
  8. <a-descriptions-item label="促销门槛" span="3">
  9. {{ descDetail.gateTypeDictValue }}
  10. </a-descriptions-item>
  11. <a-descriptions-item label="促销规则">
  12. 购买满10个正价产品,送10个促销产品
  13. </a-descriptions-item>
  14. <a-descriptions-item label="显示正价产品款数">
  15. 40
  16. </a-descriptions-item>
  17. <a-descriptions-item label="订单起订金额">
  18. 20000
  19. </a-descriptions-item>
  20. <a-descriptions-item label="活动经费上线">
  21. 8000
  22. </a-descriptions-item>
  23. </a-descriptions>
  24. </div>
  25. <!-- 筛选条件 -->
  26. <div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
  27. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  28. <a-row :gutter="15">
  29. <a-col :md="4" :sm="24">
  30. <a-form-item label="出库仓库" prop="warehouseSn">
  31. <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" @load="warehouseLoad"></chooseWarehouse>
  32. </a-form-item>
  33. </a-col>
  34. <a-col :md="4" :sm="24">
  35. <a-form-item label="产品编码" prop="productCode">
  36. <a-input id="salesEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
  37. </a-form-item>
  38. </a-col>
  39. <a-col :md="4" :sm="24">
  40. <a-form-item label="产品名称" prop="productName">
  41. <a-input id="salesEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
  42. </a-form-item>
  43. </a-col>
  44. <a-col :md="4" :sm="24">
  45. <a-form-item label="品牌">
  46. <ProductBrand id="salesEdit-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :md="4" :sm="24">
  50. <a-form-item label="产品分类">
  51. <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="salesEdit-productType"></productTypeAll>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
  55. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
  56. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
  57. </a-col>
  58. </a-row>
  59. </a-form>
  60. </div>
  61. <div class="table-page-search-wrapper">
  62. <a-row :gutter="15" type="flex" justify="space-between" align="middle">
  63. <a-col :md="12" :sm="24" style="text-align:left;">
  64. <a-dropdown>
  65. <a-menu slot="overlay" @click="handleMenuClick">
  66. <a-menu-item key="0">
  67. 仓库设置
  68. </a-menu-item>
  69. <a-menu-item key="1">
  70. 删除已选项
  71. </a-menu-item>
  72. <a-menu-item key="2">
  73. 全部删除
  74. </a-menu-item>
  75. </a-menu>
  76. <a-button
  77. type="default"
  78. class="button-info"
  79. > 批量操作 <a-icon type="down" /> </a-button>
  80. </a-dropdown>
  81. <span v-if="selectTotal" style="margin-left:5px;">已选{{ selectTotal }}项</span>
  82. </a-col>
  83. <a-col :md="12" :sm="24" style="text-align:right;">
  84. <a-button
  85. type="link"
  86. class="button-info"
  87. @click="showSearchBox=!showSearchBox" ><a-icon type="search"/> 筛选</a-button>
  88. <a-dropdown>
  89. <a-menu slot="overlay" @click="handleImportClick">
  90. <a-menu-item key="0">
  91. 导入门槛产品
  92. </a-menu-item>
  93. <a-menu-item key="1">
  94. 导入正价产品
  95. </a-menu-item>
  96. <a-menu-item key="2">
  97. 导入促销产品
  98. </a-menu-item>
  99. </a-menu>
  100. <a-button
  101. type="link"
  102. class="button-info"
  103. > 导入产品 <a-icon type="down" /> </a-button>
  104. </a-dropdown>
  105. <a-button
  106. type="link"
  107. class="button-info"
  108. @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
  109. </a-col>
  110. </a-row>
  111. </div>
  112. <!-- 已选配件列表 -->
  113. <s-table
  114. class="sTable"
  115. ref="table"
  116. size="small"
  117. :rowKey="(record) => record.id"
  118. :columns="columns"
  119. :data="loadData"
  120. :row-selection="{ columnWidth: 40 }"
  121. @rowSelection="rowSelectionFun"
  122. :pageSize="10"
  123. bordered>
  124. <!-- 产品编码 -->
  125. <template slot="productCode" slot-scope="text, record">
  126. <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)">
  127. <div style="padding-right: 15px;">{{ text }}</div>
  128. </a-badge>
  129. <span v-if="!(Number(record.stockQty||0) < Number(record.unpushedQty||0))">{{ text }}</span>
  130. </template>
  131. <!-- 产品名称 -->
  132. <template slot="productName" slot-scope="text, record">
  133. <div class="ellipsisCon">
  134. <a-tooltip placement="rightBottom">
  135. <template slot="title">
  136. <span>{{ text }}</span>
  137. </template>
  138. <span class="ellipsisText">{{ text }}</span>
  139. </a-tooltip>
  140. <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
  141. </div>
  142. </template>
  143. <!-- 销售数量 -->
  144. <template slot="salesNums" slot-scope="text, record">
  145. <a-input-number
  146. id="salesEdit-qty"
  147. size="small"
  148. v-model="record.qty"
  149. :precision="0"
  150. :min="1"
  151. :max="999999"
  152. placeholder="请输入"
  153. @blur="e => onCellBlur(e.target.value, record)"
  154. style="width: 100%;" />
  155. </template>
  156. <!-- 当前库存 -->
  157. <template slot="stockQty" slot-scope="text, record">
  158. <div v-if="record.stockQty || record.stockQty==0">
  159. <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty||0) - Number(record.stockQty||0) }}</span>)</p>
  160. <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
  161. </div>
  162. <span v-else>--</span>
  163. </template>
  164. <!-- 出库仓库 -->
  165. <template slot="warehouseBox" slot-scope="text, record">
  166. <a-select
  167. size="small"
  168. style="width:100%;"
  169. placeholder="请选择仓库"
  170. v-model="record.warehouseSn"
  171. :showSearch="true"
  172. @change="handleWarehouseBox(record)"
  173. mode="default"
  174. :filter-option="filterOption">
  175. <a-select-option v-for="item in warehouseDataList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
  176. </a-select>
  177. </template>
  178. <!-- 操作 -->
  179. <template slot="action" slot-scope="text, record">
  180. <a-button
  181. size="small"
  182. type="link"
  183. :loading="delLoading"
  184. class="button-error"
  185. @click="handleDel(record)"
  186. >删除</a-button>
  187. <a-button
  188. size="small"
  189. type="link"
  190. :loading="delLoading"
  191. class="button-primary"
  192. @click="handleUpdateActive(record)"
  193. >换促销</a-button>
  194. </template>
  195. <template slot="footer" slot-scope="currentPageData">
  196. <!-- 总计 -->
  197. <a-alert type="info" banner :showIcon="false">
  198. <div slot="message" class="alert-bar">
  199. <div>
  200. 还需门槛产品金额1000/4000(5000),已选择0元(可使用8000元配额)正价产品,已选择8个正价产品(满10送2),<strong>再满2件产品,可享受优惠</strong>,差200元到订单起订金额(1800元),可选择4个促销产品,已选择2个促销产品
  201. </div>
  202. <div>
  203. <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong></div>
  204. <div v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong></div>
  205. </div>
  206. </div>
  207. </a-alert>
  208. </template>
  209. </s-table>
  210. <!-- 导入产品 -->
  211. <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeImportOk" />
  212. <!-- 仓库设置 -->
  213. <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
  214. <!-- 换促销 -->
  215. <updateActiveModal :show="openUpActiveModal" @ok="upActiveOk" @cancel="openUpActiveModal=false"></updateActiveModal>
  216. </div>
  217. </template>
  218. <script>
  219. import { commonMixin } from '@/utils/mixin'
  220. import { STable, VSelect } from '@/components'
  221. import ImportGuideModal from './importGuideModal.vue'
  222. import setWarehouse from './setWarehouse.vue'
  223. import updateActiveModal from './updateActiveModal.vue'
  224. import chooseWarehouse from '@/views/common/chooseWarehouse'
  225. import ProductBrand from '@/views/common/productBrand.js'
  226. import productTypeAll from '@/views/common/productTypeAll.js'
  227. import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, salesBatchInsert } from '@/api/salesDetailNew'
  228. export default {
  229. name: 'ProductList',
  230. mixins: [commonMixin],
  231. components: {
  232. STable,
  233. VSelect,
  234. ImportGuideModal,
  235. chooseWarehouse,
  236. setWarehouse,
  237. ProductBrand,
  238. productTypeAll,
  239. updateActiveModal
  240. },
  241. props: {
  242. openModal: { // 弹框显示状态
  243. type: Boolean,
  244. default: false
  245. },
  246. newLoading: Boolean,
  247. detailData: {
  248. type: Object,
  249. default: function(){return null}
  250. },
  251. id: {
  252. type: String,
  253. default: ''
  254. },
  255. warehouseSn: {
  256. type: String,
  257. default: ''
  258. },
  259. salesBillSn: {
  260. type: String,
  261. default: ''
  262. }
  263. },
  264. data () {
  265. return {
  266. spinning: false,
  267. // 加载数据方法 必须为 Promise 对象
  268. loadData: parameter => {
  269. this.disabled = true
  270. this.queryParam.salesBillSn = this.salesBillSn || ''
  271. return salesDetailList(Object.assign(parameter, this.queryParam, {showStock: true})).then(res => {
  272. let data
  273. if (res.status == 200) {
  274. data = res.data
  275. const no = (data.pageNo - 1) * data.pageSize
  276. for (var i = 0; i < data.list.length; i++) {
  277. data.list[i].no = no + i + 1
  278. data.list[i].qtyBackups = data.list[i].qty
  279. }
  280. this.disabled = false
  281. this.dataSource = data.list
  282. }
  283. return data
  284. })
  285. },
  286. showSearchBox: false,
  287. showDescBox: false,
  288. openWarehouseModal: false, // 打开仓库设置
  289. openGuideModal: false, // 导入产品引导
  290. delLoading: false,
  291. chooseDisabled: false,
  292. disabled: false, // 查询、重置按钮是否可操作
  293. queryParam: {
  294. warehouseSn: undefined,
  295. productCode: '',
  296. productName: '',
  297. productBrandSn: undefined,
  298. productTypeSn1: '', // 产品一级分类
  299. productTypeSn2: '', // 产品二级分类
  300. productTypeSn3: '' // 产品三级分类
  301. },
  302. productType: [],
  303. rowSelectionInfo: null,
  304. warehouseDataList: [],
  305. openUpActiveModal: false,
  306. descDetail: null
  307. }
  308. },
  309. computed: {
  310. selectTotal () {
  311. return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
  312. },
  313. columns () {
  314. const arr = [
  315. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  316. { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center', sorter: true },
  317. { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
  318. // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  319. { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
  320. { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
  321. { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
  322. { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  323. // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  324. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  325. ]
  326. if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
  327. arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  328. arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  329. }
  330. return arr
  331. }
  332. },
  333. watch: {
  334. salesBillSn(newValue, oldValue) {
  335. this.resetSearchForm()
  336. }
  337. },
  338. methods: {
  339. filterOption (input, option) {
  340. return (
  341. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  342. )
  343. },
  344. warehouseLoad(sn,list){
  345. this.warehouseDataList = list
  346. },
  347. showSearch(){
  348. this.showSearchBox = !this.showSearchBox
  349. },
  350. showDesc(descDetail){
  351. this.showDescBox = !this.showDescBox
  352. this.descDetail = descDetail
  353. },
  354. openCpModal(){
  355. this.$emit('openCpModal', 1, 'productList-'+this.id)
  356. },
  357. // 表格选中项
  358. rowSelectionFun (obj) {
  359. this.rowSelectionInfo = obj || null
  360. },
  361. // 产品分类 change
  362. changeProductType (val, opt) {
  363. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  364. this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
  365. this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
  366. },
  367. // 重置
  368. resetSearchForm (flag) {
  369. this.queryParam.productCode = ''
  370. this.queryParam.productName = ''
  371. this.queryParam.warehouseSn = undefined
  372. this.queryParam.productBrandSn = undefined
  373. this.queryParam.productTypeSn1 = ''
  374. this.queryParam.productTypeSn2 = ''
  375. this.queryParam.productTypeSn3 = ''
  376. this.productType = []
  377. this.$refs.table.refresh(!!flag)
  378. },
  379. // 删除全部产品
  380. handleBatchDelAll () {
  381. const _this = this
  382. if (_this.dataSource.length == 0) {
  383. _this.$message.warning('暂无可删除的已选产品!')
  384. return
  385. }
  386. this.$confirm({
  387. title: '提示',
  388. content: '确认要删除全部已选产品吗?',
  389. centered: true,
  390. onOk () {
  391. _this.spinning = true
  392. deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
  393. if (res.status == 200) {
  394. _this.resetSearchForm(true)
  395. _this.$message.success(res.message)
  396. }
  397. _this.spinning = false
  398. })
  399. }
  400. })
  401. },
  402. // 批量删除已选产品
  403. handleBatchDel () {
  404. const _this = this
  405. if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
  406. _this.$message.warning('请先选择要删除的产品后再进行批量操作!')
  407. return
  408. }
  409. const obj = []
  410. _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
  411. obj.push(item.salesBillDetailSn)
  412. })
  413. this.$confirm({
  414. title: '提示',
  415. content: '已选产品' + obj.length + '项,确认要批量删除吗?',
  416. centered: true,
  417. onOk () {
  418. _this.spinning = true
  419. salesDetailBatchDel({
  420. salesBillSn: _this.salesBillSn,
  421. salesBillDetailSnList: obj
  422. }).then(res => {
  423. if (res.status == 200) {
  424. _this.resetSearchForm(true)
  425. _this.$message.success(res.message)
  426. }
  427. _this.spinning = false
  428. })
  429. }
  430. })
  431. },
  432. // 设置单个出库仓库
  433. handleWarehouseBox (row) {
  434. const snArr = [row.salesBillDetailSn]
  435. const ajax_data = {
  436. warehouseSn: row.warehouseSn,
  437. salesBillDetailSnList: snArr,
  438. salesBillSn: this.salesBillSn
  439. }
  440. this.setWarehouseInfo(ajax_data)
  441. },
  442. chooseWarehouseOk (sn) {
  443. const _this = this
  444. const snArr = []
  445. _this.rowSelectionInfo.selectedRows.forEach(item => {
  446. snArr.push(item.salesBillDetailSn)
  447. })
  448. const ajax_data = {
  449. warehouseSn: sn,
  450. salesBillDetailSnList: snArr,
  451. salesBillSn: _this.salesBillSn
  452. }
  453. _this.setWarehouseInfo(ajax_data)
  454. },
  455. setWarehouseInfo (data) {
  456. const _this = this
  457. _this.spinning = true
  458. updateWarehouse(data).then(res => {
  459. if (res.status == 200) {
  460. _this.openWarehouseModal = false
  461. _this.resetSearchForm(true)
  462. _this.$message.success(res.message)
  463. }
  464. _this.$refs.table.refresh(true)
  465. _this.spinning = false
  466. })
  467. },
  468. handleMenuClick (e) {
  469. const _this = this
  470. if (e.key == 0) { // 仓库设置
  471. if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
  472. _this.$message.warning('请先选择要设置的产品!')
  473. } else {
  474. _this.openWarehouseModal = true
  475. }
  476. } else if (e.key == 1) { // 删除已选项
  477. this.handleBatchDel()
  478. } else {
  479. this.handleBatchDelAll()
  480. }
  481. },
  482. // 换促销
  483. upActiveOk(data){
  484. this.openUpActiveModal = false
  485. },
  486. handleUpdateActive(record){
  487. this.openUpActiveModal = true
  488. },
  489. // 已选产品 blur
  490. onCellBlur (val, record) {
  491. const _this = this
  492. // 光标移出,值发生改变再调用编辑接口
  493. if (val && val != record.qtyBackups) {
  494. _this.spinning = true
  495. salesDetailUpdateQty({
  496. salesBillDetailSn: record.salesBillDetailSn,
  497. qty: record.qty,
  498. salesBillSn: _this.salesBillSn
  499. }).then(res => {
  500. _this.resetSearchForm(true)
  501. if (res.status == 200) {
  502. _this.$message.success(res.message)
  503. }
  504. _this.spinning = false
  505. })
  506. } else {
  507. record.qty = record.qtyBackups
  508. }
  509. },
  510. // 删除产品
  511. handleDel (row) {
  512. const _this = this
  513. this.$confirm({
  514. title: '提示',
  515. content: '确认要删除吗?',
  516. centered: true,
  517. closable: true,
  518. onOk () {
  519. _this.delLoading = true
  520. _this.spinning = true
  521. salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
  522. if (res.status == 200) {
  523. _this.resetSearchForm(true)
  524. _this.$message.success(res.message)
  525. }
  526. _this.delLoading = false
  527. _this.spinning = false
  528. })
  529. }
  530. })
  531. },
  532. // 添加产品
  533. insterProduct (row, promotionFlag) {
  534. console.log(row, promotionFlag)
  535. // 防止多次添加产品
  536. if (this.isInster) { return }
  537. const _this = this
  538. _this.saveNewProduct(row, promotionFlag)
  539. },
  540. // 保存添加的产品到销售列表
  541. saveNewProduct (row, promotionFlag) {
  542. this.$message.loading('正在添加产品...', 1)
  543. this.isInster = true
  544. this.spinning = true
  545. salesDetailInsert({
  546. packQty: row.productPackQty,
  547. productSn: row.productSn,
  548. showCost: row.lastStockCost,
  549. price: row.productPrice,
  550. origPrice: row.productPrice,
  551. promotionGiftsAmount: 0,
  552. usePromotionGiftsAmount: 0,
  553. qty: row.salesNums,
  554. salesBillSn: this.detailData.salesBillSn,
  555. salesBillNo: this.detailData.salesBillNo,
  556. purchaseBillSn: this.detailData.purchaseBillSn,
  557. purchaseBillNo: this.detailData.purchaseBillNo,
  558. stockSn: row.stockSn,
  559. promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
  560. promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
  561. warehouseSn: row.warehouseSn
  562. }).then(res => {
  563. if (res.status == 200) {
  564. this.resetSearchForm()
  565. this.$message.success('产品添加成功', 2.5)
  566. }
  567. this.spinning = false
  568. this.isInster = false
  569. }).catch(err => {
  570. this.isInster = false
  571. this.spinning = false
  572. })
  573. },
  574. // 导入产品
  575. handleImportClick(e){
  576. this.openGuideModal = true
  577. },
  578. closeGuideModel () {
  579. this.openGuideModal = false
  580. },
  581. hanldeImportOk (obj) {
  582. salesBatchInsert(obj).then(res => {
  583. if (res.status == 200) {
  584. this.$refs.table.refresh(true)
  585. this.getOrderDetail(false)
  586. }
  587. })
  588. },
  589. }
  590. }
  591. </script>
  592. <style lang="less">
  593. .alert-bar{
  594. display: flex;
  595. justify-content: space-between;
  596. align-items: center;
  597. > div{
  598. &:first-child{
  599. flex-grow: 1;
  600. width:70%;
  601. padding-right: 100px;
  602. }
  603. }
  604. }
  605. </style>