`前加入: ```html ``` `package.json`中`"test": "npm run lint",`后加入`"dll": "webpack -p --progress --config build/webpack.dll.conf.js"`。 这样运行`npm run build`之前先运行一次`npm run dll`,以后每次修改后直接运行`npm run build`可加快编译。 效果: 优化前编译耗时127秒 ![截屏2022-02-26 19.24.53.png](https://dt27.cn/usr/uploads/2022/02/1949680940.png) 优化后67秒 ![截屏2022-02-26 19.23.41.png](https://dt27.cn/usr/uploads/2022/02/311320325.png) 3. 一个Bug,合同及回款无审批流时,状态会被设置为7,应该改回2,不然很多关联的地方会出问题,比如合同列表不显示回款金额。 `application/crm/controller/Contract.php`122行7改为2: ```php $param['check_status'] = 7; ``` `application/crm/controller/Receivables.php`154行,7改为2: ```php $param['check_status'] = 7; ``` 4. 合同任何时候均可编辑(仅适用于无需审批流的业务) 找到`application/crm/controller/Contract.php`文件,注释掉以下代码(218-220行): ```php if (!in_array($dataInfo['check_status'], ['3', '4', '5', '6', '7']) && $dataInfo['check_status']!=0) { return resultArray(['error' => '当前状态为审批中或已审批通过,不可编辑']); } ``` 前端文件`src/views/crm/contract/Detail.vue`,将以下代码(331-339行): ```javascript if (this.detailData.check_status === 2) { this.$message.error('已通过的合同作废后才可编辑') return false } else if (this.detailData.check_status === 1) { this.$message.error('审核中的合同撤回后才可编辑') return false } else { this.createAction = { type: 'update', id: this.id, batchId: this.detailData.batchId } } ``` 修改为: ```javascript this.createAction = { type: 'update', id: this.id, batchId: this.detailData.batchId } ``` 5. 回款任何时候均可编辑(仅适用于无需审批流的业务) 找到`application/crm/controller/Receivables.php`文件,注释掉以下代码(230-232行): ```php if (!in_array($dataInfo['check_status'], ['3', '4', '5', '6', '7']) && $dataInfo['check_status']!=0) { return resultArray(['error' => '当前状态为审批中或已审批通过,不可编辑']); } ``` 前端文件`src/views/crm/contract/Detail.vue`,将以下代码(331-339行): ```javascript if (this.detailData.check_status === 2) { this.$message.error('已通过的合同作废后才可编辑') return false } else if (this.detailData.check_status === 1) { this.$message.error('审核中的合同撤回后才可编辑') return false } else { this.createAction = { type: 'update', id: this.id, batchId: this.detailData.batchId } } ``` 修改为: ```javascript this.createAction = { type: 'update', id: this.id, batchId: this.detailData.batchId } ``` 6. 多端登录 悟空CRM频繁提示`你已被登出,请重新登录`,解决方法很简单, `application/admin/model/User.php`文件,636行注释掉: ```php //删除旧缓存 if (Cache::get('Auth_' . $userInfo['authkey'] . $platform)) { // 解决无法多端登录 By DT27@2022-02-26 // Cache::rm('Auth_' . $userInfo['authkey'] . $platform); } ```