goods-import-v2.blade.php 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('商品导入'))
  4. <style>
  5. [v-cloak]{
  6. display:none;
  7. }
  8. .vue-page {
  9. border-radius: 5px;
  10. width: calc(100% - 266px);
  11. float: right;
  12. margin-right: 10px;
  13. position: fixed;
  14. bottom: 0;
  15. right: 0;
  16. padding: 6px 5% 6px 20px;
  17. background: #fff;
  18. /* height: 60px; */
  19. z-index: 999;
  20. margin-top: 0;
  21. box-shadow: 0 2px 9px rgba(51, 51, 51, 0.1);
  22. }
  23. .content{background-color: #eff3f6;}
  24. .caret-wrapper {
  25. display: inline-flex;
  26. flex-direction: column;
  27. align-items: center;
  28. height: 25px;
  29. width: 11px;
  30. vertical-align: middle;
  31. cursor: pointer;
  32. overflow: initial;
  33. position: relative;
  34. }
  35. .caret-top{
  36. border: 5px solid transparent;
  37. border-bottom-color: #333;
  38. margin:1px 0;
  39. }
  40. .caret-bottom{
  41. border: 5px solid transparent;
  42. border-top-color: #333;
  43. margin:1px 0;
  44. }
  45. </style>
  46. <style>
  47. /* .flex{display:flex;width:100%;flex-wrap: wrap;justify-content: space-between; text-align: justify;} */
  48. .flex{display: grid;grid-template-columns: repeat(auto-fit,240px);grid-column-gap: 20px;min-height: 100vh;margin-bottom: 60px;}
  49. /* .flex{display:flex;margin:10px;} */
  50. .box-lis{min-width: 240px;width:240px}
  51. .box-li{width:240px;border:1px solid #ccc;transition: all .3s;position: relative;overflow:hidden;margin-bottom:20px;height: 354px;}
  52. .box-li:hover{border-color: #df0f0f;margin-bottom: 0px;height: 374px;}
  53. .box-li:hover .box-li-detail,.box-li:hover .isshow-item{display:flex;}
  54. .box-li-img{width:240px;height:240px;position: relative;}
  55. .box-li-img img{width:238px;height:100%;border:0px solid #333;}
  56. .box-li-detail{ display: none;width: 100%;font-size: 12px;position: absolute;bottom: 0;line-height:30px;z-index:2;background: #e1564c;color: #fff;font-weight: 600;text-align: center;}
  57. .box-li-detail .is_selected{flex: 1;}
  58. .box-li-detail .watch-detail{width: 66.6%;text-align: center;border-right:2px solid #ccc;cursor: pointer;}
  59. .isshow-item{display: none;text-align: center;font-size:12px;width:100%;}
  60. .text-vertical{display: -webkit-box;-webkit-line-clamp: 1;overflow: hidden;text-overflow: ellipsis;-webkit-box-orient: vertical;}
  61. .box-li-title{height:40px;color:#333;font-weight: 500;font-size: 14px;overflow: hidden;display: -webkit-box;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;line-height:20px;-webkit-box-orient: vertical;}
  62. .box-li-title>span{cursor: pointer;}
  63. .box-li-price{display:flex;flex-wrap: wrap;color:#333;font-weight: 500;margin:0 8px;}
  64. .box-li-price-one{width:50%;text-align: center;font-size: 12px;}
  65. .box-li-sel{position: absolute;top:0;right: 7px;}
  66. .el-checkbox__inner {border-color:#29ba9b}
  67. .table-responsive{padding: 6px 15px;}
  68. </style>
  69. <style>
  70. @font-face {
  71. font-family: ‘iconfont’; /* Project id 432132 */
  72. src: url(‘//at.alicdn.com/t/font_432132_078f875xdhok.woff2?t=1636442453208’) format(‘woff2’),
  73. url(‘//at.alicdn.com/t/font_432132_078f875xdhok.woff?t=1636442453208’) format(‘woff’),
  74. url(‘//at.alicdn.com/t/font_432132_078f875xdhok.ttf?t=1636442453208’) format(‘truetype’);
  75. }
  76. .panel-info{line-height: 40px;margin-bottom:6px;border-radius:8px;padding: 6px;}
  77. .panel-info-lable{width: 100px;font-size:12px;color: #2d2d2d;white-space:nowrap;}
  78. .panel-info-content{flex:1;display: flex;flex-wrap: wrap;min-width: 1000px;}
  79. .panel-info-content>div:nth-child(n+1){margin-right: 20px;height: 40px;}
  80. .Marketing-item-box{overflow-x: auto;flex-wrap: nowrap;}
  81. .el-radio-button__inner{height: 40px;width: 120px;}
  82. .import-class{display: flex;flex-wrap: nowrap;line-height: 32px;}
  83. .import-class>div{padding:10px;white-space:nowrap;}
  84. .import-class .el-input{width:160px;}
  85. .panel-item{display: flex;margin: 6px 0;line-height: 40px;}
  86. .panel-item .iconfont{margin-right: 6px;font-size: 16px;}
  87. .tips{color: red;width: 560px;line-height:30px;padding-left:20px;white-space:nowrap;}
  88. </style>
  89. <div class="w1200 ">
  90. <link rel="stylesheet" type="text/css" href="{{static_url('css/font-awesome.min.css')}}">
  91. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/goods.css')}}"/>
  92. <div id="goods-index" class=" rightlist ">
  93. <div class="right-titpos">
  94. <ul class="add-snav">
  95. <li class="active"><a href="#">商品列表</a></li>
  96. {{-- <li class="active"><a href="{{yzWebFullUrl('plugin.jd-supply.admin.label-import.index')}}">标签导入</a></li>--}}
  97. </ul>
  98. </div>
  99. <div class="right-addbox">
  100. <div id="app" v-cloak>
  101. <div class="panel panel-info">
  102. <div class="panel-item" >
  103. <div class="panel-info-lable">
  104. <i class="iconfont icon-ht_basis_goodgroup"></i>
  105. <span>商品来源</span>
  106. </div>
  107. <div class="panel-info-content" >
  108. <el-select v-model="middleground_configuration_id" clearable placeholder="中台配置项" @change="changeMiddlegroundConfiguration">
  109. <el-option v-for="(item,index) in middleground_configuration"
  110. :key="index"
  111. :label="item.title"
  112. :value="item.id"></el-option>
  113. </el-select>
  114. <el-radio-group v-model="search_form.source" @change="changeNav">
  115. <el-radio-button v-for="(item,i) in goods_source" :label="item.value" :key="item.value">
  116. <img v-if="item.url" :src='goods_source_url(item.url)'>
  117. <div v-else>[[item.label]]</div>
  118. </el-radio-button>
  119. </el-radio-group>
  120. </div>
  121. </div>
  122. <div class="panel-item">
  123. <div class="panel-info-lable">
  124. <i class="iconfont icon-fontclass-fenlei"></i>
  125. <span>类目</span>
  126. </div>
  127. <div class="panel-info-content" style="flex: 1;display:flex;">
  128. <el-select v-model="search_form.cate_v1" placeholder="请选择一级分类" clearable remote filterable @change="searchCateV2">
  129. <el-option v-for="item in search_cate_v1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  130. </el-select>
  131. <el-select v-model="search_form.cate_v2" placeholder="请选择二级分类" clearable remote filterable @change="searchCateV3">
  132. <el-option v-for="item in search_cate_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  133. </el-select>
  134. <el-select v-model="search_form.cate_v3" placeholder="请选择三级分类" clearable remote filterable>
  135. <el-option v-for="item in search_cate_v3" :key="item.id" :label="item.name" :value="item.id"></el-option>
  136. </el-select>
  137. </div>
  138. </div>
  139. <div class="panel-item" style="margin-bottom: 0;">
  140. <div class="panel-info-lable">
  141. <i class="iconfont icon-ht_left_diymodeladmin"></i>
  142. <span>商品属性</span>
  143. </div>
  144. <div class="panel-info-content">
  145. <template>
  146. <item text="营销利润率:" :list="gross_profit_rate" unit="%" keys="activity_rate" @change="changeItem" ref="item0"></item>
  147. <item text="利润率:" :list="promote_rate" unit="%" keys="origin_rate" @change="changeItem" ref="item1"></item>
  148. <item text="协议价:" :list="agreement_price" unit="元" keys="agreement_price" @change="changeItem" ref="item2"></item>
  149. <item text="指导价:" :list="guide_price" unit="元" keys="guide_price" @change="changeItem" ref="item3"></item>
  150. <item text="营销价:" :list="guide_price" unit="元" keys="activity_price" @change="changeItem" ref="item4"></item>
  151. </template>
  152. <div style="margin-bottom: 6px;" >
  153. <span>是否包邮:</span>
  154. <el-select v-model="search_form.shipping" clearable placeholder="是否包邮" clearable >
  155. <el-option v-for="(item,index) in goods_shipping"
  156. :key="index" :label="item.label" :value="item.value">
  157. </el-option>
  158. </el-select>
  159. </div>
  160. <div style="margin-bottom: 6px;">
  161. <span>是否已导入:</span>
  162. <el-select v-model="search_form.goods_import" clearable placeholder="是否已导入" clearable >
  163. <el-option v-for="(item,index) in goods_import"
  164. :key="index" :label="item.label" :value="item.value">
  165. </el-option>
  166. </el-select>
  167. </div>
  168. <div style="margin-bottom: 6px;">
  169. <span>上下架:</span>
  170. <el-select v-model="search_form.is_display" clearable placeholder="上下架" clearable >
  171. <el-option v-for="(item,index) in is_display"
  172. :key="index" :label="item.label" :value="item.value">
  173. </el-option>
  174. </el-select>
  175. </div>
  176. <div style="margin-bottom: 6px;">
  177. <span>营销属性:</span>
  178. <el-select v-model="search_form.marketing_attributes" clearable placeholder="营销属性" clearable >
  179. <el-option v-for="(item,index) in marketing_attributes_array"
  180. :key="index" :label="item.label" :value="item.value">
  181. </el-option>
  182. </el-select>
  183. </div>
  184. </div>
  185. </div>
  186. {{-- <div class="panel-item" style="margin-top: 0;">--}}
  187. {{-- <div class="panel-info-lable">--}}
  188. {{-- <i class="iconfont icon-ht_marketing_article"></i>--}}
  189. {{-- <span>营销活动</span>--}}
  190. {{-- </div>--}}
  191. {{-- <div class="panel-info-content Marketing-item-box">--}}
  192. {{-- <template v-for="(item,i) in goods_group">--}}
  193. {{-- <el-button :type="item.id==search_form.goods_group?'primary':''"--}}
  194. {{-- @click="changeMarketing(item.id)">--}}
  195. {{-- [[item.name]]--}}
  196. {{-- </el-button>--}}
  197. {{-- </template>--}}
  198. {{-- </div>--}}
  199. {{-- </div>--}}
  200. <div class="panel-item">
  201. <div class="panel-info-lable">
  202. <i class="iconfont icon-ht_basis_searchframe"></i>
  203. <span>关键词</span>
  204. </div>
  205. <div class="panel-info-content">
  206. <el-input v-model="search_form.title" placeholder="商品名称" style="width: 200px;"></el-input>
  207. <el-input v-model="search_form.supplier_name" placeholder="店铺名称" style="width: 200px;"></el-input>
  208. <el-input v-model="search_form.supplier_id" placeholder="店铺ID" style="width: 200px;"></el-input>
  209. <div>
  210. <el-button style="width: 100px;" @click="Reset">重置</el-button>
  211. <el-button icon="el-icon-search" type="primary" style="width: 100px;" @click="search()">搜索</el-button>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. <div class="panel panel-default" style="border-radius:8px">
  217. <div class=" table-responsive">
  218. <div v-loading="loading">
  219. <div>
  220. <el-checkbox v-model.number="is_all_choose" :true-label="1" :false-label="0" @change="allChoose">[[is_all_choose==1?'全不选':'全选']]</el-checkbox>
  221. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:search_form.goods_type=='created_at'?'#29BA9C':'#333'}" @click="changeOrderBy('created_at')">
  222. <span style="font-weight:500">最新上架</span>
  223. <span class="caret-wrapper">
  224. <i class="el-icon-bottom" style="line-height: 25px;font-weight:700"></i>
  225. </span>
  226. </div>
  227. {{-- <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:search_form.goods_type=='real_month_sale'?'#29BA9C':'#333'}" @click="changeOrderBy('real_month_sale')">--}}
  228. {{-- <span style="font-weight:500">本月销量</span>--}}
  229. {{-- <span class="caret-wrapper">--}}
  230. {{-- <i class="el-icon-bottom" style="line-height: 25px;font-weight:700"></i>--}}
  231. {{-- </span>--}}
  232. {{-- </div>--}}
  233. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:(search_form.goods_type=='agreement_price')?'#29BA9C':'#333'}" @click="changeOrderBy('agreement_price')">
  234. <span style="font-weight:500">协议价</span>
  235. <span class="caret-wrapper">
  236. <i class="caret-top" :style="{borderBottomColor:search_form.agreement_price_sort=='asc'?'#29BA9C':'#333'}"></i>
  237. <i class="caret-bottom" :style="{borderTopColor:search_form.agreement_price_sort=='desc'?'#29BA9C':'#333'}"></i>
  238. </span>
  239. </div>
  240. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:(search_form.goods_type=='guide_price')?'#29BA9C':'#333'}" @click="changeOrderBy('guide_price')">
  241. <span style="font-weight:500">指导价</span>
  242. <span class="caret-wrapper">
  243. <i class="caret-top" :style="{borderBottomColor:search_form.guide_price_sort=='asc'?'#29BA9C':'#333'}"></i>
  244. <i class="caret-bottom" :style="{borderTopColor:search_form.guide_price_sort=='desc'?'#29BA9C':'#333'}"></i>
  245. </span>
  246. </div>
  247. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:(search_form.goods_type=='activity_price')?'#29BA9C':'#333'}" @click="changeOrderBy('activity_price')">
  248. <span style="color:#333;font-weight:500">营销价</span>
  249. <span class="caret-wrapper">
  250. <i class="caret-top" :style="{borderBottomColor:search_form.activity_price_sort=='asc'?'#29BA9C':'#333'}"></i>
  251. <i class="caret-bottom" :style="{borderTopColor:search_form.activity_price_sort=='desc'?'#29BA9C':'#333'}"></i>
  252. </span>
  253. </div>
  254. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:(search_form.goods_type=='origin_rate')?'#29BA9C':'#333'}" @click="changeOrderBy('origin_rate')">
  255. <span style="color:#333;font-weight:500">常规利润率</span>
  256. <span class="caret-wrapper">
  257. <i class="caret-top" :style="{borderBottomColor:search_form.origin_rate_sort=='asc'?'#29BA9C':'#333'}"></i>
  258. <i class="caret-bottom" :style="{borderTopColor:search_form.origin_rate_sort=='desc'?'#29BA9C':'#333'}"></i>
  259. </span>
  260. </div>
  261. <div style="display:inline-block;margin:0 10px;cursor: pointer;" :style="{color:(search_form.goods_type=='activity_rate')?'#29BA9C':'#333'}" @click="changeOrderBy('activity_rate')">
  262. <span style="color:#333;font-weight:500">营销利润率</span>
  263. <span class="caret-wrapper">
  264. <i class="caret-top" :style="{borderBottomColor:search_form.activity_rate_sort=='asc'?'#29BA9C':'#333'}"></i>
  265. <i class="caret-bottom" :style="{borderTopColor:search_form.activity_rate_sort=='desc'?'#29BA9C':'#333'}"></i>
  266. </span>
  267. </div>
  268. </div>
  269. <div class="flex">
  270. <div class="box-lis" v-for="(item,index) in list" :key="index">
  271. <div class="box-li" >
  272. <div class="box-li-img">
  273. <img :src="item.image_url" :alt="item.title" :title="item.title">
  274. <div class="box-li-detail">
  275. <div @click="watchDetail(item)" class="watch-detail">查看详情</div>
  276. <div class="is_selected">
  277. <template v-if="item.is_presence">已导入</template>
  278. <el-checkbox v-else v-model.number="item.is_choose" :true-label="1" :false-label="0" @change="oneChange(item)"></el-checkbox>
  279. </div>
  280. </div>
  281. </div>
  282. <div class="box-li-title" style="margin:5px;">
  283. <span @click="watchDetail(item)">[[item.title]]</span>
  284. </div>
  285. <div class="box-li-price">
  286. <div class="box-li-price-one">
  287. <div>协议价</div>
  288. <div style="color:#FF0000">¥[[item.agreement_price || '--']]</div>
  289. </div>
  290. <div class="box-li-price-one">
  291. <div>利润率</div>
  292. <div style="color:#FF0000">[[item.origin_rate || '--']]%</div>
  293. </div>
  294. <div class="isshow-item">
  295. <div style="min-width: 25%;">
  296. <div>指导价</div>
  297. <div class="text-vertical" style="color:#FF0000">[[item.guide_price ||'--']]</div>
  298. </div>
  299. <div style="min-width: 25%;">
  300. <div>销售价</div>
  301. <div class="text-vertical" style="color:#FF0000">[[item.sale_price ||'--']]</div>
  302. </div>
  303. <div style="min-width: 25%;">
  304. <div>营销利润率</div>
  305. <div class="text-vertical" style="color:#FF0000">[[item.activity_rate ||'--']]%</div>
  306. </div>
  307. <div style="flex:1;">
  308. <div>营销价</div>
  309. <div class="text-vertical" style="color:#FF0000">[[item.activity_price ||'--']]</div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. </div>
  316. <div class="vue-page">
  317. <div style="display:flex;">
  318. <div v-if="create_category == 1" class="tips">
  319. 已开启自动匹配分类,如不选择导入分类则自动匹配或创建分类!(阿里商品不支持)
  320. </div>
  321. <div class="tips" v-if="show_tech_fee == 1">
  322. 中台技术服务费比例:[[sever_ratio/100]]%
  323. </div>
  324. <div style="text-align: right;flex:1;">
  325. <el-pagination layout="sizes,prev, pager, next,jumper" @current-change="search" :total="total_page"
  326. :page-size="per_size" :current-page="current_page" background :page-sizes="goods_page_size"
  327. @size-change="handleSizeChange" v-loading="loading">
  328. </el-pagination>
  329. {{-- <el-pagination layout="sizes,prev, pager, next,jumper" @current-change="search" v-if="total/per_size <50" :total="total"--}}
  330. {{-- :page-size="per_size" :current-page="current_page" background :page-sizes="goods_page_size"--}}
  331. {{-- @size-change="handleSizeChange" v-loading="loading">--}}
  332. {{-- </el-pagination>--}}
  333. </div>
  334. </div>
  335. <div class="import-class" style="flex-wrap: wrap;!important;" >
  336. <div>选择导入分类</div>
  337. <el-select size="small" v-model="category_form.id_v1" placeholder="请选择一级分类" clearable @change="changeV1()">
  338. <el-option v-for="item in category_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  339. </el-select>
  340. <el-select size="small" v-model="category_form.id_v2" placeholder="请选择二级分类" clearable @change="changeV2()">
  341. <el-option v-for="item in category_list_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  342. </el-select>
  343. <el-select size="small" v-model="category_form.id_v3" placeholder="请选择三级分类" clearable v-if="category_level == 3">
  344. <el-option v-for="item in category_list_v3" :key="item.id" :label="item.name" :value="item.id"></el-option>
  345. </el-select>
  346. <div>选择导入商品标签</div>
  347. <el-select size="small" v-model="category_form.fid_v1" placeholder="请选择标签组" clearable @change="filteringV1()">
  348. <el-option v-for="item in filtering_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  349. </el-select>
  350. <el-select size="small" v-model="category_form.fid_v2" placeholder="请选择标签值" clearable >
  351. <el-option v-for="item in filtering_list_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  352. </el-select>
  353. <div>
  354. <el-button size="small" type="primary" @click="confirm" :disabled="is_import_disabled">导入商品[[changeTotal==0?"":"("+changeTotal+")"]]</el-button>
  355. <el-button size="small" type="primary" @click="show_all_import" :disabled="is_import_disabled">导入全部筛选商品([[total>=2000?total_str:total]])</el-button>
  356. {{-- <el-button size="small" type="primary" @click="bulk_order">批量下单(商)</el-button>--}}
  357. <el-button size="small" type="primary" @click="bulk_order_yz">批量下单(中)</el-button>
  358. </div>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. <div class='panel-footer'>
  364. </div>
  365. </div>
  366. <el-dialog :visible.sync="all_import_show" width="750px" title="导入全部商品">
  367. <el-col v-if="all_import.import_status == 0" style="color: red">共计商品数为[[total_str]]个,因条件限制该操作只能导入前2000款商品</el-col> <el-col v-if="all_import.import_status == 1" style="color: red">导入商品总数:[[all_import.import_total]]</el-col>
  368. <el-col v-if="all_import.import_status == 1" style="color: red">已导入商品数:[[all_import.import_exits]]</el-col>
  369. <el-col v-if="all_import.import_status == 1" style="color: red">总进度约:[[all_import.import_process]]%</el-col>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button @click="all_import_show = false">取 消</el-button>
  372. <el-button type="primary" :disabled="all_import_disabled" @click="all_confirm">确认导入</el-button>
  373. </span>
  374. </el-dialog>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. <script>
  381. let item = {
  382. props:["text","list","unit","keys"],
  383. delimiters: ['[[', ']]'],
  384. template:`<div style="margin-bottom: 6px;display:flex;">
  385. <span>[[text]]</span>
  386. <template v-if="value!='自定义区间'">
  387. <el-select v-model="value" placeholder="请选择" @change="change">
  388. <el-option v-for="(item,i) in list" :label="item" :value="item" :key="i"> </el-option>
  389. </el-select>
  390. </template>
  391. <template v-else>
  392. <el-input type="number" placeholder="区间开始" v-model="search.from" style="width: 170px;" @blur="blur">
  393. </el-input>
  394. <div class="line" style="border:0;font-size:25px;">-</div>
  395. <el-input type="number" placeholder="区间结束" v-model="search.to" style="width: 190px;" @blur="blur">
  396. <el-button slot="append">[[unit]]</el-button>
  397. </el-input>
  398. </template>
  399. </div>`,
  400. data(){
  401. return {
  402. value:"",
  403. search:{from:null,to:null}
  404. }
  405. },
  406. methods:{
  407. change(){
  408. if (this.value=="全部") return this.$emit("change",{key:this.keys,isdel:true});
  409. if (this.value=="自定义区间") return;
  410. let val = this.value.split("-");
  411. val[1] = val[1]?parseInt(val[1]):99999;
  412. this.$emit("change",{search:{from:parseInt(val[0]),to:val[1]},key:this.keys});
  413. },
  414. blur(){
  415. let search = {};
  416. search.from = this.search.from ? parseInt(this.search.from):0,
  417. search.to = this.search.to ? parseInt(this.search.to):99999,
  418. this.$emit("change",{search,key:this.keys});
  419. },
  420. Reset(){
  421. this.value = "",
  422. this.search={from:"",to:""};
  423. }
  424. }
  425. }
  426. var app = new Vue({
  427. el:"#app",
  428. delimiters: ['[[', ']]'],
  429. components:{item},
  430. directives: {
  431. 'el-select-loadmore': {
  432. bind(el, binding) {
  433. // 获取element-ui定义好的scroll盒子
  434. const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
  435. SELECTWRAP_DOM.addEventListener('scroll', function () {
  436. /**
  437. * scrollHeight 获取元素内容高度(只读)
  438. * scrollTop 获取或者设置元素的偏移值,常用于, 计算滚动条的位置, 当一个元素的容器没有产生垂直方向的滚动条, 那它的scrollTop的值默认为0.
  439. * clientHeight 读取元素的可见高度(只读)
  440. * 如果元素滚动到底, 下面等式返回true, 没有则返回false:
  441. * ele.scrollHeight - ele.scrollTop === ele.clientHeight;
  442. */
  443. const condition = this.scrollHeight - this.scrollTop <= this.clientHeight;
  444. if (condition) {
  445. binding.value();
  446. }
  447. });
  448. }
  449. }
  450. },
  451. data() {
  452. let category_level = {!! $category_level !!};
  453. let create_category = {!! $create_category !!};
  454. let filtering_list = {!! $filtering_list?:'{}' !!};
  455. let category_list = {!! $category_list?:'{}' !!};
  456. let search_cate_v1 = '{}';
  457. let all_import = {!! $import?:'{}' !!};
  458. let topic_id = {!! $topic_id !!};
  459. return{
  460. show_tech_fee:0,//是否显示技术服务费
  461. middleground_configuration:{},//中台配置数组
  462. middleground_configuration_id:0,
  463. changeTotal:0,
  464. is_all_choose:0,
  465. loading:false,
  466. all_loading:false,
  467. page_number: 20, //每页显示条数
  468. all_import_show:false,
  469. list: [],
  470. all_import: all_import,
  471. sever_ratio:0,//中台技术服务费
  472. search_form: {
  473. is_display:1,
  474. goods_source:"",
  475. cate_v1:'',
  476. cate_v2:'',
  477. cate_v3:'',
  478. source:'all',
  479. commission_agent:'all',
  480. goods_import:"",
  481. topic_id : topic_id,
  482. },
  483. is_display:[
  484. {
  485. value: 1,
  486. label: '上架',
  487. },
  488. {
  489. value: 2,
  490. label: '下架',
  491. }
  492. ],
  493. marketing_attributes_array:[
  494. {
  495. value: '',
  496. label: '默认',
  497. },
  498. {
  499. value: 'is_new',
  500. label: '新品',
  501. },
  502. // {
  503. // value: 'is_recommend',
  504. // label: '推荐',
  505. // },
  506. {
  507. value: 'is_hot',
  508. label: '热卖',
  509. },
  510. {
  511. value: 'is_promotion',
  512. label: '促销',
  513. },
  514. ],
  515. category_page: {
  516. pageIndex: 1,
  517. pageSize: 20,
  518. },
  519. category_form:{
  520. id_v1:"",
  521. id_v2:"",
  522. id_v3:"",
  523. fid_v1:"",
  524. fid_v2:"",
  525. },
  526. //默认的来源
  527. default_goods_source: [
  528. {value: "all",label: '全部',},
  529. {value: "zt",label: '中台自营'}
  530. ],
  531. //显示使用的来源
  532. goods_source: [
  533. {value: "all",label: '全部',},
  534. {value: "zt",label: '中台自营'}
  535. ],
  536. gross_profit_rate:["全部","0-35%","35%-50%","50%-75%","75%及以上"],//毛利率
  537. promote_rate:["全部","0-50%","50%-150%","150%-300%","300%及以上","自定义区间"],//利润率
  538. discount:["全部","0-3折","3-5折","5-8折","8折及以上","自定义区间"],//折扣
  539. agreement_price:["全部","0-200元","200-500元","500-1000元","1000元以上","自定义区间"],//协议价
  540. guide_price:["全部","0-200元","200-500元","500-1000元","1000元以上"],//指导价、营销价
  541. goods_shipping:[{
  542. value: '',
  543. label: '全部',
  544. }, {
  545. value: '2',
  546. label: '不包邮'
  547. }, {
  548. value: '1',
  549. label: '包邮'
  550. }],
  551. goods_page_size:[20,50],
  552. goods_import:[{
  553. value: '',
  554. label: '全部'
  555. }, {
  556. value: '1',
  557. label: '未导入'
  558. }, {
  559. value: '2',
  560. label: '已导入'
  561. }],
  562. goods_agent:[
  563. {
  564. value: 'all',
  565. label: '全部',
  566. },
  567. {
  568. value: 'zt', //中台传0
  569. label: '中台',
  570. }
  571. ],
  572. is_import_disabled : false,
  573. all_import_disabled:false,
  574. filtering_list:filtering_list, //商品标签
  575. filtering_list_v2:[], //商品标签
  576. category_level:category_level,//分类等级
  577. create_category:create_category,//分类等级
  578. category_list:category_list,
  579. category_list_v2:[],
  580. category_list_v3:[],
  581. selectionGoodsIds: [],
  582. // goods_group: group_list,
  583. // app_goods_group: app_group_list,
  584. search_cate_v1: search_cate_v1,
  585. search_cate_v2: [],
  586. search_cate_v3: [],
  587. //分页
  588. total_str:0,//显示的商品总数 会出现总数后面多个+号的情况
  589. total: 0, //全部商品数量
  590. total_page:0,//分页限制最多100页
  591. per_size: 0,
  592. current_page: 0,
  593. }
  594. },
  595. created() {
  596. this.getMiddlegroundConfiguration();
  597. // this.getGoodsList({search:{topic_id:this.search_form.topic_id}});
  598. this.changeSource();
  599. },
  600. methods: {
  601. //批量下单
  602. bulk_order(){
  603. window.open("{!! yzWebUrl('plugin.yz-supply.admin.bulk-order.index') !!}" + "&middleground_configuration_id="+this.middleground_configuration_id);
  604. },
  605. bulk_order_yz(){
  606. window.open("{!! yzWebUrl('plugin.yz-supply.admin.bulk-order.yz-index') !!}" + "&middleground_configuration_id="+this.middleground_configuration_id);
  607. },
  608. changeMiddlegroundConfiguration(){
  609. let loading = this.$loading({
  610. lock: true,
  611. text:"数据加载中",
  612. spinner: 'el-icon-loading',
  613. background: 'rgba(0, 0, 0, 0.7)'
  614. });
  615. this.selectionGoodsIds = [];
  616. //配置改变时默认使用全部
  617. this.search_form.source = this.default_goods_source[0].value;
  618. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.get-supply-source') !!}',{middleground_configuration_id:this.middleground_configuration_id}).then(function (response) {
  619. if (response.data.result) {
  620. console.log(response.data.data);
  621. this.goods_source = response.data.data;
  622. // this.middleground_configuration = response.data.data;
  623. // this.middleground_configuration_id = this.middleground_configuration[0].id;
  624. this.search();
  625. this.changeSource();
  626. } else {
  627. this.list = [];
  628. this.current_page = 1;
  629. this.total = 0;
  630. this.all_loading = false;
  631. loading.close();
  632. this.$message({message: response.data.msg, type: 'error'});
  633. }
  634. }, function (response) {
  635. this.list = [];
  636. this.current_page = 1;
  637. this.total = 0;
  638. this.all_loading = false;
  639. loading.close();
  640. this.$message({message: response.data.msg, type: 'error'});
  641. })
  642. },
  643. //营销活动切换
  644. changeMarketing(id){
  645. this.$set(this.search_form,'goods_group',id);
  646. this.getGoodsList({search:this.search_form});
  647. },
  648. //每页多少条数据
  649. handleSizeChange(page_number){
  650. this.is_all_choose = 0;
  651. this.changeTotal = 0;
  652. this.page_number = page_number;
  653. this.search();
  654. },
  655. Reset(){
  656. //重置
  657. this.search_form = {
  658. is_display:1,
  659. commission_agent:'all',
  660. source:"all",
  661. };
  662. for (let i = 0; i < 5; i++) {
  663. this.$refs["item"+i].Reset();
  664. };
  665. },
  666. changeItem(obj){
  667. // if (obj.isdel) delete this.search_form[obj.key];
  668. this.search_form[obj.key] = obj.search;
  669. },
  670. //图片地址
  671. goods_source_url(url){
  672. url = `{{resource_get('plugins/yz-supply/assent/image/${url}.png')}}`
  673. return url
  674. },
  675. //查看详情
  676. watchDetail(item){
  677. window.open("{!! yzWebUrl('plugin.yz-supply.admin.goods-import.detail') !!}" + "&middleground_configuration_id="+this.middleground_configuration_id+"&id=" + item.id);
  678. },
  679. getMiddlegroundConfiguration(){
  680. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.get-middleground-configurations') !!}').then(function (response) {
  681. if (response.data.result) {
  682. this.middleground_configuration = response.data.data;
  683. this.middleground_configuration_id = this.middleground_configuration[0].id;
  684. this.changeMiddlegroundConfiguration();
  685. // this.getGoodsList({search: {topic_id: this.search_form.topic_id}});
  686. // this.changeSource();
  687. } else {
  688. this.$message({message: response.data.msg, type: 'error'});
  689. }
  690. }, function (response) {
  691. this.$message({message: response.data.msg, type: 'error'});
  692. })
  693. },
  694. // 获得商品列表
  695. getGoodsList(json={}) {
  696. json.search.goods_page_size = this.page_number;
  697. json['middleground_configuration_id'] = this.middleground_configuration_id;
  698. let loading = this.$loading({
  699. lock: true,
  700. text:"数据加载中",
  701. spinner: 'el-icon-loading',
  702. background: 'rgba(0, 0, 0, 0.7)'
  703. });
  704. this.all_loading = true;
  705. this.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.goods-pagination') !!}",json).then(response => {
  706. if(response.data.result==1){
  707. this.list = response.data.data.data;
  708. this.list.forEach((item,index) => {
  709. item.is_choose = 0;
  710. // this.list[index].is_choose = 0;
  711. })
  712. this.synIsAllchoose();
  713. this.current_page = response.data.data.current_page;
  714. this.per_size = response.data.data.per_page;
  715. this.total = response.data.data.total;
  716. this.total_page = response.data.data.total_page;
  717. this.total_str = response.data.data.total_str;
  718. this.sever_ratio = response.data.data.sever_ratio;
  719. this.show_tech_fee = response.data.data.show_tech_fee; //是否显示技术服务费 1是 其他否
  720. this.all_loading = false;
  721. } else{
  722. this.list = [];
  723. this.current_page = 1;
  724. this.total = 0;
  725. this.$message.error(response.data.msg);
  726. this.all_loading = false;
  727. }
  728. loading.close();
  729. }),(res)=>{
  730. loading.close();
  731. this.all_loading = false;
  732. };
  733. },
  734. show_all_import()
  735. {
  736. if (this.all_import.import_status == 1) {
  737. this.all_import_disabled = true
  738. }
  739. this.all_import_show = true;
  740. },
  741. search(page) {
  742. this.getGoodsList({page:page,search:this.search_form});
  743. },
  744. // 上一页
  745. prev() {
  746. let page = parseInt(this.current_page) - 1;
  747. if (page < 1) {
  748. return false;
  749. }
  750. this.getGoodsList({page:page,search:this.search_form});
  751. },
  752. //下一页
  753. next() {
  754. let page = parseInt(this.current_page) + 1;
  755. if (this.per_size < this.page_number) {
  756. return false;
  757. }
  758. this.getGoodsList({page:page,search:this.search_form});
  759. },
  760. //跳页
  761. jumpPage() {
  762. if (this.current_page <= 1) {
  763. this.current_page = 1;
  764. }
  765. this.getGoodsList({page:this.current_page,search:this.search_form});
  766. },
  767. //选择商品
  768. handleSelectionChange(val) {
  769. var arr = [];
  770. for(var j = 0,len = val.length; j < len; j++){
  771. arr.push(val[j].id);
  772. }
  773. this.selectionGoodsIds = arr;
  774. },
  775. // 一级分类改变
  776. changeV1() {
  777. this.category_form.id_v2 = "";
  778. this.category_form.id_v3 = "";
  779. this.category_list_v2 = [];
  780. this.category_list_v3 = [];
  781. this.category_list.find(item => {
  782. if (item.id == this.category_form.id_v1) {
  783. this.category_list_v2 = item.childrens;
  784. }
  785. });
  786. },
  787. // 二级分类改变
  788. changeV2() {
  789. this.category_form.id_v3 = "";
  790. this.category_list_v3 = [];
  791. if (this.category_level == 3) {
  792. this.category_list_v2.find(item => {
  793. if (item.id == this.category_form.id_v2) {
  794. this.category_list_v3 = item.childrens;
  795. }
  796. })
  797. }
  798. },
  799. // 一级分类改变
  800. searchCateV2() {
  801. this.search_form.cate_v2 = "";
  802. this.search_form.cate_v3 = "";
  803. this.search_cate_v2 = [];
  804. this.search_cate_v3 = [];
  805. //搜索二级分类
  806. var source = this.search_form.source;
  807. var parent_id = this.search_form.cate_v1;
  808. // 这里是接口请求数据, 带分页条件
  809. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.getChildrenCategory') !!}', {
  810. 'source': source,
  811. 'parent_id': parent_id,
  812. 'middleground_configuration_id':this.middleground_configuration_id
  813. }).then(response => {
  814. if (response.data.result == 1) {
  815. this.search_cate_v2 = response.data.data;
  816. }
  817. }), function (res) {
  818. };
  819. },
  820. // 二级分类改变
  821. searchCateV3() {
  822. this.search_form.cate_v3 = "";
  823. this.search_cate_v3 = [];
  824. //搜索三级分类
  825. var source = this.search_form.source;
  826. var parent_id = this.search_form.cate_v2;
  827. // 这里是接口请求数据, 带分页条件
  828. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.getChildrenCategory') !!}', {
  829. 'source': source,
  830. 'parent_id': parent_id,
  831. 'middleground_configuration_id':this.middleground_configuration_id
  832. }).then(response => {
  833. if (response.data.result == 1) {
  834. this.search_cate_v3 = response.data.data;
  835. }
  836. }), function (res) {
  837. };
  838. },
  839. changeSource() {
  840. var that = this;
  841. that.search_form.cate_v1 = "";
  842. that.search_form.cate_v2 = "";
  843. that.search_form.cate_v3 = "";
  844. that.search_cate_v1 = [];
  845. that.search_cate_v2 = [];
  846. that.search_cate_v3 = [];
  847. // var source = that.search_form.source;
  848. // 'source':source
  849. that.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.getChildrenCategory') !!}', {middleground_configuration_id:this.middleground_configuration_id}).then(response => {
  850. if (response.data.result == 1) {
  851. that.search_cate_v1 = response.data.data;
  852. }
  853. }), function (res) {
  854. };
  855. },
  856. changeWarehouse() {
  857. if (this.search_form.commission_agent == 0) {
  858. this.search_form.goods_source = "";
  859. this.goods_source = [
  860. {value: '',label: '全部'},
  861. {value: 0,label: '未分组'}
  862. ];
  863. this.app_goods_group.forEach(item => {
  864. this.goods_source.push({
  865. value:item.id,
  866. label:item.name
  867. });
  868. });
  869. } else this.goods_source = goods_source;
  870. console.log(this.goods_source);
  871. },
  872. changeNav(){
  873. this.getGoodsList({search:this.search_form});
  874. // this.changeSource();
  875. },
  876. // 一级标签改变
  877. filteringV1(){
  878. this.category_form.fid_v2 = "";
  879. this. filtering_list_v2 = [];
  880. this.filtering_list.find(item => {
  881. if(item.id == this.category_form.fid_v1) {
  882. this.filtering_list_v2 = item.value;
  883. }
  884. });
  885. },
  886. //导入商品
  887. confirm(){
  888. var that = this;
  889. var arr = {
  890. 'parentid': [],
  891. 'childid':[],
  892. 'thirdid':[],
  893. };
  894. if(this.category_form.fid_v1){
  895. if (!this.category_form.fid_v2) {
  896. this.$message.error("商品标签值不能为空");
  897. return false;
  898. }
  899. }
  900. let loading = this.$loading({
  901. lock: true,
  902. text:`正在导入${this.changeTotal}个商品中`,
  903. spinner: 'el-icon-loading',
  904. background: 'rgba(0, 0, 0, 0.7)'
  905. });
  906. arr.parentid.push(this.category_form.id_v1);
  907. arr.childid.push(this.category_form.id_v2);
  908. if(this.category_form.id_v3){
  909. arr.thirdid.push(this.category_form.id_v3);
  910. }
  911. // let json = {category:arr,goods_ids:this.selectionGoodsIds,f_value_id:this.category_form.fid_v2,commission_agent:this.search_form.commission_agent};
  912. let json = {
  913. category:arr,
  914. goods_ids:[],
  915. f_value_id:this.category_form.fid_v2,
  916. commission_agent:this.search_form.commission_agent,
  917. middleground_configuration_id:this.middleground_configuration_id,
  918. goods_ids:this.selectionGoodsIds
  919. };
  920. // console.log(json)
  921. // return false;
  922. // this.list.forEach(item => {
  923. // if(item.is_choose) json.goods_ids.push(item.id);
  924. // })
  925. that.is_import_disabled = true;
  926. that.all_loading = true;
  927. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.select') !!}",json).then(response => {
  928. this.selectionGoodsIds = [];
  929. // that.is_import_disabled = true;
  930. that.all_loading = false;
  931. if(response.data.result==1) {
  932. that.$message.success(response.data.msg);
  933. that.is_import_disabled = false;
  934. this.getGoodsList({page:this.current_page,search:this.search_form});
  935. this.changeTotal = 0;
  936. } else{
  937. that.$message.error(response.data.msg);
  938. that.is_import_disabled = false;
  939. }
  940. loading.close();
  941. }),function(res){
  942. console.log(res);
  943. loading.close();
  944. that.is_import_disabled = true;
  945. that.all_loading = false;
  946. };
  947. },
  948. all_confirm()
  949. {
  950. var that = this;
  951. var arr = {
  952. 'parentid': [],
  953. 'childid':[],
  954. 'thirdid':[],
  955. };
  956. if(this.category_form.fid_v1){
  957. if (!this.category_form.fid_v2) {
  958. this.$message.error("商品标签值不能为空");
  959. return false;
  960. }
  961. }
  962. // let loading = this.$loading({
  963. // lock: true,
  964. // text:`正在导入${this.changeTotal}个商品中`,
  965. // spinner: 'el-icon-loading',
  966. // background: 'rgba(0, 0, 0, 0.7)'
  967. // });
  968. arr.parentid.push(this.category_form.id_v1);
  969. arr.childid.push(this.category_form.id_v2);
  970. if(this.category_form.id_v3){
  971. arr.thirdid.push(this.category_form.id_v3);
  972. }
  973. let json = {
  974. category:arr,
  975. f_value_id:this.category_form.fid_v2,
  976. search:this.search_form,
  977. middleground_configuration_id:this.middleground_configuration_id
  978. };
  979. // that.is_import_disabled = true;
  980. that.all_loading = true;
  981. // this.all_import_disabled = true
  982. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.all-select') !!}",json).then(response => {
  983. this.selectionGoodsIds = [];
  984. that.is_import_disabled = true;
  985. that.all_loading = false;
  986. if(response.data.result==1) {
  987. that.$message.success(response.data.msg);
  988. location.reload()
  989. } else{
  990. that.$message.error(response.data.msg);
  991. }
  992. }),function(res){
  993. that.is_import_disabled = true;
  994. that.all_loading = false;
  995. };
  996. },
  997. /**
  998. * 是否默认全选
  999. * @param item item
  1000. */
  1001. synIsAllchoose(){
  1002. is_all = 3;
  1003. this.list.some((item,index) => {
  1004. if(this.selectionGoodsIds.indexOf(item.id) != -1){
  1005. this.list[index].is_choose = 1;
  1006. if(is_all != 0) is_all = 1;
  1007. }else{
  1008. is_all = 0;
  1009. }
  1010. })
  1011. this.is_all_choose = is_all;
  1012. this.changeTotal = this.selectionGoodsIds.length;
  1013. },
  1014. /**
  1015. * 添加/删除GOOGids中的值
  1016. * @param item item
  1017. */
  1018. changeGoodsIds(){
  1019. this.list.some((item,index) => {
  1020. if(item.is_choose == 1 && this.selectionGoodsIds.indexOf(item.id) == -1) {
  1021. this.selectionGoodsIds[this.selectionGoodsIds.length] = item.id;
  1022. }
  1023. else if(item.is_choose != 1 && this.selectionGoodsIds.indexOf(item.id) != -1){
  1024. this.selectionGoodsIds.splice(this.selectionGoodsIds.indexOf(item.id));
  1025. }
  1026. })
  1027. this.changeTotal = this.selectionGoodsIds.length;
  1028. },
  1029. oneChange(item) {
  1030. this.changeGoodsIds(item);
  1031. let that = this;
  1032. this.$forceUpdate();
  1033. let is_all = 0;
  1034. // this.changeTotal = item.is_choose == 1?this.changeTotal+1:this.changeTotal-1;
  1035. that.list.some((item,index) => {
  1036. if(item.is_choose == 1) {
  1037. is_all = 1;
  1038. }
  1039. else {
  1040. is_all = 0;
  1041. return true;
  1042. }
  1043. })
  1044. that.is_all_choose = is_all;
  1045. },
  1046. // 全选
  1047. allChoose() {
  1048. let total = 0;
  1049. let status = this.is_all_choose == 1?1:0;
  1050. this.list.forEach((item,index) => {
  1051. if (item.is_presence!=1){
  1052. total+=1;
  1053. }
  1054. this.changeGoodsIds(item);
  1055. item.is_choose = status;
  1056. })
  1057. this.changeGoodsIds(item);
  1058. // this.changeTotal = status? total: 0;
  1059. },
  1060. changeOrderBy(type) {
  1061. var sort = type + '_sort';
  1062. var current_sort = this.search_form['goods_type'] + '_sort';
  1063. this.search_form[current_sort] = '';
  1064. if (type == this.search_form['goods_type']) {
  1065. if (this.search_form['goods_sort'] == 'asc') {
  1066. this.search_form[sort] = 'desc';
  1067. } else {
  1068. this.search_form[sort] = 'asc';
  1069. }
  1070. } else {
  1071. this.search_form[sort] = 'desc';
  1072. }
  1073. this.search_form['goods_sort'] = this.search_form[sort];
  1074. this.search_form['goods_type'] = type;
  1075. if (type == 'created_time' || type == 'real_month_sale') {
  1076. this.search_form['goods_sort'] = 'desc';
  1077. }
  1078. this.$forceUpdate();
  1079. this.getGoodsList({page:1,search:this.search_form});
  1080. },
  1081. },
  1082. })
  1083. </script>
  1084. @endsection('content')