def show_All_ProductSKU_Num(self, obj): try: rt = "" rt = u"<strong>商品SKU*数量:</strong><br>" rt = rt + django_wrap(obj.All_ProductSKU_Num, ';', 2) rt = rt + u"<br><strong>计划备货号:</strong><br>" rt = rt + django_wrap(obj.Stocking_plan_number, '|', 2) except Exception, ex: messages.info(self.request, "商品SKU*数量加载错误,请联系IT解决:%s" % (str(ex))) rt = ""
def show_Supplierlink(self, obj): from brick.public.django_wrap import django_wrap rt = django_wrap(obj.Supplierlink, ';', 1) if obj.LogisticsNumber is not None and obj.LogisticsNumber.strip( ) != '': rt = rt + '<a target="_blank" href="https://www.baidu.com/s?wd=%s">查看物流</a>' % obj.LogisticsNumber return mark_safe(rt)
def edit_sku(self, obj): try: rt = "" if obj.Status == "deliver": if obj.editSKU is not None: listSKU = obj.editSKU.split(';') rt = '%s<strong>商品SKU实际发货数量编辑:</strong><br><table>' % (rt) idList = [] for sku in listSKU: tmpList = sku.split('*') idList.append(tmpList[0]) rt = '%s<tr><th><strong>%s</strong>:</th><th><input type="text" style="width:60px;height:25px" id="%s" value="%s"></th></tr>' % ( rt, tmpList[0], tmpList[0], tmpList[1]) rt = '%s<tr><th></th><th align="left"><input type="button" style="width:60px;height:25px;" id="btn1_%s" value="确定"></th></tr>' % ( rt, obj.id) rt = '%s</table>' % (rt) rt = '%s<br><p id="result1_%s" style="color:green;"></p>' % ( rt, obj.id) rt = '%s<input id="idlist_%s" style="display:none;" value="%s">' % ( rt, obj.id, ','.join(idList)) tt = """%s<script> $(document).ready(function(){ $("#btn1_%s").click(function(){ var strID = document.getElementById("idlist_%s").value; idList = strID.split(","); var allProductNum = ""; var strTmp = ""; for ( var i = 0; i <idList.length; i++){ strTmp = document.getElementById(idList[i]).value; if(isNaN(strTmp)){ var strTip = idList[i] + ":输入非数字,请修改后重新提交"; alert(strTip); return; } allProductNum = allProductNum + idList[i] + "*" + strTmp + ";"; } allProductNum=(allProductNum.substring(allProductNum.length-1)==';')?allProductNum.substring(0,allProductNum.length-1):allProductNum; $.ajax({url:"/fba_deliver_skunum_dealdata/",type:"GET",contentType:"application/x-www-form-urlencoded:charset=UTF-8",dataType:"json", data:{"id":"%s","edit_skus":allProductNum}, success:function(data){if(data.result=="OK"){document.getElementById("result1_%s").innerHTML="修改成功!";} else if(data.result=="NG"){document.getElementById("result1_%s").innerHTML="修改失败,请检查!";}}, error:function(data){document.getElementById("result1_%s").innerHTML="修改报错,请检查!";} })}) })</script>""" rt = tt % (rt, obj.id, obj.id, obj.id, obj.id, obj.id, obj.id) else: rt = u"%s<strong>实际商品SKU*数量:</strong><br>" % (rt) rt = rt + django_wrap(obj.editSKU, ';', 2) except Exception, ex: messages.info(self.request, "可编辑的SKU加载错误,请联系IT解决:%s" % (str(ex))) rt = ""
def show_Title_ProductID(self, obj): rt = django_wrap(obj.Title, ' ', 6) rt = u'%s<br>产品ID:<a href=" https://pandao.ru/product/%s" target="_blank">%s</a>' % ( rt, obj.ProductID, obj.ProductID) rt = u'%s<br>卖家简称:%s' % (rt, obj.ShopName) if obj.Published: rt = u'%s<br>铺货人:%s' % (rt, obj.Published) if obj.Seller: seller = obj.Seller else: seller = t_store_configuration_file.objects.get( ShopName__exact=obj.ShopName).Seller rt = u'%s<br>店长/销售员:%s' % (rt, seller) rt = u'%s<br>刊登人:%s' % (rt, seller) return mark_safe(rt)
def show_Title_ProductID(self, obj): rt = django_wrap(obj.Title, ' ', 6) rt = u'%s<br>产品ID:<a href=" https://www.wish.com/c/%s" target="_blank">%s</a>' % ( rt, obj.ProductID, obj.ProductID) if obj.ReviewState == 'rejected' and obj.BeforeReviewState in [ 'approved', 'pending' ]: rt = rt + u'<br><span style="color:red">拒绝前状态:%s</span>' % obj.BeforeReviewState if obj.AdStatus in ['-1', '-2'] and obj.SName != '-1': einfor = t_wish_store_oplogs_obj.selectLogsByIDError(obj.ProductID) if einfor['errorcode'] == 0: rt = rt + u'<br><span style="color:red">异常原因:%s</span>' % '<br>'.join( einfor['einfors']) rt = u'%s<br>卖家简称:%s' % (rt, obj.ShopName) rt = u'%s<br>店长/销售员:%s' % (rt, obj.Seller) rt = u'%s<br>刊登人:%s' % (rt, obj.Published) return mark_safe(rt)
def show_Title_ProductID(self, obj): rt = django_wrap(obj.Title, ' ', 6) rt = u'%s<br>产品ID:<a href=" https://www.aliexpress.com/item/abc/%s.html" target="_blank">%s</a>' % ( rt, obj.ProductID, obj.ProductID) rt = u'%s<br>卖家简称:%s' % (rt, obj.ShopName) # t_upload_shopname_objs = t_upload_shopname.objects.filter(ShopName=obj.ShopName) # if t_upload_shopname_objs.exists(): # rt = u'%s<br>铺货人:%s' % (rt, t_upload_shopname_objs[0].uploader) # else: # rt = u'%s<br>店长/销售员:%s' % (rt, obj.Seller) # rt = u'%s<br>刊登人:%s' % (rt, obj.Seller) rt = u'%s<br>比价人:%s' % (rt, obj.priceParity_Person) if obj.ratingValue: rv = obj.ratingValue / 10.0 / 10.0 else: rv = '' rt = u'%s<br>我方商品评分:%s' % (rt, rv) return mark_safe(rt)
def show_goodsInfo(self, obj): try: from brick.public.django_wrap import django_wrap strTmp = "" Product_nature_value = "" for status in getChoices(ChoiceProductnature): if status[0] == obj.Product_nature: Product_nature_value = status[1] break Warehouse_value = "" for status in getChoices(ChoiceWarehouse): if status[0] == obj.Destination_warehouse: Warehouse_value = status[1] break if obj.LogisticsNumber is not None and obj.LogisticsNumber.strip( ) != '': strTmp = '<a target="_blank" href="https://www.baidu.com/s?wd=%s">查看物流</a>' % obj.LogisticsNumber strSupplierlink = obj.Supplierlink if obj.Supplierlink is not None else "" TransFactory = '转服装供应链生产' if obj.TransFactory is not None else "非转服装供应链生产" rt = u'<strong>商品SKU:</strong>%s<br><strong>店铺SKU:</strong>%s<br><strong>产品性质:</strong>%s<br><strong>商品名称:</strong>%s<br><strong>' \ u'计划需求人:</strong>%s<br><strong>供应商:</strong>%s<br><strong>采购人:</strong>%s<br><strong>采购备注:</strong>%s' \ u'<br><strong>物流信息:</strong>%s<br><strong>仓库:</strong>%s<br><strong>采购链接:</strong>%s<br><strong>转供应链:</strong>%s' % ( obj.ProductSKU, obj.ShopSKU, Product_nature_value, obj.ProductName,obj.Demand_people ,obj.Supplier,obj.Buyer,obj.Remarks,strTmp,Warehouse_value,django_wrap(strSupplierlink, ';', 1),TransFactory) return mark_safe(rt) except Exception, ex: messages.info(self.request, "商品信息加载错误,请联系IT解决:%s" % (str(ex))) rt = ""
def show_MainSKU(self, obj): rt = django_wrap(obj.MainSKU, ',', 3) return mark_safe(rt)
def show_All_ProductSKU_Num(self,obj): rt = django_wrap(obj.All_ProductSKU_Num,';',3) return mark_safe(rt)
def show_Stocking_plan_number(self,obj): rt = django_wrap(obj.Stocking_plan_number, '|', 3) return mark_safe(rt)
def show_title(self, obj): if obj.Status == 'Incomplete': status = '' else: status = obj.Status if '+' not in obj.seller_sku and '*' in obj.seller_sku: seller_sku = obj.seller_sku.split('*')[0] else: seller_sku = obj.seller_sku t_shopsku_information_binding_obj = t_shopsku_information_binding.objects.filter( ShopSKU=seller_sku) if t_shopsku_information_binding_obj: sku = t_shopsku_information_binding_obj[0].SKU # 组合产品显示商品SKU合集 if len(sku) == 6 and sku[0:2] == 'ZH': zh_obj = t_combination_sku_log.objects.filter(Com_SKU=sku) if zh_obj: sku = zh_obj[0].Pro_SKU else: sku = obj.seller_sku count = 0 sku_show = '' if sku: for i in sku: count += 1 sku_show += i if count % 6 == 0: sku_show += '<br>' count = 0 seller_sku_show = '' if sku: for i in sku: count += 1 seller_sku_show += i if count % 10 == 0: seller_sku_show += '<br>' title_show = django_wrap(obj.title, ' ', 4) title = u'%s<br>ASIN: %s <br>SKU: %s<br>店铺SKU: %s<br>状态:%s<br>店铺:%s' % ( obj.title, obj.asin, obj.sku, obj.seller_sku, status, obj.shop_name) # title = django_wrap(title, ' ', 3) if len(title) < 400: rt = title else: rt = """<script type="text/javascript"> $(document).ready(function(){ $("#but%s").click(function(){ $("#d%s").toggle(); $("#dd%s").toggle(); }); }); </script> <p id="d%s" >%s......</p> <p id="dd%s" hidden="hidden">%s</p> <br/> <button type="button" id="but%s">隐藏/全显</button> """ % (obj.id, obj.id, obj.id, obj.id, title[:400], obj.id, title, obj.id) return mark_safe(rt)
def show_Pro_SKU(self, obj): rt = django_wrap(obj.Pro_SKU, '+', 6) return mark_safe(rt)