Commit dd46067e by 王勇飞

add contactAddress

parent fa96a3ff
......@@ -163,6 +163,23 @@ class Dao {
}
return this.db.query(sql, tmpParas);
}
async customUpdate(sql, paras, t) {
var tmpParas = null;
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.UPDATE };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.UPDATE };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' ? { type: this.db.QueryTypes.UPDATE } : { replacements: paras, type: this.db.QueryTypes.UPDATE };
}
return this.db.query(sql, tmpParas);
}
async findCount(whereObj = null) {
return this.model.count(whereObj, { logging: false }).then(c => {
return c;
......
......@@ -5,6 +5,7 @@ module.exports = (db, DataTypes) => {
return db.define("tmcustomerinfo", {
orderNum:DataTypes.STRING,
customerContact:DataTypes.STRING,
contactAddress:DataTypes.STRING,
mobile:DataTypes.STRING,
email:DataTypes.STRING,
tel:DataTypes.STRING,
......
......@@ -1003,9 +1003,15 @@ class OrderService extends ServiceBase {
async createOrder2ToAddTradeMark(self, user, app, tm, nclones, apply, order, t) {
var customerObj = {
zipCode: apply.zipCode || "", order_id: order.id, orderNum: order.orderNum,
customerContact: apply.customerContact, mobile: apply.mobile, email: apply.email
customerContact: apply.customerContact, contactAddress: apply.contactAddress, mobile: apply.mobile, email: apply.email
};
var customer = await self.tmcustomerinfoDao.create(customerObj, t);//商标联系人
//将当前联系地址同步到该公司其他订单上
self.contactAddressSyncUpdate(apply.contactAddress, apply.mobile, apply.applyName).then(res => {
console.log("contactAddressSyncUpdate result: " + res);
}).catch(err => {
console.log("contactAddressSyncUpdate err: " + err);
})
var applierObj = {
orderNum: order.orderNum, type: apply.type, applyName: apply.applyName,
identityCard: apply.identityCard, creditCode: apply.creditCode,
......@@ -1753,7 +1759,7 @@ class OrderService extends ServiceBase {
var customer = obj.customer || null;
var copyrightType = Number(tm.reqtype || 0);//1软件著作权、2作品著作权、×××
var order = {
orderNum: tm.orderNum, applyName: apply.applyName || "", customerContact: customer.customerContact,
orderNum: tm.orderNum, applyName: apply.applyName || "", customerContact: customer.customerContact, contactAddress: customer.contactAddress,
customerMobile: customer.mobile, remark: apply.remark || ""
};
var orderItem = await this.dao.findOne({ orderNum: order.orderNum });
......@@ -1873,6 +1879,14 @@ class OrderService extends ServiceBase {
} else {
customerResult = await self.tmcustomerinfoDao.create(customer, t);//商标联系人
}
//将当前联系地址同步到该公司其他订单上
self.contactAddressSyncUpdate(customer.contactAddress, customer.mobile, apply.applyName).then(res => {
console.log("contactAddressSyncUpdate result: " + res);
}).catch(err => {
console.log("contactAddressSyncUpdate err: " + err);
})
tm["tmSourceType"] = "16";
if (orderItem.channelCode == "ali_zcsubmit") {
if (!apply.principal) {
......@@ -1953,6 +1967,13 @@ class OrderService extends ServiceBase {
})
};
//将联系地址同步到该公司的其他订单数据中
async contactAddressSyncUpdate(contactAddress, mobile, applyName) {
let sql = "UPDATE h_tmcustomer_info SET contactAddress = '"+ contactAddress +"' WHERE id IN (SELECT id FROM (SELECT cu.id FROM h_tmapplier_info AS ap LEFT JOIN h_tmcustomer_info AS cu ON ap.orderNum = cu.orderNum WHERE cu.mobile = '"+ mobile +"' AND ap.applyName = '"+ applyName +"') AS a)";
let updateRes = await this.dao.customUpdate(sql);
return updateRes;
}
//商标自动提报(内部后期)专用---修改
async updateInsideOrderDetailByOrderNum2(obj, onlyCode) {
console.log("商标自动提报专用#####################");
......
......@@ -1234,7 +1234,7 @@ class TrademarkService extends ServiceBase {
Region: 1,//申请⼈地区("中国⼤陆:1","中国⾹港:2","中国澳⻔:3","中国台湾:4","国外:5")
ContactName: customer.customerContact,
ContactNumber: customer.mobile,
ContactAddress: applier.applyAddr,
ContactAddress: customer.contactAddress,
ContactEmail: customer.email && customer.email.indexOf("@") >= 0 ? customer.email : "gsb@gongsibao.com",
ContactZipcode: customer.zipCode || "100000",
LoaOssKey: item.sealAuthorizeStuff,//授权书OSSKey,TODO:需要设置生成文件失效时间
......
......@@ -274,6 +274,13 @@
<el-input v-model="apply.customerContact"></el-input>
</el-form-item>
<div style="clear:both;"></div>
<el-form-item label-width="140px" label="联系地址" style="width:950px;float:left;padding-right:50px;"
prop="contactAddress">
<el-input v-model="apply.contactAddress"></el-input>
</el-form-item>
<div style="clear:both;"></div>
<el-form-item label-width="140px" label="联系电话" style="width:950px;float:left;padding-right:50px;"
prop="mobile">
<el-input v-model="apply.mobile"></el-input>
......@@ -430,20 +437,27 @@
<div style="width:120px;display:inline-block;text-align: right">联系人:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.customerContact}}</div>
</div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">联系地址:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.contactAddress}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">联系电话:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.mobile}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">电子邮箱:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.email}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">信用编码:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.creditCode}}</div>
</div>
<div style="clear:both"></div>
<div v-if="apply.type==\'person\'" style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">身份证号:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.identityCard}}</div>
......
......@@ -192,6 +192,7 @@
applyAddr: "",
zipCode: "100000",
customerContact: "",
contactAddress: "",
mobile: "",
email: "",
businessLicensePic: "",
......@@ -227,6 +228,9 @@
customerContact: [
{ required: true, message: '请输入客户联系人' }
],
contactAddress: [
{ required: true, message: '请输入联系地址' }
],
mobile: [
{ required: true, message: '请输入联系电话' }
],
......@@ -419,6 +423,7 @@
applyAddr: d_apply ? d_apply.applyAddr : "",
zipCode: d_customer ? d_customer.zipCode : "100000",
customerContact: d_customer ? d_customer.customerContact : "",
contactAddress: d_customer ? d_customer.contactAddress : "",
mobile: d_customer ? d_customer.mobile : "",
email: d_customer ? d_customer.email : "",
principal: d_tm.principal ? d_tm.principal : "",
......@@ -944,7 +949,7 @@
identityCardPic2: this.apply.identityCardPic2, principal: this.apply.principal
};
var customer = {
orderNum: this.order.orderNum, zipCode: this.apply.zipCode || "100000", customerContact: this.apply.customerContact, mobile: this.apply.mobile,
orderNum: this.order.orderNum, zipCode: this.apply.zipCode || "100000", customerContact: this.apply.customerContact, contactAddress: this.apply.contactAddress, mobile: this.apply.mobile,
email: this.apply.email
};
var obj = { env: env, tm: tm, apply: apply, customer: customer, nclones: this.nclOne, channelOrderNum: channelOrderNum, channelUserId: channelUserId };
......
......@@ -265,6 +265,13 @@
<el-input v-model="apply.customerContact"></el-input>
</el-form-item>
<div style="clear:both;"></div>
<el-form-item label-width="140px" label="联系地址" style="width:950px;float:left;padding-right:50px;"
prop="contactAddress">
<el-input v-model="apply.contactAddress"></el-input>
</el-form-item>
<div style="clear:both;"></div>
<el-form-item label-width="140px" label="联系电话" style="width:950px;float:left;padding-right:50px;"
prop="mobile">
<el-input v-model="apply.mobile"></el-input>
......@@ -432,20 +439,26 @@
<div style="width:120px;display:inline-block;text-align: right">联系人:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.customerContact}}</div>
</div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">联系地址:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.contactAddress}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">联系电话:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.mobile}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">电子邮箱:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.email}}</div>
</div>
<div style="clear:both"></div>
<div style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">信用编码:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.creditCode}}</div>
</div>
<div style="clear:both"></div>
<div v-if="apply.type==\'person\'" style="width: 35%;margin-bottom: 5px;display:inline-block;">
<div style="width:120px;display:inline-block;text-align: right">身份证号:</div>
<div style="display:inline-block;padding-left:10px;">{{apply.identityCard}}</div>
......
......@@ -199,6 +199,7 @@
applyAddr: "",
zipCode: "100000",
customerContact: "",
contactAddress: "",
mobile: "",
email: "",
businessLicensePic: "",
......@@ -234,6 +235,9 @@
customerContact: [
{ required: true, message: '请输入客户联系人' }
],
contactAddress: [
{ required: true, message: '请输入联系地址' }
],
mobile: [
{ required: true, message: '请输入联系电话' }
],
......@@ -390,6 +394,7 @@
that.channelOrder = data;
that.apply.applyName = data.order_company_name || "";
that.apply.customerContact = data.customer_name || "";
that.apply.contactAddress = data.customer_address || "";
that.apply.mobile = data.customer_phone || "";
that.apply.email = data.customer_email;
if (data.order_company_name) {
......
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