19 changed files with 3894 additions and 43 deletions
@ -0,0 +1,161 @@ |
|||
using Newtonsoft.Json; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Net.Http; |
|||
using System.Security.Cryptography; |
|||
using System.Text; |
|||
|
|||
namespace DingHelper |
|||
{ |
|||
public class DingApiHelper |
|||
{ |
|||
private static readonly string key = "SECe801b177b5377d78d1b387cfa35e3f64c705bb052544c752c997c7cb41fe4a4d"; |
|||
private static readonly string webhook = "https://oapi.dingtalk.com/robot/send?access_token=945444842b6302fd14906bdba0865fdd74e5129024622ea0d4dcb92f5472b787"; |
|||
|
|||
private static DingApiHelper _mainnew =new DingApiHelper(key, webhook); |
|||
public static DingApiHelper Main { |
|||
get { |
|||
if (_mainnew == null) |
|||
{ |
|||
_mainnew = _mainnew = new DingApiHelper(key, webhook); |
|||
} |
|||
return _mainnew; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 钉钉Secret
|
|||
/// </summary>
|
|||
private string dDSecret = string.Empty; |
|||
|
|||
/// <summary>
|
|||
/// 钉钉的webHook地址
|
|||
/// </summary>
|
|||
private string webHookUrl = string.Empty; |
|||
|
|||
/// <summary>
|
|||
/// 初始化
|
|||
/// </summary>
|
|||
/// <param name="secret">钉钉Secret,机器人设置加签处获取</param>
|
|||
/// <param name="webHook">机器人设置完成的Webhook地址</param>
|
|||
public DingApiHelper(string secret, string webHook) |
|||
{ |
|||
dDSecret = secret; |
|||
webHookUrl = webHook; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 发送钉钉通知
|
|||
/// </summary>
|
|||
/// <param name="msg">内容</param>
|
|||
public bool SendNotify(string msg) |
|||
{ |
|||
try |
|||
{ |
|||
string timestamp = ((DateTime.Now.Ticks - TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Ticks) / 10000).ToString(); |
|||
|
|||
string stringToSign = $"{timestamp}\n{dDSecret}"; |
|||
|
|||
string hmac_code = GetHash(stringToSign, dDSecret); |
|||
|
|||
string sign = System.Web.HttpUtility.UrlEncode(hmac_code, Encoding.UTF8); |
|||
|
|||
//消息类型
|
|||
var msgtype = MsgTypeEnum.text.ToString(); |
|||
|
|||
//文本内容
|
|||
var text = new Text |
|||
{ |
|||
Content = msg |
|||
}; |
|||
|
|||
//指定目标人群
|
|||
var at = new At() |
|||
{ |
|||
AtMobiles = new List<string>() { }, |
|||
IsAtAll = false |
|||
}; |
|||
|
|||
|
|||
string url = $"{webHookUrl}&sign={sign}×tamp={timestamp}"; |
|||
using (HttpClient httpClient = new HttpClient()) |
|||
{ |
|||
HttpContent content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(new |
|||
{ |
|||
msgtype, |
|||
text, |
|||
at |
|||
})); |
|||
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); |
|||
HttpResponseMessage response = httpClient.PostAsync(url, content).Result; |
|||
string html = response.Content.ReadAsStringAsync().Result; |
|||
} |
|||
return true; |
|||
|
|||
} |
|||
catch(Exception ex) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
|
|||
public string GetHash(string text, string key) |
|||
{ |
|||
ASCIIEncoding encoding = new ASCIIEncoding(); |
|||
|
|||
byte[] textBytes = encoding.GetBytes(text); |
|||
byte[] keyBytes = encoding.GetBytes(key); |
|||
|
|||
byte[] hashBytes; |
|||
|
|||
using (HMACSHA256 hash = new HMACSHA256(keyBytes)) |
|||
hashBytes = hash.ComputeHash(textBytes); |
|||
|
|||
return Convert.ToBase64String(hashBytes); |
|||
} |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 钉钉群机器人消息类型枚举
|
|||
/// </summary>
|
|||
public enum MsgTypeEnum |
|||
{ |
|||
text, |
|||
link, |
|||
markdown, |
|||
actionCard, |
|||
feedCard |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 文本类型
|
|||
/// </summary>
|
|||
public class Text |
|||
{ |
|||
/// <summary>
|
|||
/// 文本内容
|
|||
/// </summary>
|
|||
[JsonProperty(PropertyName = "content")] |
|||
public string Content { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// @指定人
|
|||
/// </summary>
|
|||
public class At |
|||
{ |
|||
/// <summary>
|
|||
/// @的联系人
|
|||
/// </summary>
|
|||
[JsonProperty(PropertyName = "atMobiles")] |
|||
public List<string> AtMobiles { set; get; } |
|||
|
|||
/// <summary>
|
|||
/// 是否@所有人
|
|||
/// </summary>
|
|||
[JsonProperty(PropertyName = "isAtAll")] |
|||
public bool IsAtAll { set; get; } |
|||
} |
|||
} |
@ -0,0 +1,74 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Security.Cryptography; |
|||
using System.Text; |
|||
|
|||
namespace 齐越慧眼 |
|||
{ |
|||
public class DesEncoding |
|||
{ |
|||
#region 加密解密法一
|
|||
//默认密钥向量
|
|||
private static byte[] Keys = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; |
|||
|
|||
private static string encryptKey= "Feng23Fen#321Bhe"; |
|||
|
|||
/// <summary>
|
|||
/// DES加密字符串
|
|||
/// </summary>
|
|||
/// <param name="encryptString">待加密的字符串</param>
|
|||
/// <param name="encryptKey">加密密钥,要求为16位</param>
|
|||
/// <returns>加密成功返回加密后的字符串,失败返回源串</returns>
|
|||
|
|||
public static string EncryptDES(string encryptString) |
|||
{ |
|||
try |
|||
{ |
|||
byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 16)); |
|||
byte[] rgbIV = Keys; |
|||
byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString); |
|||
var DCSP = Aes.Create(); |
|||
MemoryStream mStream = new MemoryStream(); |
|||
CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write); |
|||
cStream.Write(inputByteArray, 0, inputByteArray.Length); |
|||
cStream.FlushFinalBlock(); |
|||
return Convert.ToBase64String(mStream.ToArray()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
return ex.Message + encryptString; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// DES解密字符串
|
|||
/// </summary>
|
|||
/// <param name="decryptString">待解密的字符串</param>
|
|||
/// <param name="decryptKey">解密密钥,要求为16位,和加密密钥相同</param>
|
|||
/// <returns>解密成功返回解密后的字符串,失败返源串</returns>
|
|||
|
|||
public static string DecryptDES(string decryptString) |
|||
{ |
|||
try |
|||
{ |
|||
byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 16)); |
|||
byte[] rgbIV = Keys; |
|||
byte[] inputByteArray = Convert.FromBase64String(decryptString); |
|||
var DCSP = Aes.Create(); |
|||
MemoryStream mStream = new MemoryStream(); |
|||
CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write); |
|||
Byte[] inputByteArrays = new byte[inputByteArray.Length]; |
|||
cStream.Write(inputByteArray, 0, inputByteArray.Length); |
|||
cStream.FlushFinalBlock(); |
|||
return Encoding.UTF8.GetString(mStream.ToArray()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
return ex.Message + decryptString; |
|||
} |
|||
|
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace 齐越慧眼.Models |
|||
{ |
|||
public enum TeamItemState |
|||
{ |
|||
待比价 = 0, |
|||
|
|||
精选 = 1, |
|||
|
|||
待上架 = 2, |
|||
|
|||
已上架 = 3, |
|||
|
|||
放弃 = 4, |
|||
|
|||
已发布比价 = 5, |
|||
|
|||
已比价 = 6, |
|||
|
|||
待修改 = 7 |
|||
} |
|||
|
|||
|
|||
public enum PriceTaskState |
|||
{ |
|||
待比价 = 0, |
|||
|
|||
已比价 = 1, |
|||
|
|||
待修改 = 2, |
|||
|
|||
比价完成 = 3 |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
{ |
|||
"name": "script", |
|||
"version": "1.0.0", |
|||
"description": "", |
|||
"main": "app.js", |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"keywords": [], |
|||
"author": "", |
|||
"license": "ISC" |
|||
} |
@ -0,0 +1,17 @@ |
|||
|
|||
var Web3 = require('web3') |
|||
|
|||
var web3 = new Web3('https://bsc-dataseed.binance.org/'); |
|||
|
|||
|
|||
|
|||
module.exports = function (callback) { |
|||
|
|||
var data= web3.eth.accounts.create(); |
|||
callback(null, { |
|||
address: data.address, |
|||
privateKey: data.privateKey |
|||
}); |
|||
} |
|||
|
|||
|
@ -0,0 +1,27 @@ |
|||
|
|||
var Web3 = require('web3') |
|||
const sigUtil = require('eth-sig-util') |
|||
const ethUtil = require('ethereumjs-util') |
|||
|
|||
var web3 = new Web3('https://bsc-dataseed.binance.org/'); |
|||
|
|||
|
|||
|
|||
module.exports = function (callback, obj) { |
|||
var extraParams = {} |
|||
var key = obj.privateKey; |
|||
obj = obj.data; |
|||
|
|||
var from = obj.params[0]; |
|||
var message = obj.params[1]; |
|||
|
|||
var msgParams = { |
|||
from: from, |
|||
data: JSON.parse(message), |
|||
} |
|||
|
|||
const serialized = sigUtil.signTypedData(Buffer.from(key.replace('0x', ''), 'hex'), msgParams); |
|||
callback(null, serialized); |
|||
} |
|||
|
|||
|
@ -0,0 +1,17 @@ |
|||
{ |
|||
"name": "script", |
|||
"version": "1.0.0", |
|||
"description": "", |
|||
"main": "app.js", |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"keywords": [], |
|||
"author": "", |
|||
"license": "ISC", |
|||
"dependencies": { |
|||
"eth-sig-util": "^3.0.1", |
|||
"ethereumjs-util": "^7.1.3", |
|||
"web3": "^1.6.1" |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,441 @@ |
|||
<template> |
|||
<div class="about"> |
|||
<a-tabs @change="changeTab"> |
|||
<a-tab-pane key="0" tab="待比价"> |
|||
|
|||
</a-tab-pane> |
|||
<a-tab-pane key="1" tab="已比价"> |
|||
|
|||
</a-tab-pane> |
|||
<a-tab-pane key="2" tab="待修改"> |
|||
|
|||
</a-tab-pane> |
|||
<a-tab-pane key="3" tab="已完结"> |
|||
|
|||
</a-tab-pane> |
|||
</a-tabs> |
|||
|
|||
<div class="border"> |
|||
<a-row> |
|||
<a-col :span="4"> |
|||
<div class="headCol headColFirst">商品信息</div> |
|||
</a-col> |
|||
<a-col :span="2"> |
|||
<div class="headCol">供应商来源方式</div> |
|||
</a-col> |
|||
<a-col :span="1"> |
|||
<div class="headCol">平台</div> |
|||
</a-col> |
|||
<a-col :span="2"> |
|||
<div class="headCol">采购链接</div> |
|||
</a-col> |
|||
<a-col :span="3"> |
|||
<div class="headCol">SKU名称</div> |
|||
</a-col> |
|||
<a-col :span="2"> |
|||
<div class="headCol">采购价</div> |
|||
</a-col> |
|||
<a-col :span="2"> |
|||
<div class="headCol">快递费</div> |
|||
</a-col> |
|||
<a-col :span="2"> |
|||
<div class="headCol">平台扣点</div> |
|||
</a-col> |
|||
<a-col :span="1"> |
|||
<div class="headCol">利润</div> |
|||
</a-col> |
|||
<a-col :span="1"> |
|||
<div class="headCol">利润率</div> |
|||
</a-col> |
|||
<a-col :span="4"> |
|||
<div class="headCol">对标商品信息</div> |
|||
</a-col> |
|||
</a-row> |
|||
|
|||
|
|||
<!--内容页面--> |
|||
<a-row justify="center" style="text-align: center;" v-for="item in datas" :key="item.Id"> |
|||
<a-col :span="4"> |
|||
<div class="borderRight"> |
|||
<div |
|||
style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;"> |
|||
<a target="_black" :href="item.GoodsUrl"> <img :src="'http:'+item.ItemImg" width="200" |
|||
height="165" /></a> |
|||
<a-row> |
|||
<a-col :span="12" style="text-align: left;">¥{{item.Price}}</a-col> |
|||
<a-col :span="12" style="text-align: right;">{{item.Sales}}</a-col> |
|||
</a-row> |
|||
</div> |
|||
</div> |
|||
</a-col> |
|||
<!--供应商来源方式--> |
|||
<a-col :span="2" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<a-select v-if="item.isEdit" v-model='ext.SupplierFrom' :show-search="true" |
|||
:not-found-content="null" :show-arrow="false" :filter-option="true" |
|||
style="width: 100%;" |
|||
:autoClearSearchValue="false" @search="handleSearch($event,ext)" @blur="handleBlur($event,ext,item)" |
|||
@change="handleChange($event,ext,item)"> |
|||
<a-select-option v-for="item in extFormList" :key="item"> {{item}}</a-select-option> |
|||
</a-select> |
|||
<span class="spanValue" v-else>{{ext.SupplierFrom}}</span> |
|||
</div> |
|||
</a-col> |
|||
<!--平台--> |
|||
<a-col :span="1" style="margin-top: 5px;"> |
|||
<div style="height: 40px;" v-for="(ext,index) in item.Extensions" :key="index"> |
|||
<span v-if="ext.Platform==0">淘宝</span> |
|||
<span v-if="ext.Platform==1">京东</span> |
|||
<span v-if="ext.Platform==2">阿里巴巴</span> |
|||
</div> |
|||
</a-col> |
|||
<!--采购链接--> |
|||
<a-col :span="2" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<a-input v-if="item.isEdit" v-model="ext.BuyUrl"></a-input> |
|||
<span class="spanValue" v-else>{{ext.BuyUrl}}</span> |
|||
</div> |
|||
</a-col> |
|||
<!--SKU名称--> |
|||
<a-col :span="3" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<a-input v-if="item.isEdit" v-model="ext.SkuName"></a-input> |
|||
<span class="spanValue" v-else>{{ext.SkuName}}</span> |
|||
</div> |
|||
</a-col> |
|||
<!--采购价--> |
|||
<a-col :span="2" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<div v-if="ext.BuyPrice||item.isEdit"> |
|||
<a-input v-if="item.isEdit" v-model="ext.BuyPrice"></a-input> |
|||
<span class="spanValue" v-else>{{ext.BuyPrice}}</span> |
|||
</div> |
|||
<span v-else>-</span> |
|||
</div> |
|||
</a-col> |
|||
<!--快递费--> |
|||
<a-col :span="2" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<div v-if="ext.BuyPrice||item.isEdit"> |
|||
<a-input v-if="item.isEdit" v-model="ext.KDPrice"></a-input> |
|||
<span class="spanValue" v-else>{{ext.KDPrice}}</span> |
|||
</div> |
|||
<span v-else>-</span> |
|||
</div> |
|||
</a-col> |
|||
<!--平台扣点--> |
|||
<a-col :span="2" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<!-- <a-input v-if="item.isEdit" v-model="ext.PlatformPoint"></a-input>--> |
|||
<span class="spanValue">{{ext.PlatformPoint}}</span> |
|||
</div> |
|||
</a-col> |
|||
<!--利润--> |
|||
<a-col :span="1" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<span v-if="ext.BuyPrice" class="spanValue">{{ext.Profit}}</span> |
|||
<span v-else>-</span> |
|||
</div> |
|||
</a-col> |
|||
<!--利润率--> |
|||
<a-col :span="1" style="margin-top: 5px;"> |
|||
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> |
|||
<!-- <a-input v-if="item.isEdit" v-model="ext.Profits"></a-input>--> |
|||
<span v-if="ext.BuyPrice" class="spanValue">{{ext.Profits}}%</span> |
|||
<span v-else>-</span> |
|||
</div> |
|||
</a-col> |
|||
<a-col :span="4"> |
|||
<div style="padding-top: 10px;padding-bottom: 10px;height: 215px;" class="borderLeft"> |
|||
<div style="margin: 0px auto;width: 200px;"> |
|||
<div v-if="item.isEdit"> |
|||
<a-input style="margin-top: 10px;" v-model="item.RivalTitle" placeholder="请输入竞品标题"> |
|||
</a-input> |
|||
|
|||
<a-input style="margin-top: 10px;" v-model="item.RivalPrice" placeholder="请输入竞品价格"> |
|||
</a-input> |
|||
|
|||
<a-input style="margin-top: 10px;" v-model="item.RivalPLCount" placeholder="请输入竞品评论数"> |
|||
</a-input> |
|||
|
|||
<a-input style="margin-top: 10px;" v-model="item.RivalGoodsId" placeholder="请输入竞品链接"> |
|||
</a-input> |
|||
</div> |
|||
<div v-else> |
|||
<div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 5px auto;"> |
|||
<a target="_black" :href="item.RivalGoodsId"> |
|||
<img src="/jp.png" width="200" height="165" /></a> |
|||
<a-row> |
|||
<a-col :span="12" style="text-align: left;">¥{{item.RivalPrice}}</a-col> |
|||
<a-col :span="12" style="text-align: right;">{{item.RivalPLCount}}人评论</a-col> |
|||
</a-row> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</a-col> |
|||
<!--操作--> |
|||
<a-col :span="24" class="borderT"> |
|||
<a-row justify="center" type="flex" :align="'middle'"> |
|||
<a-col :span="4"> |
|||
<a class="borderNoTop itemtitle" :title="item.Title">{{item.Title}}</a> |
|||
</a-col> |
|||
<a-col :span="16"> |
|||
<a-row> |
|||
<a-col :span="12" style="text-align: left;"> |
|||
<span v-if="item.PriceTaskState==0"> |
|||
<a-button style="margin-left: 10px;" type="primary" |
|||
@click="getImgBase64(item.ItemImg)">搜图 |
|||
</a-button> |
|||
|
|||
</span> |
|||
|
|||
<a-button v-if="item.PriceTaskState==0" style="margin-left: 10px;" type="primary" |
|||
@click="setState(item.PriceTaskId,1)">完成比价 |
|||
</a-button> |
|||
|
|||
|
|||
<a-button v-if="item.PriceTaskState==1" style="margin-left: 10px;" type="primary" |
|||
>等待验收 |
|||
</a-button> |
|||
|
|||
<a-button v-if="item.PriceTaskState==2" style="margin-left: 10px;" type="primary" |
|||
@click="setState(item.PriceTaskId,1)">修改完成 |
|||
</a-button> |
|||
|
|||
|
|||
|
|||
</a-col> |
|||
|
|||
<a-col :span="12" style="text-align: right;" v-if="item.PriceTaskState!=3"> |
|||
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===false" |
|||
@click="editData(item)">编辑</a-button> |
|||
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" |
|||
@click="canelEdit(item)">取消</a-button> |
|||
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" |
|||
@click="setData(item)">保存</a-button> |
|||
</a-col> |
|||
</a-row> |
|||
</a-col> |
|||
<a-col :span="4"> |
|||
<a class="borderNoTop itemtitle" :title="item.RivalTitle">{{item.RivalTitle}}</a> |
|||
</a-col> |
|||
</a-row> |
|||
</a-col> |
|||
</a-row> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
datas: [], |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` |
|||
}, |
|||
filters: {}, |
|||
sorter: { field: 'Id', order: 'asc' }, |
|||
loading: false, |
|||
queryParam: { condition: 'State', keyword: 0 }, |
|||
selectedRowKeys: [], |
|||
currentTab: 0, |
|||
lastEditData: undefined, |
|||
extFormList:['以图搜款'] |
|||
} |
|||
}, |
|||
mounted() { |
|||
window.getDatas = this.getDatas |
|||
// this.getDatas(0) |
|||
}, |
|||
activated() { |
|||
//this.getDatas(0) |
|||
}, |
|||
methods: { |
|||
// 实现select选择框可下拉单选,也可输入赋值 |
|||
handleSearch(value,ext,item) { |
|||
this.handleChange(value,ext,item); |
|||
}, |
|||
handleChange(value,ext,item) { |
|||
|
|||
ext.SupplierFrom= value != null && value != '' ? value : []; |
|||
|
|||
if(item.Extensions.filter(c=>c.SupplierFrom=='以图搜款').length>2) |
|||
{ |
|||
this.$message.error('以图搜款最多可选择2个!'); |
|||
ext.SupplierFrom='' |
|||
} |
|||
}, |
|||
handleBlur(value,ext) { |
|||
ext.SupplierFrom = value; |
|||
if (value&& this.extFormList.indexOf(value) == -1) { |
|||
this.extFormList.push(value); |
|||
} |
|||
}, |
|||
changeTab(e) { |
|||
this.getDatas(e) |
|||
this.currentTab = e |
|||
}, |
|||
getDatas(type) { |
|||
this.http.post('/HuiYan/pricetasklog/GetItems', { |
|||
PageIndex: this.pagination.current, |
|||
PageRows: this.pagination.pageSize, |
|||
SortField: this.sorter.field || 'Id', |
|||
SortType: this.sorter.order, |
|||
Search: { condition: 'State', keyword: type }, |
|||
...this.filters |
|||
}).then(res => { |
|||
res.Data.forEach(item => { |
|||
item.isEdit = false |
|||
item.Extensions.forEach(ext => { |
|||
ext.PlatformPoint = parseFloat(item.RivalPrice * 0.05).toFixed(2) |
|||
ext.Profit = item.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint |
|||
if (ext.BuyPrice == 0) { |
|||
ext.Profits = 0 |
|||
} |
|||
else { |
|||
ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed(2) |
|||
} |
|||
}) |
|||
}); |
|||
this.datas = res.Data |
|||
}) |
|||
}, |
|||
editData(data) { |
|||
data.isEdit = true |
|||
this.lastEditData = JSON.parse(JSON.stringify(data)) |
|||
}, |
|||
canelEdit(data) { |
|||
this.lastEditData.isEdit = false |
|||
Object.assign(data, this.lastEditData) |
|||
}, |
|||
setData(data) { |
|||
data.Extensions.forEach(ext => { |
|||
ext.PlatformPoint = parseFloat(data.RivalPrice * 0.05).toFixed(2) |
|||
ext.Profit = data.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint |
|||
|
|||
if (ext.BuyPrice == 0) { |
|||
ext.Profits = 0 |
|||
} |
|||
else { |
|||
ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed(2) |
|||
} |
|||
}) |
|||
this.http.post('/HuiYan/teamitems/SetItem', data).then(res => { |
|||
if (res.Success) { |
|||
this.$message.success('操作成功!'); |
|||
|
|||
data.isEdit = false |
|||
} else { |
|||
this.$message.error(res.Msg); |
|||
} |
|||
}) |
|||
}, |
|||
setState(id, type) { |
|||
|
|||
///发布比价 |
|||
if (type == 5) { |
|||
this.sendPriceTask(id) |
|||
} |
|||
else if (type == 0) { |
|||
this.canelPriceTask(id) |
|||
} |
|||
else { |
|||
this.http.post(`/HuiYan/pricetasklog/SetState?id=${id}&state=${type}`).then(res => { |
|||
if (res.Success) { |
|||
this.$message.success('操作成功!'); |
|||
this.getDatas(this.currentTab) |
|||
} else { |
|||
this.$message.error(res.Msg); |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
sendPriceTask(id) { |
|||
this.http.post(`/HuiYan/pricetasklog/AddTask?id=${id}`).then(res => { |
|||
if (res.Success) { |
|||
this.$message.success('操作成功!'); |
|||
this.getDatas(this.currentTab) |
|||
} else { |
|||
this.$message.error(res.Msg); |
|||
} |
|||
}) |
|||
}, |
|||
canelPriceTask(id) { |
|||
this.http.post(`/HuiYan/pricetasklog/CanelTask?id=${id}`).then(res => { |
|||
if (res.Success) { |
|||
this.$message.success('操作成功!'); |
|||
this.getDatas(this.currentTab) |
|||
} else { |
|||
this.$message.error(res.Msg); |
|||
} |
|||
}) |
|||
}, |
|||
getImgBase64(src) { |
|||
hyCoreModel.getImgBase64('http:' + src).then(res => { |
|||
console.log(res) |
|||
}) |
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.headCol { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
border-left: 0px; |
|||
text-align: center; |
|||
background-color: rgba(243, 242, 247, 1); |
|||
} |
|||
|
|||
.headColFirst { |
|||
border-left: 1px solid rgba(215, 215, 215, 1); |
|||
} |
|||
|
|||
.borderNoTop { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
border-top: 0px; |
|||
border-bottom: 0px; |
|||
} |
|||
|
|||
.borderT { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
border-left: 0px; |
|||
border-right: 0px; |
|||
} |
|||
|
|||
.border { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
width: 1450px; |
|||
} |
|||
|
|||
.borderLeft { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
border-top: 0px; |
|||
border-right: 0px; |
|||
border-bottom: 0px; |
|||
} |
|||
|
|||
.borderRight { |
|||
border: 1px solid rgba(215, 215, 215, 1); |
|||
border-top: 0px; |
|||
border-left: 0px; |
|||
border-bottom: 0px; |
|||
} |
|||
|
|||
.itemtitle { |
|||
height: 50px; |
|||
max-height: 50px; |
|||
display: block; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.spanValue { |
|||
display: block; |
|||
overflow: auto; |
|||
} |
|||
</style> |
Loading…
Reference in new issue