:qx
qx
2 天以前 6d4e9ccb34e0292bfadba7bfd678231cb37ae8c0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<template>
  <div class="app-container">
    <el-row :gutter="24">
      <el-col :span="19">
        <div class="grid-content bg-purple">
          <el-form style="margin: 10px 8px" :inline="true" ref="form" :model="form"
            class="demo-form-inline" :disabled="isDisabled">
          </el-form>
        </div>
      </el-col>
    </el-row>
 
 
      <el-col :span="6">
        <div class="grid-content bg-purple" style="margin: 0 10px">
          <el-table v-loading="loading" :data="newpacName"  height="520"
            ref="tb">
            <el-table-column type="selection" width="55" align="center" label="选择" />
            <el-table-column label="套餐名称" align="center" prop="pacName" />
            <el-table-column label="套餐详情" align="center" prop="proName">
              <template slot-scope="scope">
                <el-button size="mini" type="text" @click="handleSeach(scope.row)"
                  v-hasPermi="['system:package:Seach']">套餐详情
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-col>
 
  
    <!-- 套餐详情 --> 
    <el-dialog :visible.sync="Seachopen" width="500px" append-to-body>
      <template>
        <el-checkbox v-for="item in allpackageList" :label="item.proName"
          :key="item.proId" disabled>{{ item.proName }}</el-checkbox>
 
        <div slot="footer" class="dialog-footer">
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
  
<script>
import { listCustomer, addCustomer } from "@/api/hosp/customer";
import { deptTreeSelect, projectGetList, getOrder, getCusIdcard } from "@/api/system/tijian";
import { getAllPackage } from "@/api/system/package";
 
 
 
export default {
  dicts: [
    "dict_user_national",
    "dict_user_marry",
    "sys_yes_no",
    "sys_user_sex",
  ],
  name: "Tijian",
  data() {
    return {
      imageUrl: "",
      isDisabled: false,
      size: "",
      tcShow: false,
      // 套餐提交按钮
      confirm:false,
      TotalPrice: 0,
      TotalPrice1: 0,
      discount: 100,
      newpacName: [],
      // 所有体检项目·
      allpackageList: [],
      tjProjectList: [],
      customerList: [],
      // 表格
      tableData: [],
      DataList: [],
      tjOrderList: [], //单个项目集合
      tjFlowingWater: {},
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 是否显示弹出层
      Seachopen: false,
      // 树状形状
      data: [],
      defaultProps: {
        children: "tjProjectList",
        label: "proName",
      },
 
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        cusName: null,
        cusSex: null,
        cusBrithday: null,
        cusAddr: null,
        cusPhone: null,
        cusPostcode: null,
        cusEmail: null,
        indexCard: null,
        cusNational: null,
        cusMarryStatus: null,
        cusIdcard: null,
        cusIntroduce: null,
        cusNumber: null,
        cusIsvip: null,
      },
 
      // 表单参数
      form: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询客户信息列表 */
    getList() {
      this.loading = true;
      listCustomer(this.queryParams).then((response) => {
        this.customerList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      //全部套餐
      deptTreeSelect().then((response) => {
        this.newpacName = response.rows;
      });
 
    },
    // 表单重置
    reset() {
      this.form = {
        cusId: null,
        cusName: null,
        cusSex: null,
        cusBrithday: null,
        cusAddr: null,
        cusPhone: null,
        cusPassword: null,
        cusPostcode: null,
        cusEmail: null,
        indexCard: null,
        cusNational: null,
        cusMarryStatus: null,
        cusIdcard: null,
        cusIntroduce: null,
        cusNumber: null,
        cusIsvip: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        deleted: null,
      };
      this.resetForm("form");
    },
    // 套餐详情
    handleSeach(row) {
      this.pacId = row.pacId;
      this.Seachopen = true;
      this.loading = true;
      const pacId = row.pacId;
      let data = {
        pacId: pacId,
      };
      getAllPackage(data).then((response) => {
        this.allpackageList = response.data;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.Seachopen = false;
    },
    // 最后提交按钮
    submitPrice() {
      let _this = this;
      let List = this.DataList; //单个项目信息
      let userId = this.form.cusId
      //tjOrderList//这个是处理完的每一项套餐信息
      List.forEach((item) => {
        this.tjOrderList.push({
          proName: item.proName,
          proPrice: item.proPrice,
          proId: item.proId,
          proType: item.flag
        });
      });
      let copeWith = this.TotalPrice + this.TotalPrice1;
      let paidIn = copeWith * (this.discount / 100);
      let discount = this.discount
      this.tjFlowingWater = { copeWith, paidIn, discount }
      let data = { tjOrderList: this.tjOrderList, tjFlowingWater: this.tjFlowingWater, userId };
      getOrder(data).then((res) => {
        this.$modal.msgSuccess("提交成功");
        _this.confirm = true
      })
      
    },
  },
};
</script>
 
 
<style >
 
</style>