Commit 71ceef3a by centerwy

feat: (tradetransferCtl/Sve) 商标转让跟进记录接口调整

parent 0d8d1ba3
...@@ -126,6 +126,20 @@ class TradetransferCtl extends CtlBase { ...@@ -126,6 +126,20 @@ class TradetransferCtl extends CtlBase {
} }
//更新沟通记录
async updateCommunicationLog(p, q, req){
var self = this;
if(!p.ali_bizid){
return system.getResult(null, "请求异常");
}
try {
var rst = await self.service.writecommunicationlog(p);
console.log(rst)
return { status: 0, msg: "成功", data: {ali_bizid : p.ali_bizid} };
} catch (e) {
return system.getResult(null, "请求异常");
}
}
} }
module.exports = TradetransferCtl; module.exports = TradetransferCtl;
......
...@@ -60,7 +60,9 @@ module.exports = (db, DataTypes) => { ...@@ -60,7 +60,9 @@ module.exports = (db, DataTypes) => {
owner_name: DataTypes.STRING, //业务员姓名 owner_name: DataTypes.STRING, //业务员姓名
owner_mobile: DataTypes.STRING, //业务员电话 owner_mobile: DataTypes.STRING, //业务员电话
mail_zip_url: DataTypes.STRING, //邮寄文件链接  mail_zip_url: DataTypes.STRING, //邮寄文件链接 
logistics: DataTypes.STRING //邮寄单编号 logistics: DataTypes.STRING, //邮寄单编号
communicationLog: DataTypes.TEXT //沟通记录
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -488,16 +488,42 @@ class TradetransferService extends ServiceBase { ...@@ -488,16 +488,42 @@ class TradetransferService extends ServiceBase {
//买卖家沟通记录 //买卖家沟通记录
async writecommunicationlog(obj) { async writecommunicationlog(obj) {
var obj = { let faillist = [];
action: "WriteCommunicationLog", let transferinfo = await this.findOne({ ali_bizid: obj.ali_bizid });
reqbody: { let self = this;
BizId: obj.ali_bizid, await this.db.transaction(async function (t) {
note: obj.note let params = {
creter: obj.user,
BizId: obj.ali_bizid,
time: obj.trackDate,
note: obj.note
};
if(transferinfo.communicationLog.length == 0){
transferinfo.communicationLog = [];
transferinfo.communicationLog.push(params);
}else{
transferinfo.communicationLog = JSON.parse(transferinfo.communicationLog);
transferinfo.communicationLog.push(params);
}
params = JSON.stringify(transferinfo.communicationLog);
let upd =self.dao.model.update({communicationLog : params }, { where: { ali_bizid: obj.ali_bizid } });
if (!upd) {
faillist.push(obj.ali_bizid);
} }
}
var rtn = await this.aliclient(obj) //调用阿里接口
console.log(rtn) // let aliObj = {
return rtn; // action: "WriteCommunicationLog",
// reqbody: {
// BizId: obj.ali_bizid,
// note: obj.note
// }
// }
// this.aliclient(aliObj);
return ;
});
} }
//获取签名 //获取签名
......
...@@ -93,12 +93,17 @@ ...@@ -93,12 +93,17 @@
this.trackVisable=false; this.trackVisable=false;
}, },
saveClick(){ saveClick(){
let pushData={"pushData":{"trackDate":new Date().toLocaleString(),"trackContent":this.trackContent}}; let pushData={
"trackDate":new Date().toLocaleString(),
"note":this.trackContent,
"ali_bizid": 'trademark_prepayment_pre-cn-v0h1mda5i0i',
"user": 51
};
var self=this; var self=this;
this.$root.postReq("/web/transfer/tradetransferCtl/track", pushData).then(function (d) { this.$root.postReq("/web/transfer/tradetransferCtl/updateCommunicationLog", pushData).then(function (d) {
/*返回整个跟进字段,解析为数组*/ /*返回整个跟进字段,解析为数组*/
self.trackRecords.push(d.data); self.trackRecords.push(d.data);
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment