index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="115px">
  4. <el-form-item label="供应商编码" prop="supplierCode">
  5. <el-input
  6. v-model="queryParams.supplierCode"
  7. placeholder="请输入"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="供应商名称" prop="name">
  14. <el-input
  15. v-model="queryParams.supplierName"
  16. placeholder="请输入"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="是否含包装" prop="">
  23. <el-select v-model="queryParams.packagingFlag" placeholder="请选择" clearable size="small" >
  24. <el-option
  25. v-for="item in packagingFlagOptions"
  26. :key="item.dictValue"
  27. :label="item.dictLabel"
  28. :value="item.dictValue"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="是否包邮" prop="">
  33. <el-select v-model="queryParams.shippingFlag" placeholder="请选择" clearable size="small" >
  34. <el-option
  35. v-for="item in shippingFlagOptions"
  36. :key="item.dictValue"
  37. :label="item.dictLabel"
  38. :value="item.dictValue"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="供应商商品编码" prop="supplierSpucode">
  43. <el-input
  44. v-model="queryParams.supplierSpucode"
  45. placeholder="请输入"
  46. clearable
  47. size="small"
  48. @keyup.enter.native="handleQuery"
  49. />
  50. </el-form-item>
  51. <el-form-item label="供应商SKU编码" prop="supplierSkucode">
  52. <el-input
  53. v-model="queryParams.supplierSkucode"
  54. placeholder="请输入"
  55. clearable
  56. size="small"
  57. @keyup.enter.native="handleQuery"
  58. />
  59. </el-form-item>
  60. <el-form-item label="商品编码" prop="spuCode">
  61. <el-input
  62. v-model="queryParams.spuCode"
  63. placeholder="请输入"
  64. clearable
  65. size="small"
  66. @keyup.enter.native="handleQuery"
  67. />
  68. </el-form-item>
  69. <el-form-item label="SKU编码" prop="skuCode">
  70. <el-input
  71. v-model="queryParams.skuCode"
  72. placeholder="请输入"
  73. clearable
  74. size="small"
  75. @keyup.enter.native="handleQuery"
  76. />
  77. </el-form-item>
  78. <el-form-item>
  79. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  80. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  81. </el-form-item>
  82. </el-form>
  83. <el-row :gutter="10" class="mb8">
  84. <el-col :span="1.5">
  85. <el-button
  86. type="primary"
  87. icon="el-icon-plus"
  88. size="mini"
  89. @click="handleAdd"
  90. v-hasPermi="['oms:supplierProduct:add']"
  91. >新增</el-button>
  92. </el-col>
  93. <el-col :span="1.5">
  94. <el-button
  95. type="success"
  96. icon="el-icon-edit"
  97. size="mini"
  98. :disabled="single"
  99. @click="handleUpdate"
  100. v-hasPermi="['oms:supplierProduct:edit']"
  101. >修改</el-button>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-button
  105. type="danger"
  106. icon="el-icon-delete"
  107. size="mini"
  108. :disabled="multiple"
  109. @click="handleDelete"
  110. v-hasPermi="['oms:supplierProduct:remove']"
  111. >删除</el-button>
  112. </el-col>
  113. <el-col :span="1.5">
  114. <el-button
  115. type="warning"
  116. icon="el-icon-download"
  117. size="mini"
  118. @click="handleExport"
  119. v-hasPermi="['oms:supplierProduct:export']"
  120. >导出</el-button>
  121. </el-col>
  122. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  123. </el-row>
  124. <el-table border v-loading="loading" :data="supplierProductList" @selection-change="handleSelectionChange">
  125. <el-table-column type="selection" width="55" align="center" />
  126. <el-table-column label="序号" width="55" type="index" align="center" />
  127. <el-table-column label="id" prop="id" v-if="false"></el-table-column>
  128. <el-table-column label="商品图片" align="center" width="160">
  129. <template slot-scope="scope">
  130. <el-popover
  131. placement="right"
  132. title=""
  133. trigger="hover"
  134. >
  135. <img slot="reference" :src="scope.row.image" width="100">
  136. <img :src="scope.row.image" style="max-width: 150px;">
  137. </el-popover>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="商品编码" width="160" align="center" prop="spuCode" />
  141. <el-table-column label="商品名称" width="160" show-overflow-tooltip align="center" prop="spuName" />
  142. <el-table-column label="SKU编码" width="160" align="center" prop="skuCode" />
  143. <el-table-column label="SKU名称" width="160" align="center" prop="skuName" />
  144. <el-table-column label="供应商编码" width="160" align="center" prop="supplierCode" />
  145. <el-table-column label="供应商名称" width="160" align="center" prop="name" />
  146. <el-table-column label="含税采购价" width="120" align="center" prop="taxunitPrice" />
  147. <el-table-column label="不含税采购价" width="120" align="center" prop="unitPrice" />
  148. <el-table-column label="税率" width="100" align="center" prop="taxRate" >
  149. <template v-slot="scope">
  150. {{ scope.row.taxRate }} %
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="供应商SKU编码" width="160" align="center" prop="supplierSkucode" />
  154. <el-table-column label="供应商商品编码" width="160" align="center" prop="supplierSpucode" />
  155. <el-table-column label="是否含包装" width="100" align="center" prop="packagingFlag" >
  156. <template slot-scope="scope">
  157. <el-tag prop="packagingFlag" v-for="(item, index) in packagingFlagOptions" v-if="scope.row.packagingFlag==item.dictValue">{{item.dictLabel}}</el-tag>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="是否包邮" width="100" align="center" prop="shippingFlag" >
  161. <template slot-scope="scope">
  162. <el-tag prop="shippingFlag" v-for="(item, index) in shippingFlagOptions" v-if="scope.row.shippingFlag==item.dictValue">{{item.dictLabel}}</el-tag>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="备注" width="124" align="left" prop="remark" />
  166. <el-table-column label="操作" align="center" width="110" fixed="right" class-name="small-padding fixed-width">
  167. <template slot-scope="scope">
  168. <el-button
  169. size="mini"
  170. type="text"
  171. icon="el-icon-edit"
  172. @click="handleUpdate(scope.row)"
  173. v-hasPermi="['oms:supplierProduct:edit']"
  174. >修改</el-button>
  175. <el-button
  176. size="mini"
  177. type="text"
  178. icon="el-icon-delete"
  179. @click="handleDelete(scope.row)"
  180. v-hasPermi="['oms:supplierProduct:remove']"
  181. >删除</el-button>
  182. </template>
  183. </el-table-column>
  184. </el-table>
  185. <pagination
  186. v-show="total>0"
  187. :total="total"
  188. :page.sync="queryParams.pageNum"
  189. :limit.sync="queryParams.pageSize"
  190. @pagination="getList"
  191. />
  192. <!-- 添加或修改供应商商品对话框 -->
  193. <el-dialog :title="title" :visible.sync="open" width="1030px" append-to-body>
  194. <el-form ref="form" :model="form" :rules="rules" label-width="130px" >
  195. <el-form-item label="供应商编码" prop="code" v-if="false">
  196. <el-input v-model="form.supplierCode" placeholder="请输入" />
  197. </el-form-item>
  198. <el-form-item label="供应商id" prop="id" v-if="false">
  199. <el-input v-model="form.supplierId" placeholder="请输入" />
  200. </el-form-item>
  201. <el-row >
  202. <el-col :span="12">
  203. <el-form-item label="供应商" prop="name" >
  204. <el-select v-model="form.name" @change="selectSupplier">
  205. <el-option v-for="item in supplierOptions"
  206. :label="item.name"
  207. :value="item.name"/>
  208. </el-select>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="12" >
  212. <el-form-item label="供应商商品编码" prop="supplierSpucode" >
  213. <el-input v-model="form.supplierSpucode" placeholder="请输入" />
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. <el-row >
  218. <el-col :span="12" >
  219. <el-form-item label="供应商SKU编码" prop="supplierSkucode">
  220. <el-input v-model="form.supplierSkucode" placeholder="请输入" />
  221. </el-form-item>
  222. </el-col>
  223. <el-col :span="12" >
  224. <el-form-item label="含税采购价" prop="taxunitPrice">
  225. <el-input v-model="form.taxunitPrice" placeholder="请输入" />
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. <el-row >
  230. <el-col :span="12">
  231. <el-form-item label="不含税采购价" prop="unitPrice">
  232. <el-input v-model="form.unitPrice" placeholder="请输入" />
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="12">
  236. <el-form-item label="税率" prop="taxRate">
  237. <el-input v-model="form.taxRate" placeholder="请输入" >
  238. <template slot="append">%</template>
  239. </el-input>
  240. </el-form-item>
  241. </el-col>
  242. </el-row>
  243. <el-row>
  244. <el-col :span="12">
  245. <el-form-item label="是否含包装" prop="packagingFlag">
  246. <el-radio-group v-model="form.packagingFlag">
  247. <el-radio :label="item.dictValue" v-for="item in packagingFlagOptions" >{{item.dictLabel}}</el-radio>
  248. </el-radio-group>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="12">
  252. <el-form-item label="是否包邮" prop="shippingFlag">
  253. <el-radio-group v-model="form.shippingFlag">
  254. <el-radio :label="item.dictValue" v-for="item in shippingFlagOptions" >{{item.dictLabel}}</el-radio>
  255. </el-radio-group>
  256. </el-form-item>
  257. </el-col>
  258. </el-row>
  259. <el-row>
  260. <el-col :span="24">
  261. <el-form-item label="备注" prop="remark">
  262. <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入" />
  263. </el-form-item>
  264. </el-col>
  265. </el-row>
  266. <el-form-item>
  267. <el-button type="primary" plain @click="showDialog">添加商品</el-button>
  268. </el-form-item>
  269. <!-- <el-button @click="showDialog">添加商品</el-button> -->
  270. <el-form-item label="商品名称" prop="spuName" v-if="false">
  271. <el-input v-model="form.spuName" placeholder="请输入" />
  272. </el-form-item>
  273. <el-form-item label="商品编码" prop="spuCode" v-if="false">
  274. <el-input v-model="form.spuCode" placeholder="请输入商品编码" />
  275. </el-form-item>
  276. <el-form-item label="SKU编码" prop="skuCode" v-if="false">
  277. <el-input v-model="form.skuCode" placeholder="请输入" />
  278. </el-form-item>
  279. <el-form-item label="SKU名称" prop="skuName" v-if="false">
  280. <el-input v-model="form.skuName" placeholder="请输入" />
  281. </el-form-item>
  282. <el-form-item label="商品图片" prop="image" v-if="false">
  283. <el-input v-model="form.image" placeholder="请输入" />
  284. </el-form-item>
  285. <el-table border :data="selectProducts">
  286. <el-table-column label="商品图片" align="center" width="160" >
  287. <template slot-scope="scope">
  288. <el-popover
  289. placement="right"
  290. title=""
  291. trigger="hover"
  292. >
  293. <img slot="reference" :src="scope.row.image" width="100">
  294. <img :src="scope.row.image" style="max-width: 150px;">
  295. </el-popover>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="商品编码" align="center" prop="spuCode" />
  299. <el-table-column label="商品名称" align="center" prop="spuName" />
  300. <el-table-column label="SKU编码" align="center" prop="skuCode" />
  301. <el-table-column label="SKU名称" align="center" prop="skuName" />
  302. <el-table-column label="操作">
  303. <template slot-scope="scope">
  304. <el-button type="danger" icon="el-icon-delete" @click="removeSelected(scope.$index)">删除</el-button>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. </el-form>
  309. <div slot="footer" class="dialog-footer">
  310. <el-button type="primary" @click="submitForm">确 定</el-button>
  311. <el-button @click="cancel">取 消</el-button>
  312. </div>
  313. </el-dialog>
  314. <el-dialog :visible.sync="dialogVisible" title="选择商品" width="1050px">
  315. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="75px">
  316. <el-form-item label="商品名称" prop="spuName">
  317. <el-input
  318. v-model="queryParams.spuName"
  319. placeholder="请输入商品名称"
  320. clearable
  321. size="small"
  322. @keyup.enter.native="handleQuerys"
  323. />
  324. </el-form-item>
  325. <el-form-item label="商品编号" prop="spuCode">
  326. <el-input
  327. v-model="queryParams.spuCode"
  328. placeholder="请输入商品编号"
  329. clearable
  330. size="small"
  331. @keyup.enter.native="handleQuerys"
  332. />
  333. </el-form-item>
  334. <el-form-item label="SKU编号" prop="skuCode">
  335. <el-input
  336. v-model="queryParams.skuCode"
  337. placeholder="请输入SKU编号"
  338. clearable
  339. size="small"
  340. @keyup.enter.native="handleQuerys"
  341. />
  342. </el-form-item>
  343. <el-form-item>
  344. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuerys">搜索</el-button>
  345. <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">重置</el-button>
  346. </el-form-item>
  347. <right-toolbar :showSearch.sync="showSearch" @queryTable="getproductList"></right-toolbar>
  348. </el-form>
  349. <el-table border v-loading="loading" :data="productOptions" >
  350. <el-table-column label="序号" width="55" type="index" align="center" />
  351. <el-table-column label="商品编码" align="center" prop="spuCode" />
  352. <el-table-column label="商品图片" align="center" width="160">
  353. <template slot-scope="scope">
  354. <el-popover
  355. placement="right"
  356. title=""
  357. trigger="hover"
  358. >
  359. <img slot="reference" :src="scope.row.image" width="100">
  360. <img :src="scope.row.image" style="max-width: 150px;">
  361. </el-popover>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="商品名称" align="center" prop="spuName" />
  365. <el-table-column label="SKU编码" align="center" prop="skuCode" />
  366. <el-table-column label="SKU名称" align="center" prop="skuName" />
  367. <el-table-column label="商品分类" align="center" prop="cateName" />
  368. <el-table-column align="cneter">
  369. <template slot-scope="scope" >
  370. <el-button type="primary" @click="selectItem(scope.row)" >添加</el-button>
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. <span slot="footer" class="dialog-footer">
  375. <el-button @click="dialogVisible = false">取消</el-button>
  376. </span>
  377. </el-dialog>
  378. </div>
  379. </template>
  380. <script>
  381. import { listSupplierProduct, getSupplierProduct, delSupplierProduct, addSupplierProduct, updateSupplierProduct, exportSupplierProduct,listProduct } from "@/api/oms/supplierProduct";
  382. import {listSupplier} from "@/api/oms/supplier";
  383. import singleImg from '@/components/Material/single'
  384. import Material from '@/components/Material'
  385. export default {
  386. name: "SupplierProduct",
  387. components: {
  388. Material,
  389. singleImg,
  390. },
  391. watch: {
  392. imageArr: function(val) {
  393. this.form.image = val.join(',')
  394. }
  395. },
  396. data() {
  397. return {
  398. dialogVisible: false,
  399. // 遮罩层
  400. loading: true,
  401. // 选中数组
  402. ids: [],
  403. // 非单个禁用
  404. single: true,
  405. // 非多个禁用
  406. multiple: true,
  407. // 显示搜索条件
  408. showSearch: true,
  409. // 总条数
  410. total: 0,
  411. // 供应商商品表格数据
  412. supplierProductList: [],
  413. // 弹出层标题
  414. title: "",
  415. // 是否显示弹出层
  416. open: false,
  417. // 是否含包装 0否 1是字典
  418. packagingFlagOptions: [],
  419. // 是否包邮 0否 1是字典
  420. shippingFlagOptions: [],
  421. //供应商
  422. supplierOptions:[],
  423. imageArr:[],
  424. productOptions:[],
  425. selectProducts:[],
  426. // 查询参数
  427. queryParams: {
  428. pageNum: 1,
  429. pageSize: 10,
  430. supplierId: null,
  431. supplierCode: null,
  432. supplierSkucode: null,
  433. supplierSpucode: null,
  434. taxunitPrice: null,
  435. unitPrice: null,
  436. taxRate: null,
  437. packagingFlag: 1,
  438. shippingFlag: 1,
  439. image: null,
  440. spuCode: null,
  441. skuId: null,
  442. skuCode: null,
  443. skuName: null,
  444. createUserId: null,
  445. updateUserId: null,
  446. },
  447. // 表单参数
  448. form: {},
  449. // 表单校验
  450. rules: {
  451. image: [
  452. { required: true, message: "商品图片不能为空", trigger: "blur" }
  453. ],
  454. name: [
  455. { required: true, message: "供应商不能为空", trigger: "blur" }
  456. ],
  457. }
  458. };
  459. },
  460. created() {
  461. this.getList();
  462. this.getNameSelect();
  463. this.getproductList();
  464. this.getDicts("oms_packaging_flag").then(response => {
  465. this.packagingFlagOptions = response.data;
  466. });
  467. this.getDicts("oms_shipping_flag").then(response => {
  468. this.shippingFlagOptions = response.data;
  469. });
  470. },
  471. methods: {
  472. removeSelected(index) {
  473. this.selectProducts.splice(index, 1);
  474. },
  475. selectItem(row){
  476. this.form = row;
  477. this.selectProducts.push(row);
  478. this.dialogVisible = false;
  479. },
  480. showDialog() {
  481. this.dialogVisible = true;
  482. },
  483. /** 查询供应商商品列表 */
  484. getList() {
  485. this.loading = true;
  486. listSupplierProduct(this.queryParams).then(response => {
  487. this.supplierProductList = response.rows;
  488. this.total = response.total;
  489. this.loading = false;
  490. });
  491. },
  492. getNameSelect() {
  493. listSupplier(this.queryParams).then(response =>{
  494. this.supplierOptions = response.rows;
  495. });
  496. },
  497. selectSupplier(){
  498. console.log('supplierOptions',this.supplierOptions)
  499. const item = this.supplierOptions.find(item1=> item1.name === this.form.name)
  500. console.log(item)
  501. this.form.supplierId = item.id
  502. this.form.supplierCode = item.code
  503. },
  504. getproductList() {
  505. this.loading = true;
  506. listProduct(this.queryParams).then(response =>{
  507. this.productOptions = response.rows;
  508. this.total = response.total;
  509. this.loading = false;
  510. });
  511. },
  512. // 是否含包装 0否 1是字典翻译
  513. packagingFlagFormat(row, column) {
  514. return this.selectDictLabel(this.packagingFlagOptions, row.packagingFlag);
  515. },
  516. // 是否包邮 0否 1是字典翻译
  517. shippingFlagFormat(row, column) {
  518. return this.selectDictLabel(this.shippingFlagOptions, row.shippingFlag);
  519. },
  520. // 取消按钮
  521. cancel() {
  522. this.open = false;
  523. this.reset();
  524. },
  525. // 表单重置
  526. reset() {
  527. this.selectProducts = [];
  528. this.form = {
  529. id: null,
  530. name:null,
  531. supplierId: null,
  532. supplierCode: null,
  533. supplierSkucode: null,
  534. supplierSpucode: null,
  535. taxunitPrice: null,
  536. unitPrice: null,
  537. taxRate: null,
  538. packagingFlag: null,
  539. shippingFlag: null,
  540. remark: null,
  541. image: null,
  542. spuName: null,
  543. spuCode: null,
  544. skuId: null,
  545. skuCode: null,
  546. skuName: null,
  547. cateName:null,
  548. createUserId: null,
  549. updateUserId: null,
  550. createTime: null,
  551. updateTime: null
  552. };
  553. this.resetForm("form");
  554. this.imageArr=[];
  555. },
  556. /** 搜索按钮操作 */
  557. handleQuerys() {
  558. this.queryParams.pageNum = 1;
  559. this.getproductList();
  560. },
  561. /** 搜索按钮操作 */
  562. handleQuery() {
  563. this.queryParams.pageNum = 1;
  564. this.getList();
  565. },
  566. /** 重置按钮操作 */
  567. resetQuery() {
  568. this.resetForm("queryForm");
  569. this.handleQuery();
  570. },
  571. resetQuerys(){
  572. this.resetForm("queryForm");
  573. this.handleQuerys;
  574. },
  575. // 多选框选中数据
  576. handleSelectionChange(selection) {
  577. this.ids = selection.map(item => item.id)
  578. this.single = selection.length!==1
  579. this.multiple = !selection.length
  580. },
  581. /** 新增按钮操作 */
  582. handleAdd() {
  583. this.reset();
  584. this.open = true;
  585. this.title = "添加供应商商品";
  586. },
  587. /** 修改按钮操作 */
  588. handleUpdate(row) {
  589. this.reset();
  590. const id = row.id || this.ids
  591. getSupplierProduct(id).then(response => {
  592. this.form = response.data;
  593. this.form.shippingFlag = response.data.shippingFlag.toString();
  594. this.form.packagingFlag = response.data.packagingFlag.toString();
  595. this.selectProducts = response.selectProucts;
  596. this.open = true;
  597. this.title = "修改供应商商品";
  598. });
  599. },
  600. /** 提交按钮 */
  601. submitForm() {
  602. console.log(this.form)
  603. this.$refs["form"].validate(valid => {
  604. if (valid) {
  605. if (this.form.id != null) {
  606. updateSupplierProduct(this.form).then(response => {
  607. if (response.code === 200) {
  608. this.msgSuccess("修改成功");
  609. this.open = false;
  610. this.getList();
  611. }
  612. });
  613. } else {
  614. addSupplierProduct(this.form).then(response => {
  615. if (response.code === 200) {
  616. this.msgSuccess("新增成功");
  617. this.open = false;
  618. this.getList();
  619. }
  620. });
  621. }
  622. }
  623. });
  624. },
  625. /** 删除按钮操作 */
  626. handleDelete(row) {
  627. const ids = row.id || this.ids;
  628. this.$confirm('是否确认删除供应商商品编号为"' + ids + '"的数据项?', "警告", {
  629. confirmButtonText: "确定",
  630. cancelButtonText: "取消",
  631. type: "warning"
  632. }).then(function() {
  633. return delSupplierProduct(ids);
  634. }).then(() => {
  635. this.getList();
  636. this.msgSuccess("删除成功");
  637. }).catch(function() {});
  638. },
  639. /** 导出按钮操作 */
  640. handleExport() {
  641. const queryParams = this.queryParams;
  642. this.$confirm('是否确认导出所有供应商商品数据项?', "警告", {
  643. confirmButtonText: "确定",
  644. cancelButtonText: "取消",
  645. type: "warning"
  646. }).then(function() {
  647. return exportSupplierProduct(queryParams);
  648. }).then(response => {
  649. this.download(response.msg);
  650. }).catch(function() {});
  651. }
  652. }
  653. };
  654. </script>