|
@@ -957,7 +957,7 @@ module.exports = app => {
|
|
|
*/
|
|
|
async getValidChanges(tid, bills, pos) {
|
|
|
const self = this;
|
|
|
- const getFilterPart = function (field, value) {
|
|
|
+ const getFilterPart = function(field, value) {
|
|
|
return value
|
|
|
? field + ' = ' + self.db.escape(value)
|
|
|
: self.db.format("(?? = null or ?? = '')", [field, field]);
|
|
@@ -1308,6 +1308,28 @@ module.exports = app => {
|
|
|
const content = await this.db.query(noticeSql, noticeSqlParam);
|
|
|
return content.length ? JSON.stringify(content[0]) : '';
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前标段其他变更令
|
|
|
+ * @param {Number} tid - 标段id
|
|
|
+ * @param {Number} cid - 当前变更令
|
|
|
+ */
|
|
|
+ async getOthersChange(tid, cid) {
|
|
|
+ const sql = 'SELECT * FROM ?? WHERE tid = ? AND cid != ? ORDER BY ? desc ';
|
|
|
+ const sqlParam = [this.tableName, tid, cid, 'in_time'];
|
|
|
+ return await this.db.query(sql, sqlParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 拷贝变更令至当前变更令
|
|
|
+ * @param {String} cid - 当前变更令
|
|
|
+ * @param {String} copy_cid - 要拷贝的变更令
|
|
|
+ */
|
|
|
+ async handleCopyChange(cid, copy_cid) {
|
|
|
+ const change = await this.getDataByCondition({ cid });
|
|
|
+ const copyChange = await this.getDataByCondition({ cid: copy_cid });
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return Change;
|