소스 검색

FEAT: 修改

xdd 4 일 전
부모
커밋
d24fcd8adc
1개의 변경된 파일28개의 추가작업 그리고 2개의 파일을 삭제
  1. 28 2
      src/views/store/prescribe/index.vue

+ 28 - 2
src/views/store/prescribe/index.vue

@@ -144,7 +144,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="handleDoctorUpdate">确 定</el-button>
-        <el-button type="danger" @click="handleDoctorUpdate">拒 绝</el-button>
+        <el-button type="danger" @click="handleDoctorRefuse">拒 绝</el-button>
         <el-button @click="handleDoctorDealCancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -349,10 +349,36 @@ export default {
       this.editForm.diagnose = null;
       this.show.doctorOpen = false;
     },
+    handleDoctorRefuse() {
+      this.$refs['editForm'].validate(valid => {
+        if (valid) {
+          this.$confirm('是否确认拒绝开方?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            let updateData = {...this.form, chiefComplaint: this.editForm.chiefComplaint, diagnose: this.editForm.diagnose, status: 2}
+            updatePrescribe(updateData).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("拒绝开方成功");
+                this.show.doctorOpen = false;
+                this.getList();
+                this.form = {};
+              }
+            });
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消拒绝'
+            });
+          });
+        }
+      });
+    },
     handleDoctorUpdate(){
       this.$refs['editForm'].validate(valid => {
         if(valid) {
-          let updateData = {...this.form,chiefComplaint: this.editForm.chiefComplaint,diagnose: this.editForm.diagnose}
+          let updateData = {...this.form,chiefComplaint: this.editForm.chiefComplaint,diagnose: this.editForm.diagnose,status: 1}
           updatePrescribe(updateData).then(response => {
             if (response.code === 200) {
               this.msgSuccess("修改成功");