<template><div class="transropt-warp container"><div class="common-title"><h2>Transropt</h2></div><div class="transropt-container"><div class="transropt-from"><el-form :rules="rules":model="model" ref="form"><el-table :data="model.tableData" style="width: 100%" empty-text=" ":header-cell-style="{background:'#0f83ea',color:'#fff'}"><el-table-column prop="productImg" label="Image" min-width="70"><template><img src="../assets/img/transropt/default.png" alt=""class="transropt-table-img"></template></el-table-column><el-table-column prop="productName" label="Item Name" min-width="250"><template slot-scope="scope"><el-form-item :prop="'tableData.' + scope.$index + '.productName'":rules='rules.productName'><el-input v-model="scope.row.productName" placeholder="Enter product name or paste link" size="small" clearable></el-input></el-form-item></template></el-table-column><el-table-column prop="transportCategoryId" label="*Category" min-width="180"><template slot-scope="scope"><el-form-item :prop="'tableData.' + scope.$index + '.transportCategoryId'":rules='rules.productTypeTemp'><el-select v-model="scope.row.transportCategoryId" placeholder="select category" size="small"><el-option-group
v-for="(group, index) in categoryList":key="index":label="group.label"><el-option
v-for="item in group.options":key="item.value":label="item.name":value="item.id"><div v-if="item.name === '普货'"><span>普货 </span><el-popover
placement="top-start"
width="250"
trigger="hover"
content="一般的衣服、包包、鞋靴、裤袜、书籍、配饰、日常家居用品、收纳用品、床上用品、窗帘、布匹、卫生棉、纸巾,服装配饰等都算是普货。国外品牌产品(无论正品或仿品)一律不接,请知悉。"><i slot="reference"class="el-icon-question"></i></el-popover></div></el-option></el-option-group></el-select></el-form-item></template></el-table-column><el-table-column prop="productCount" label="Quantity" min-width="155"><template slot-scope="scope"><el-form-item><el-input-number v-model="scope.row.productCount" @change="handleChange":min="1" size="small"></el-input-number></el-form-item></template></el-table-column><el-table-column prop="productComment" label="*Note(not required)" min-width="280"><template slot-scope="scope"><el-form-item :prop="'tableData.' + scope.$index + '.productComment'":rules='rules.productComment'><el-input v-model="scope.row.productComment" placeholder="Remark features of the goods" size="small" clearable></el-input></el-form-item></template></el-table-column><el-table-column label="Action" min-width="75"><template slot-scope="scope"><el-button type="text" size="small" @click="delGoods(scope.$index)"><i class="el-icon-delete"></i></el-button></template></el-table-column></el-table></el-form><div class="transropt-btn"><el-button type="primary" @click="addGoods"><i class="el-icon-plus"></i>Add goods</el-button></div></div><div class="transropt-submit"><p><span>Value-added Services</span><el-checkbox-group v-model="checkList" @change="changeServices"><el-checkbox label="1">Unpacking inspection</el-checkbox><el-checkbox label="2">Take out Invoice</el-checkbox></el-checkbox-group></p><p><el-checkbox v-model="isChecked">I have read and agree to <a href="javascript:;">Inspection Rules and Service Agreement</a></el-checkbox><el-button type="danger" @click="submitFrom">Submit Order</el-button></p><p><a href="javascript:;">View my order</a></p></div><el-dialog title="提示":visible.sync="isDialog.dialogVisible" width="30%":before-close="handleClose"><span>提交成功</span><span slot="footer"class="dialog-footer"><el-button @click="dialogView">继续提交</el-button><el-button type="text"><a href="">查看转运单</a></el-button></span></el-dialog><!--<div class="transropt-footer"><img src="../assets/img/transropt/divide.png" alt=""class="transropt-footer-img"><h2>Conslidation WareHouse</h2><p class="transropt-footer-p">Please login to <a href="javascript:;">User Center</a> to view your exclusive wareHouse!</p><h2>Conslidation Process</h2><ul class="transropt-express"><li><i class="expre-one"></i><p>1.Submit Item list</p><p>Submit the consolidation item list in Toppgo website</p></li><li><i class="expre-two"></i><p>2.System Approves</p><p>Once approve,ship the package to the warehouse,and complete logistics information</p></li><li><i class="expre-tre"></i><p>3.Received by Toppgo</p><p>Once items are shipped to the warehouse,we will receive the item into Toppgo warehouse</p></li><li><i class="expre-for"></i><p>4.Submit for Delivery</p><p>Submit items in"My Warehouse"for delivery,and pay for consolidation fee</p></li><li><i class="expre-fiv"></i><p>5.Confirm Receipt</p><p>Packages are shipper to overseas address pending confirmation upon receipt</p></li></ul><h2>Conslidation Service</h2><ul class="transropt-service"><li><i class="service-one"></i><p>1. Combine packages at your will</p></li><li><i class="service-two"></i><p>2.Unpack and check items</p></li><li><i class="service-thr"></i><p>3.Take out invoices/receipts</p></li><li><i class="service-for"></i><p>4.More services</p></li></ul><div class="transport-charge"><el-button type="success" round plain>Transport Charge</el-button></div><h2>Frequently Asked Questions</h2><ul class="transport-ask"><li><p>Where can I check the address of my exclusive warehouse?</p><p>In order to use the consolidation services, you need to first ship the items to our warehouse. When you register as a member of Toppgo, an exclusive warehouse address will be provided. View <a href="javascript:;">My warehouse</a>。</p></li><li><p>Q:May I use consolidation services for any items?</p><p>A:Due to the customs policy in different countries and the uniqueness of international transportation, strict restrictions may apply. Please view <a href="javascript:;">Restrictions for Imports and Exports</a>,For more information, please contact our Customer Service</p></li><li><p>Q:How to inquiry about logistics information on the Internet?</p><p>A:You can find parcels submitted for delivery in<a href="javascript:;">My Package</a> page and then enter the waybill details page to view the logistics information.You can also go to the <a href="javascript:;">Toppgo</a> to query.</p></li><li><a href="javascript:;">More>></a></li></ul></div>--></div></div></template><script>import{ mapState, mapActions }from'vuex'exportdefault{
name:'',
components:{},
props:{},
inject:['reload'],data(){return{
isChecked:false,
isOpenBoxNeed:false,
isTakeOutInvoiceNeed:false,
buyForUrl:'',
model:{
tableData:[{
productUrl:'',
productImg:'',
productName:'',
productTypeTemp:'',
productType:'',
transportCategoryId:'',
productComment:'',
productCount:1,
fromType:'BALIDROP',
openBoxNeed: Boolean,
takeOutInvoiceNeed: Boolean,
needAudit: Boolean
}]},
rules:{
productName:[{required:true, message:"Content cannot be empty", trigger:"blur"}],
productTypeTemp:[{required:true, message:"Content cannot be empty", trigger:"change"}],
productComment:[{required:true, message:"Content cannot be empty", trigger:"blur"}]},
checkList:[]}},
computed:{...mapState({
categoryList: state => state.shipFor.categoryList,
needCategory: state => state.shipFor.needCategory,
noNeedCategory: state => state.shipFor.noNeedCategory,
isDialog: state => state.shipFor.isDialog
})},created(){this.getCategoryA()},mounted(){let step = window.top.location.href.split('?')[1]// 当前页面最顶层url
console.log('step', window.top.location.href.split('?')[1], window.location.search)this.buyForUrl = step ?'/trade/content/transport-order/iframeCart.html?'+ step :'/trade/content/transport-order/iframeCart.html?'},
methods:{...mapActions('shipFor',['getCategoryA','saveCategoryA']),handleChange(){},addGoods(){var{openBoxNeed, takeOutInvoiceNeed, needAudit}= Boolean
var productCount =1const fromType ='BALIDROP'var{productUrl, productImg, productName, productTypeTemp, productType, transportCategoryId, productComment}=''this.model.tableData.push({openBoxNeed, takeOutInvoiceNeed, needAudit, productUrl, fromType, productImg, productName, productTypeTemp, productType, transportCategoryId, productCount, productComment})},delGoods(index){this.model.tableData.splice(index,1)},changeServices(val){if(val.indexOf('1')>-1){this.isOpenBoxNeed =true}else{this.isOpenBoxNeed =false}if(val.indexOf('2')>-1){this.isTakeOutInvoiceNeed =true}else{this.isTakeOutInvoiceNeed =false}},dialogView(){this.isDialog.dialogVisible =falsethis.reload()},handleClose(){this.isDialog.dialogVisible =false},submitFrom(){const arryList =this.model.tableData
const newList =[...this.needCategory,...this.noNeedCategory]const submitFormData ={};for(var i =0; i < arryList.length; i++){for(var j =0; j < newList.length; j++){if(arryList[i].transportCategoryId === newList[j].id){
arryList[i].needAudit = newList[j].auditNeed
arryList[i].productTypeTemp = newList[j].name
arryList[i].productType = newList[j].i18nkey
arryList[i].openBoxNeed =this.isOpenBoxNeed
arryList[i].takeOutInvoiceNeed =this.isTakeOutInvoiceNeed
}}var arrayListItem = arryList[i]for(var key in arrayListItem){var keyName ="transportOrders["+ i +"]."+ key
submitFormData[keyName]= arrayListItem[key]}}if(this.isChecked){this.$refs.form.validate((valid)=>{if(valid){this.saveCategoryA(submitFormData)}else{
console.log('error submit!!')returnfalse;}})}else{this.$notify({
title:'WARNING',
message:'Please check if you do not agree to the inspection rules and service agreement',
type:'warning'})}}}}</script><style lang="scss">
@import'../assets/scss/transport.scss';</style>