goods-add.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <template>
  2. <div v-loading="loading">
  3. <div class="white-box">
  4. <el-form ref="form" label-width="auto" class="form-page">
  5. <el-form-item :label="$t('shop.productName')"><!-- 商品名称 -->
  6. <el-input v-model="form.goodsName"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="$t('shop.memberDiscount')"><!-- 会员折扣 -->
  9. <el-input v-model="form.sellDiscount"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="$t('shop.productType')"><!-- 商品类型 -->
  12. <el-checkbox v-for="(value,key) in GiftTypeArr" v-model="form.giftType[key-1]" :key="key" >{{value.name}}</el-checkbox>
  13. </el-form-item>
  14. <el-form-item :label="$t('shop.bvSplit')">
  15. <el-select v-model="form.pvSplit" placeholder="">
  16. <el-option
  17. v-for="item in pvSplitOptions"
  18. :key="item.value"
  19. :label="item.label"
  20. :value="item.value">
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item :label="$t('shop.productCategory')"><!-- 商品分类 -->
  25. <el-select v-model="form.categoryType" placeholder="">
  26. <el-option v-for="item in categoryType" :key="item.id" :label="item.name" :value="item.id"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item :label="$t('shop.productCode')"><!-- 商品编号 -->
  30. <el-input v-model="form.goodsNo"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="$t('shop.unit')"><!-- 单位 -->
  33. <el-input v-model="form.unit"></el-input>
  34. </el-form-item>
  35. <!-- <el-form-item :label="$t('shop.taxRate')">&lt;!&ndash; 税率 &ndash;&gt;-->
  36. <!-- <el-input v-model="form.taxRate">-->
  37. <!-- <template slot="append">%</template>-->
  38. <!-- </el-input>-->
  39. <!-- </el-form-item>-->
  40. <el-form-item :label="$t('shop.standardPrice')">
  41. <el-input-number v-model="form.sellPriceStandard" @input="handleInput" class="left-aligned-input" :precision="2" :step="0.1" :min="0" :controls="false" style="text-align: left"></el-input-number>
  42. </el-form-item>
  43. <!-- <el-form-item :label="$t('shop.salesPrice')">-->
  44. <!-- <el-input v-model="form.sellPrice"></el-input>-->
  45. <!-- </el-form-item>-->
  46. <!-- <el-form-item :label="$t('shop.marketPrice')">-->
  47. <!-- <el-input v-model="form.marketPrice"></el-input>-->
  48. <!-- </el-form-item>-->
  49. <el-form-item :label="$t('shop.priceBV')" v-show="pvDisabled"><!-- 价格BV -->
  50. <el-input v-model="form.pricePv"></el-input>
  51. </el-form-item>
  52. <el-form-item :label="$t('shop.availableCountries')"><!-- 可购买国家 -->
  53. <el-button type="primary" size="small" :disabled="!form.sellPriceStandard" @click="editAvailableCountries">{{ $t('shop.modifyAvailableCountries') }}</el-button>
  54. </el-form-item>
  55. <el-form-item :label="$t('shop.inventory')"><!-- 库存 -->
  56. <el-input v-model="form.storeNums"></el-input>
  57. </el-form-item>
  58. <el-form-item :label="$t('shop.productDetails')"><!-- 商品详情 -->
  59. <el-input
  60. type="textarea"
  61. :rows="2"
  62. :placeholder="$t('shop.enterContentNotice')"
  63. v-model="form.content">
  64. </el-input><!-- 请输入内容 -->
  65. </el-form-item>
  66. <el-form-item :label="$t('shop.order')"><!-- 排序 -->
  67. <el-input v-model="form.sort"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="$t('shop.uploadImages')"><!-- 上传图片 -->
  70. <div class='up_load'>
  71. <!-- <leo-uploader
  72. @on-success='upLoadSuccess'
  73. :request-route="'shop/upload'"
  74. ></leo-uploader> -->
  75. <Upload
  76. :request-route="'v1/shop/upload'"
  77. width="400px"
  78. height="160px"
  79. @on-success="upLoadSuccess"
  80. ></Upload>
  81. </div>
  82. </el-form-item>
  83. <el-form-item>
  84. <el-button type="primary" @click="addSubmit" :loading="submitButtonStat">{{ $t('table.add') }}<!-- 添加 --></el-button>
  85. </el-form-item>
  86. </el-form>
  87. </div>
  88. <el-dialog :title="$t('shop.modifyAvailableCountries')" :visible.sync="editAvailableCountriesDialog" top="3%" width="60%"><!-- 修改可购买国家 -->
  89. <el-form ref="form" label-width="130px" class="">
  90. <el-form-item :label="$t('shop.productName')"><!-- 商品名称 -->
  91. <el-input v-model="form.goodsName" disabled></el-input>
  92. </el-form-item>
  93. <el-form-item :label="$t('transportationConfig.countryName')">
  94. <el-input
  95. v-model="searchQuery"
  96. placeholder=""
  97. @input="updateTableData"
  98. ></el-input>
  99. </el-form-item>
  100. </el-form>
  101. <el-form :model="availableCountriesTableForm" ref="availableCountriesTableForm" :rules="rules">
  102. <el-table v-show="!searchQuery" :data="availableCountriesTableForm.availableCountriesList" ref="multipleTable" @row-click="handleRowClick" @selection-change="handleSelectionChange" @select="selectOne" :selectable="isRowSelectable" :header-cell-class-name="cellClass" stripe height="500" style="width: 100%;">
  103. <el-table-column
  104. type="selection"
  105. width="55"
  106. :selectable="selectable"
  107. :show-select-all="false"
  108. >
  109. </el-table-column>
  110. <el-table-column prop="NAME" :label="$t('transportationConfig.countryName')" />
  111. <el-table-column prop="LOCAL_CURRENCY_NAME" :label="$t('exchangeRateConfig.currencyType')" />
  112. <el-table-column :label="$t('shop.salesPrice')" min-width="100px;">
  113. <template slot-scope="scope">
  114. <el-form-item :prop="`availableCountriesList.${scope.$index}.sellPrice`" >
  115. <el-input-number v-model="scope.row.sellPrice" :controls="false"></el-input-number>
  116. </el-form-item>
  117. </template>
  118. </el-table-column>
  119. <el-table-column :label="$t('shop.marketPrice')" min-width="100px;">
  120. <template slot-scope="scope">
  121. <el-form-item :prop="`availableCountriesList.${scope.$index}.marketPrice`">
  122. <el-input-number v-model="scope.row.marketPrice" :precision="2" :min="0" :controls="false" clearable></el-input-number>
  123. </el-form-item>
  124. </template>
  125. </el-table-column>
  126. <el-table-column :label="$t('shop.taxRate')" min-width="100px;">
  127. <template slot-scope="scope">
  128. <el-form-item :prop="`availableCountriesList.${scope.$index}.taxRate`" >
  129. <div class="flexJfAc">
  130. <el-input-number v-model="scope.row.taxRate" :precision="2" :step="0.1" :min="0" :controls="false"></el-input-number><span>%</span>
  131. </div>
  132. </el-form-item>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <el-table v-show="searchQuery" :data="availableCountriesTableForm.tempData" ref="multipleTableTemp" @row-click="handleRowClickTemp" @selection-change="handleSelectionChangeTemp" @select="selectOneTemp" :selectable="isRowSelectable" :header-cell-class-name="cellClass" stripe height="500" style="width: 100%;">
  137. <el-table-column
  138. type="selection"
  139. width="55"
  140. :selectable="selectable"
  141. :show-select-all="false"
  142. >
  143. </el-table-column>
  144. <el-table-column prop="NAME" :label="$t('transportationConfig.countryName')" />
  145. <el-table-column prop="LOCAL_CURRENCY_NAME" :label="$t('exchangeRateConfig.currencyType')" />
  146. <el-table-column :label="$t('shop.salesPrice')" min-width="100px;">
  147. <template slot-scope="scope">
  148. <el-form-item :prop="`tempData.${scope.$index}.sellPrice`" >
  149. <el-input-number v-model="scope.row.sellPrice" :controls="false" disabled></el-input-number>
  150. </el-form-item>
  151. </template>
  152. </el-table-column>
  153. <el-table-column :label="$t('shop.marketPrice')" min-width="100px;">
  154. <template slot-scope="scope">
  155. <el-form-item :prop="`tempData.${scope.$index}.marketPrice`">
  156. <el-input-number v-model="scope.row.marketPrice" :precision="2" :min="0" :controls="false" clearable></el-input-number>
  157. </el-form-item>
  158. </template>
  159. </el-table-column>
  160. <el-table-column :label="$t('shop.taxRate')" min-width="100px;">
  161. <template slot-scope="scope">
  162. <el-form-item :prop="`tempData.${scope.$index}.taxRate`" >
  163. <div class="flexJfAc">
  164. <el-input-number v-model="scope.row.taxRate" :precision="2" :step="0.1" :min="0" :controls="false"></el-input-number><span>%</span>
  165. </div>
  166. </el-form-item>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-form>
  171. <div slot="footer" class="dialog-footer">
  172. <el-button type="warning" size="mini" @click="editAvailableCountriesDialog = false">{{ $t('table.cancel') }}</el-button>
  173. <el-button type="primary" size="mini" @click="submitAvailableCountries">{{ $t('table.confirm') }}</el-button>
  174. </div>
  175. </el-dialog>
  176. </div>
  177. </template>
  178. <script>
  179. import { addGoods, getAddGoodsConfig, getUploadToken } from '@/api/shop'
  180. import { getCountries } from "@/api/site"
  181. import Upload from '@/components/Upload'
  182. import baseInfo from '@/utils/baseInfo'
  183. export default {
  184. name: 'goods-add',
  185. components: {Upload},
  186. mounted () {
  187. this.getData()
  188. this.getFileToken()
  189. },
  190. data () {
  191. return {
  192. dialogImageUrl: '',
  193. dialogVisible: false,
  194. disabled: false,
  195. loading: false,
  196. file: null,
  197. uploadToken: '',
  198. pvSplitOptions: [
  199. {
  200. value: '0',
  201. label: this.$t('common.no')
  202. },
  203. {
  204. value: '1',
  205. label: this.$t('common.yes')
  206. }],
  207. form: {
  208. goodsName: '',
  209. type: '',
  210. giftType: [false, false, false, false],
  211. sellType: [false, false],
  212. goodsNo: '',
  213. unit: '',
  214. marketPrice: '',
  215. sellPrice: '',
  216. pvSplit: '0',
  217. pricePv: '',
  218. point: '',
  219. storeNums: '',
  220. content: '',
  221. sort: '',
  222. discount: '',
  223. cover: '',
  224. textarea: '',
  225. sellDiscount: '',
  226. categoryType: '',
  227. sellPriceStandard: undefined,
  228. taxRate: 0,
  229. nature: []
  230. },
  231. submitButtonStat: false,
  232. goodsType: [],
  233. GiftTypeArr: [],
  234. categoryType: [],
  235. sellType: null,
  236. width: '100px',
  237. height: '100px',
  238. pvDisabled: true,
  239. exchangeRate: baseInfo.exchangeRate(),
  240. editAvailableCountriesDialog: false,
  241. availableCountriesTableForm: {
  242. availableCountriesList: [],
  243. tempData:[],
  244. },
  245. multipleSelection: [],
  246. multipleSelectionTemp: [],
  247. rules: {},
  248. rulesTemp: {},
  249. searchQuery: '',
  250. selectionTempData: [],
  251. selectedIds: [], // 存储选中的项的 ID
  252. selectedIdsTemp: [],
  253. }
  254. },
  255. watch: {
  256. dialogVisible (newVal, oldVal) {
  257. console.log(newVal, oldVal)
  258. },
  259. // 监听商品分类,控制PV是否展示
  260. 'form.categoryType': {
  261. deep: true,
  262. handler (modern, origin) {
  263. this.pvDisabled = (parseInt(modern) === 1)
  264. }
  265. },
  266. // 监听商品标准价格,自动计算销售价格
  267. 'form.sellPriceStandard': {
  268. deep: true,
  269. handler(modern, origin) {
  270. // this.form.sellPrice = modern * this.exchangeRate
  271. if(modern){
  272. this.form.nature = []
  273. this.availableCountriesTableForm.availableCountriesList = []
  274. this.toggleSelection(this.form.nature)
  275. }
  276. }
  277. },
  278. },
  279. computed: {
  280. filteredData() {
  281. if (!this.searchQuery) {
  282. return this.availableCountriesTableForm.availableCountriesList;
  283. }
  284. const query = this.searchQuery.toLowerCase();
  285. // this.$refs.multipleTable.toggleRowSelection(JSON.parse(JSON.stringify(this.multipleSelection)),true)
  286. return this.availableCountriesTableForm.availableCountriesList.filter(row => {
  287. return row.NAME.toLowerCase().includes(query);
  288. });
  289. }
  290. },
  291. methods: {
  292. updateTableData() {
  293. // if (!this.searchQuery) {
  294. // return this.availableCountriesTableForm.availableCountriesList;
  295. // }
  296. // 临时存储原始数据,保持搜索时不改变其他列的值
  297. const query = this.searchQuery.toLowerCase();
  298. // this.$refs.multipleTable.toggleRowSelection(JSON.parse(JSON.stringify(this.multipleSelection)),true)
  299. if (this.availableCountriesTableForm.tempData.length === 0) {
  300. // this.availableCountriesTableForm.tempData = JSON.parse(JSON.stringify(this.availableCountriesTableForm.availableCountriesList));
  301. // this.selectionTempData = JSON.parse(JSON.stringify(this.multipleSelection));
  302. }
  303. // const query = this.searchQuery.toLowerCase();
  304. this.$nextTick(() => {
  305. // 在数据更新后,重新设置选中的项
  306. if(!this.searchQuery){
  307. this.setSelectionTemp();
  308. } else {
  309. this.availableCountriesTableForm.tempData = this.availableCountriesTableForm.availableCountriesList.filter(row => {
  310. // const originalRow = this.availableCountriesTableForm.availableCountriesList.find(item => item.NAME === row.NAME);
  311. // console.log(originalRow);
  312. //
  313. return row.NAME.toLowerCase().includes(query);
  314. });
  315. this.setSelection();
  316. }
  317. });
  318. // this.availableCountriesTableForm.availableCountriesList.forEach(row => {
  319. // if (row.NAME.toLowerCase().includes(query)) {
  320. // } else {
  321. // const originalRow = this.filteredData.find(item => item.NAME === row.NAME);
  322. // if (originalRow) {
  323. // if(originalRow.selected === true){
  324. // console.log('originalRow true')
  325. // }
  326. // row = originalRow;
  327. //
  328. // }
  329. // }
  330. // });
  331. // this.$refs.multipleTable.toggleRowSelection(this.selectionTempData)
  332. },
  333. setSelection() {
  334. console.log(this.selectedIds)
  335. console.log(this.availableCountriesTableForm.tempData)
  336. this.availableCountriesTableForm.tempData.forEach(row => {
  337. console.log('----1111')
  338. console.log(this.selectedIds.includes(row.ID))
  339. if (this.selectedIds.includes(row.ID)) {
  340. console.log('----1111----------aaa')
  341. console.log(row)
  342. this.$nextTick(() => {
  343. this.$refs.multipleTableTemp.toggleRowSelection(row, true);
  344. });
  345. }
  346. });
  347. },
  348. setSelectionTemp() {
  349. // this.$refs.multipleTable.clearSelection();
  350. let selectedIds = JSON.parse(JSON.stringify(this.selectedIds))
  351. let selectedIdsTemp = JSON.parse(JSON.stringify(this.selectedIdsTemp))
  352. console.log('----2222')
  353. let list = selectedIds.concat(selectedIdsTemp)
  354. console.log("list=====+" + list)
  355. this.availableCountriesTableForm.availableCountriesList.forEach(row => {
  356. console.log('----3333')
  357. if (list.includes(row.ID)) {
  358. this.$refs.multipleTable.toggleRowSelection(row, true);
  359. }
  360. });
  361. },
  362. handleRowClick(row) {
  363. console.log(row)
  364. // 手动控制行点击时的选中状态
  365. // this.$refs.multipleTable.toggleRowSelection(row,true);
  366. },
  367. handleRowClickTemp(row) {
  368. console.log(row)
  369. console.log('temp 选中')
  370. // 手动控制行点击时的选中状态
  371. // this.$refs.multipleTableTemp.toggleRowSelection(row,true);
  372. },
  373. handleInputBlur(row) {
  374. // 当输入框失去焦点时,将修改应用到原始数据
  375. let originalRow = this.availableCountriesTableForm.tempData.find(item => item.NAME === row.NAME);
  376. if (originalRow) {
  377. originalRow = row;
  378. }
  379. },
  380. handleInput(value) {
  381. // console.log(value)
  382. // if (value < 0 || value === 0) {
  383. // this.form.sellPriceStandard = "";
  384. // }
  385. },
  386. // 隐藏表头中的全选框
  387. cellClass(row) {
  388. if (row.columnIndex === 0) {
  389. return 'disabledCheck'
  390. }
  391. },
  392. isRowSelectable(row, index) {
  393. return row.CURRENCY_PRODUCT_RATE == 0;
  394. },
  395. selectable(row, index) {
  396. return row.CURRENCY_PRODUCT_RATE !== 0;
  397. },
  398. taxRateInput(scope){
  399. // 检查输入值是否为正数
  400. const value = scope.row.taxRate
  401. if (value > 0) {
  402. let moment = this.availableCountriesTableForm.availableCountriesList[scope.$index]
  403. this.$set(this.availableCountriesTableForm.availableCountriesList,scope.$index, moment)
  404. } else {
  405. scope.row.taxRate = ''; // 更新输入框的值
  406. }
  407. },
  408. marketPriceInput(scope){
  409. const value = scope.row.marketPrice
  410. if (value > 0) {
  411. let moment = this.availableCountriesTableForm.availableCountriesList[scope.$index]
  412. this.$set(this.availableCountriesTableForm.availableCountriesList,scope.$index, moment)
  413. } else {
  414. scope.row.marketPrice = ''; // 更新输入框的值
  415. }
  416. },
  417. edit(){
  418. },
  419. submitAvailableCountries(){
  420. this.$refs.availableCountriesTableForm.validate((valid) => {
  421. if (valid) {
  422. this.form.nature = this.multipleSelection
  423. this.editAvailableCountriesDialog = false
  424. } else {
  425. return false;
  426. }
  427. });
  428. },
  429. handleSelectionChange(val) {
  430. this.multipleSelection = val;
  431. // 更新选中的项
  432. this.selectedIds = val.map(item => item.ID);
  433. this.updateRules();
  434. },
  435. handleSelectionChangeTemp(val) {
  436. this.multipleSelectionTemp = val;
  437. // 更新选中的项
  438. this.selectedIdsTemp = val.map(item => item.ID);
  439. this.updateRulesTemp();
  440. },
  441. updateRules() {
  442. this.rules = {}; // 重置规则
  443. this.multipleSelection.forEach((row, index) => {
  444. this.rules[`availableCountriesList.${this.availableCountriesTableForm.availableCountriesList.indexOf(row)}.taxRate`] = [
  445. { required: true, message: this.$t('shop.enterTaxRate'), trigger: 'blur' }
  446. ];
  447. });
  448. },
  449. updateRulesTemp() {
  450. this.rules = {}; // 重置规则
  451. this.multipleSelectionTemp.forEach((row, index) => {
  452. this.rules[`tempData.${this.availableCountriesTableForm.tempData.indexOf(row)}.taxRate`] = [
  453. { required: true, message: this.$t('shop.enterTaxRate'), trigger: 'blur' }
  454. ];
  455. });
  456. },
  457. selectOne(selection,row){
  458. row.sellPrice = (row.CURRENCY_PRODUCT_RATE * this.form.sellPriceStandard).toFixed(2)
  459. row.marketPrice = (row.sellPrice * 1.2).toFixed(2)
  460. },
  461. selectOneTemp(selection,row){
  462. row.sellPrice = (row.CURRENCY_PRODUCT_RATE * this.form.sellPriceStandard).toFixed(2)
  463. row.marketPrice = (row.sellPrice * 1.2).toFixed(2)
  464. },
  465. editAvailableCountries(){
  466. getCountries().then(response => {
  467. this.availableCountriesTableForm.availableCountriesList = response
  468. this.editAvailableCountriesDialog = true
  469. // this.multipleSelection = this.form.nature
  470. this.toggleSelection(this.form.nature)
  471. }).catch(err => {
  472. })
  473. },
  474. toggleSelection(rows) {
  475. if (rows) {
  476. rows.forEach(item => { // checkedData为已选数据
  477. this.$nextTick( ()=>{
  478. this.availableCountriesTableForm.availableCountriesList.find(obj => { // 表单数据
  479. if(item.ID === obj.ID) {
  480. obj.sellPrice = item.sellPrice
  481. obj.marketPrice = item.marketPrice
  482. obj.taxRate = item.taxRate
  483. this.$refs.multipleTable.toggleRowSelection(obj)
  484. }
  485. })
  486. })
  487. })
  488. } else {
  489. this.$refs.multipleTable.clearSelection();
  490. }
  491. },
  492. handleRemove (file) {
  493. console.log(file)
  494. },
  495. upLoadSuccess (file) {
  496. this.form.cover = file
  497. },
  498. handlePictureCardPreview (file) {
  499. this.dialogImageUrl = file.url
  500. this.dialogVisible = true
  501. this.file = file
  502. // console.log(file);
  503. },
  504. handleDownload (file) {
  505. console.log(file)
  506. },
  507. getFileToken () {
  508. getUploadToken().then(response => {
  509. this.uploadToken = response.data
  510. }).catch(err => {
  511. this.$message({
  512. message: this.$t('common.modifyData'),
  513. type: 'info'
  514. })
  515. })
  516. },
  517. getData (page, pageSize) {
  518. getAddGoodsConfig(this.filterModel).then(response => {
  519. this.categoryType = response.data.categoryType
  520. this.goodsType = response.data.goodsType
  521. this.GiftTypeArr = response.data.giftType
  522. this.sellType = response.data.sellType
  523. }).catch(err => {
  524. this.$message({
  525. message: err,
  526. type: 'error'
  527. })
  528. })
  529. },
  530. addSubmit () {
  531. this.submitButtonStat = true
  532. let path = 'shop/goods-add'
  533. let sen_gift = []
  534. this.form.giftType.map((item, index) => {
  535. if (item) {
  536. sen_gift.push((index + 1).toString())
  537. }
  538. })
  539. let postData = {
  540. goodsName: this.form.goodsName,
  541. sellDiscount: this.form.sellDiscount,
  542. discount: this.form.type.discount,
  543. type: this.form.type,
  544. giftType: sen_gift,
  545. // sellType: sellType,
  546. sellType: this.form.sellType,
  547. pvSplit: this.form.pvSplit,
  548. categoryType: this.form.categoryType,
  549. goodsNo: this.form.goodsNo,
  550. unit: this.form.unit,
  551. // marketPrice: this.form.marketPrice,
  552. // sellPrice: this.form.sellPrice,
  553. sellPriceStandard: this.form.sellPriceStandard,
  554. pricePv: this.form.pricePv,
  555. // point: this.form.point,
  556. storeNums: this.form.storeNums,
  557. content: this.form.content,
  558. sort: this.form.sort,
  559. cover: this.form.cover,
  560. // taxRate: this.form.taxRate
  561. nature: this.form.nature,
  562. }
  563. addGoods(postData).then(response => {
  564. this.$message({
  565. message: response.data,
  566. type: 'success'
  567. })
  568. this.submitButtonStat = false
  569. this.$router.go(-1)
  570. }).catch(err => {
  571. this.$message({
  572. message: err,
  573. type: 'error'
  574. })
  575. this.submitButtonStat = false
  576. })
  577. }
  578. }
  579. }
  580. </script>
  581. <style lang="scss" scoped>
  582. /* 小于760 */
  583. @media (max-width:759px) {
  584. ::v-deep .el-input {
  585. width: 100% !important;
  586. }
  587. ::v-deep .el-input-number {
  588. width: 100% !important;
  589. .el-input {
  590. width: auto !important;
  591. padding: 0 5px;
  592. }
  593. }
  594. ::v-deep .el-input-number--medium {
  595. width: 100% !important;
  596. }
  597. ::v-deep .el-select {
  598. width: 100% !important;
  599. }
  600. ::v-deep .el-textarea {
  601. width: 100% !important;
  602. }
  603. ::v-deep .image-uploader {
  604. width: 100% !important;
  605. }
  606. ::v-deep i.el-icon-plus.uploader-icon {
  607. width:100% !important;
  608. }
  609. ::v-deep .form-page {
  610. width:100%;
  611. padding-left: 1%;
  612. }
  613. ::v-deep img {
  614. width: 100% !important;
  615. height: 100% !important;
  616. }
  617. }
  618. @media (min-width:760px) {
  619. ::v-deep .el-input {
  620. width: 400px !important;
  621. }
  622. ::v-deep .el-input-number {
  623. width: 100% !important;
  624. .el-input {
  625. width: auto !important;
  626. padding: 0 5px;
  627. }
  628. }
  629. ::v-deep .el-input-number--medium {
  630. width: 100% !important;
  631. }
  632. ::v-deep .el-select {
  633. width: 400px !important;
  634. }
  635. ::v-deep .el-textarea {
  636. width: 400px !important;
  637. }
  638. ::v-deep .upload-container {
  639. width: 400px !important;
  640. }
  641. ::v-deep .form-page {
  642. width:100%;
  643. padding-left: 10%;
  644. }
  645. }
  646. .el-input{
  647. width: 90%!important;
  648. }
  649. /* 去掉全选按钮 */
  650. ::v-deep .el-table .disabledCheck .cell .el-checkbox__inner {
  651. display: none !important;
  652. }
  653. ::v-deep .el-table .disabledCheck .cell::before {
  654. content: '';
  655. text-align: center;
  656. line-height: 37px;
  657. }
  658. .left-aligned-input .el-input-number__inner {
  659. text-align: left;
  660. }
  661. ::v-deep .el-input-number .el-input__inner {
  662. text-align: left;
  663. }
  664. ::v-deep .el-form-item{
  665. //margin-bottom: 16px !important;
  666. transform: translateY(6px);
  667. }
  668. </style>