diff --git a/src/views/construction-person/face-query/components/rightTable.vue b/src/views/construction-person/face-query/components/rightTable.vue index df7146a..3ae99c8 100644 --- a/src/views/construction-person/face-query/components/rightTable.vue +++ b/src/views/construction-person/face-query/components/rightTable.vue @@ -572,24 +572,44 @@ export default { * 设计决策:使用 unSendPersonIds 作为提交参数,因为表单绑定的是该字段 */ handleSendDownSubmit() { - this.$refs.sendDownFormRef.validate((valid) => { - if (valid) { - const params = { - deviceCode: this.macNo, - workerIds: this.sendDownFormData.unSendPersonIds, - } - sendDownAPI(params) - .then((res) => { - if (res.code === 200) { - this.$modal.msgSuccess('下发成功') - this.handleCloseSendDownDialog() - // this.handleRefresh() - this.getTableList() - } - }) - .catch(() => {}) + if (this.sendDownFormData.sentPersonIds.length > 0) { + const params = { + deviceCode: this.macNo, + workerIds: [ + ...this.sendDownFormData.sentPersonIds, + ...this.sendDownFormData.unSendPersonIds, + ], } - }) + sendDownAPI(params) + .then((res) => { + if (res.code === 200) { + this.$modal.msgSuccess('下发成功') + this.handleCloseSendDownDialog() + // this.handleRefresh() + this.getTableList() + } + }) + .catch(() => {}) + } else { + this.$refs.sendDownFormRef.validate((valid) => { + if (valid) { + const params = { + deviceCode: this.macNo, + workerIds: this.sendDownFormData.unSendPersonIds, + } + sendDownAPI(params) + .then((res) => { + if (res.code === 200) { + this.$modal.msgSuccess('下发成功') + this.handleCloseSendDownDialog() + // this.handleRefresh() + this.getTableList() + } + }) + .catch(() => {}) + } + }) + } }, // 关闭配置弹框 handleCloseConfigDialog() {