|
@@ -355,13 +355,25 @@ module.exports = app => {
|
|
|
* 拷贝标段数据至当前标段
|
|
|
* @param {number} id - 当前标段id
|
|
|
* @param {number} copy_id - 被拷贝的标段id
|
|
|
+ * @param {Array} typeArr - 需要拷贝的类型数组
|
|
|
*/
|
|
|
- async copyTenderHandler(id, copy_id) {
|
|
|
+ async copyTenderHandler(id, copy_id, typeArr) {
|
|
|
+ const columns = [];
|
|
|
+ typeArr.forEach(item => {
|
|
|
+ if (item === 'tender') {
|
|
|
+ columns.push('deal_info', 'construction_unit', 'tech_param');
|
|
|
+ } else if (item === 'chapter') {
|
|
|
+ columns.push('chapter');
|
|
|
+ } else if (item === 'pay_account') {
|
|
|
+ columns.push('pay_account');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!columns.length) throw '未选择需要拷贝的设置';
|
|
|
const [data] = await this.getAllDataByCondition({
|
|
|
where: {
|
|
|
tid: copy_id,
|
|
|
},
|
|
|
- columns: ['deal_info', 'construction_unit', 'tech_param', 'chapter', 'pay_account'],
|
|
|
+ columns,
|
|
|
});
|
|
|
const isUpdate = await this.update(data, { tid: id });
|
|
|
if (isUpdate) {
|