Commit 182ef480 by 蒋勇

d

parents d0e47d33 71ceef3a
......@@ -142,6 +142,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;
......
......@@ -60,7 +60,9 @@ module.exports = (db, DataTypes) => {
owner_name: DataTypes.STRING, //业务员姓名
owner_mobile: DataTypes.STRING, //业务员电话
mail_zip_url: DataTypes.STRING, //邮寄文件链接 
logistics: DataTypes.STRING //邮寄单编号
logistics: DataTypes.STRING, //邮寄单编号
communicationLog: DataTypes.TEXT //沟通记录
}, {
paranoid: true,//假的删除
underscored: true,
......
......@@ -523,16 +523,42 @@ class TradetransferService extends ServiceBase {
}
//买卖家沟通记录
async writecommunicationlog(obj) {
var obj = {
action: "WriteCommunicationLog",
reqbody: {
BizId: obj.ali_bizid,
note: obj.note
let faillist = [];
let transferinfo = await this.findOne({ ali_bizid: obj.ali_bizid });
let self = this;
await this.db.transaction(async function (t) {
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);
}
}
var rtn = await this.aliclient(obj)
console.log(rtn)
return rtn;
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);
}
//调用阿里接口
// let aliObj = {
// action: "WriteCommunicationLog",
// reqbody: {
// BizId: obj.ali_bizid,
// note: obj.note
// }
// }
// this.aliclient(aliObj);
return ;
});
}
//获取签名
......
......@@ -118,6 +118,7 @@
this.trackVisable=false;
},
saveClick(){
<<<<<<< HEAD
if(this.trackContent==""){
return;
}
......@@ -131,6 +132,19 @@
self.currentRow.tracklog=d.data.tracklog;
self.handlerTrackLog(self.currentRow);
=======
let pushData={
"trackDate":new Date().toLocaleString(),
"note":this.trackContent,
"ali_bizid": 'trademark_prepayment_pre-cn-v0h1mda5i0i',
"user": 51
};
var self=this;
this.$root.postReq("/web/transfer/tradetransferCtl/updateCommunicationLog", pushData).then(function (d) {
/*返回整个跟进字段,解析为数组*/
self.trackRecords.push(d.data);
>>>>>>> 71ceef3aff931c3fa95f0a89875de812b8a8a989
})
}
......
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