You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

454 lines
16 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <el-card>
  4. <div class="publiccss">会员卡记账</div>
  5. <div style="display: flex;margin-top:20px">
  6. <div :style="'display: block; width:' + (window.pageWidth - 120 - 70) + 'px;'">
  7. <div style="display: flex; flex-wrap: wrap; height:80px;">
  8. <div class="query">
  9. <span>记账日期</span>
  10. <el-date-picker v-model="query.dateRange" type="daterange" align="right" unlink-panels range-separator=""
  11. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small"
  12. style="width: 240px">
  13. </el-date-picker>
  14. </div>
  15. <div class="query">
  16. <span>记账标志</span>
  17. <el-select v-model="query.billFlag" placeholder="请选择" filterable clearable size="small" style="width: 100px">
  18. <el-option v-for="item in dict.billFlag" :key="item.id" :label="item.displayName" :value="item.id" />
  19. </el-select>
  20. </div>
  21. <div class="query">
  22. <span>支付方式</span>
  23. <el-select v-model="query.payModeId" placeholder="请选择" filterable clearable size="small" style="width: 100px">
  24. <el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" />
  25. </el-select>
  26. </div>
  27. <div class="query">
  28. <span>卡号</span>
  29. <el-input placeholder="卡号" v-model="query.cardNo" size="small" clearable style="width: 150px" />
  30. </div>
  31. <div class="query">
  32. <span>卡主姓名</span>
  33. <el-input placeholder="卡主姓名" v-model="query.customerName" size="small" clearable style="width: 100px" />
  34. </div>
  35. <div class="query">
  36. <span>身份证号</span>
  37. <el-input placeholder="身份证号" v-model="query.idNo" size="small" clearable style="width: 200px" />
  38. </div>
  39. <div class="query">
  40. <span>手机号</span>
  41. <el-input placeholder="手机号" v-model="query.mobileTelephone" size="small" clearable style="width: 150px" />
  42. </div>
  43. </div>
  44. <el-table :data="dataList" border width="100%" :height="window.pageHeight < 600 ? 370 : window.pageHeight - 230"
  45. row-key="id" size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange"
  46. @row-click="rowClick">
  47. <el-table-column prop="cardNo" label="会员卡号" width="150" />
  48. <el-table-column prop="customerName" label="卡主姓名" width="80" />
  49. <el-table-column prop="mobileTelephone" label="手机号" width="150" />
  50. <el-table-column prop="payModeId" label="支付方式" width="100">
  51. <template slot-scope="scope">
  52. <div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="billMoney" label="记账金额" width="80" />
  56. <el-table-column prop="billFlag" label="记账标志" width="100">
  57. <template slot-scope="scope">
  58. <div>{{ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName") }}</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column prop="creatorId" label="创建人员" width="100" />
  62. <el-table-column prop="creationTime" label="创建日期" width="150">
  63. <template slot-scope="scope">
  64. <div v-if="scope.row.creationTime">
  65. {{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}
  66. </div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="lastModifierId" label="修改人员" width="100" />
  70. <el-table-column prop="lastModificationTime" label="修改日期" width="150">
  71. <template slot-scope="scope">
  72. <div v-if="scope.row.lastModificationTime">
  73. {{ moment(scope.row.lastModificationTime).format("yyyy-MM-DD") }}
  74. </div>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. </div>
  79. <div style=" margin-left: 10px;width:110px;">
  80. <div class="listBtn">
  81. <el-button class="btnClass" @click="btnQuery">查询</el-button>
  82. </div>
  83. <div class="listBtn">
  84. <el-button type="success" class="btnClass" @click="add">新增</el-button>
  85. </div>
  86. <div class="listBtn">
  87. <el-button type="primary" class="btnClass" @click="edit">编辑</el-button>
  88. </div>
  89. <div class="listBtn">
  90. <el-button type="danger" class="btnClass" @click="edit">删除</el-button>
  91. </div>
  92. </div>
  93. </div>
  94. </el-card>
  95. <el-dialog :title="form.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="800px" :close-on-click-modal="false">
  96. <el-form ref="form" :model="form" label-width="100px" :rules="rules" size="small">
  97. <el-row>
  98. <el-col :span="8">
  99. <el-form-item label="卡类别" prop="cardTypeId">
  100. <el-select v-model="form.cardTypeId" placeholder="请选择" filterable>
  101. <el-option v-for="item in dict.cardType" :key="item.id" :label="item.displayName" :value="item.id" />
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="8">
  106. <el-form-item label="会员卡号" prop="cardNo">
  107. <el-input v-model="form.cardNo" />
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="8">
  111. <el-form-item label="折扣率" prop="discount">
  112. <el-input type="number" v-model="form.discount" />
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. <el-row>
  117. <el-col :span="8">
  118. <el-form-item label="有效期限" prop="expiryDate">
  119. <el-input type="date" v-model="form.expiryDate" />
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="8">
  123. <el-form-item label="卡主姓名" prop="customerName">
  124. <el-input v-model="form.customerName" />
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="8">
  128. <el-form-item label="卡主身份证" prop="idNo">
  129. <el-input v-model="form.idNo" />
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <el-col :span="8">
  135. <el-form-item label="卡主电话" prop="telephone">
  136. <el-input type="tel" v-model="form.telephone" />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="卡主手机号" prop="mobileTelephone">
  141. <el-input type="tel" v-model="form.mobileTelephone" />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="8">
  145. <el-form-item label="启用" prop="cardFlag">
  146. <el-radio v-model="form.cardFlag" label="1"></el-radio>
  147. <el-radio v-model="form.cardFlag" label="0"></el-radio>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <el-row>
  152. <el-col :span="24">
  153. <el-form-item label="备注" prop="remark">
  154. <el-input v-model="form.remark" />
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. <el-row>
  159. <el-col :span="6">
  160. <el-form-item label="创建人员" label-width="80px">
  161. <el-input v-model="form.creatorId" disabled></el-input>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="6">
  165. <el-form-item label="创建时间" label-width="80px">
  166. <el-input :value="form.creationTime ? moment(form.creationTime).format('yyyy-MM-DD') : ''"
  167. disabled></el-input>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="6">
  171. <el-form-item label="修改人员" label-width="80px">
  172. <el-input v-model="form.lastModifierId" disabled></el-input>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="6">
  176. <el-form-item label="修改时间" label-width="80px">
  177. <el-input :value="form.lastModificationTime
  178. ? moment(form.lastModificationTime).format('yyyy-MM-DD') : ''" disabled></el-input>
  179. </el-form-item>
  180. </el-col>
  181. </el-row>
  182. </el-form>
  183. <div slot="footer" class="dialog-footer">
  184. <el-button type="primary" @click="onSubmit('form')">确定</el-button>
  185. <el-button @click="dialogVisible = false">关闭</el-button>
  186. </div>
  187. </el-dialog>
  188. </div>
  189. </template>
  190. <script>
  191. import moment from "moment";
  192. import { mapState, mapActions } from "vuex";
  193. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  194. import { dddw, objCopy, arrayReduce, arrayExistObj } from "@/utlis/proFunc";
  195. export default {
  196. components: {
  197. },
  198. data() {
  199. return {
  200. query: {
  201. dateType:'createDate',
  202. dateType:'createDate',
  203. }, //查询条件
  204. dataList: [], //列表数据
  205. multipleSelection: [], //选中的数据列表
  206. dialogVisible: false,
  207. form: {
  208. id: null,
  209. cardTypeId: null,
  210. cardNo: '',
  211. discount: 100,
  212. expiryDate: null,
  213. customerName: '',
  214. idNo: '',
  215. telephone: '',
  216. mobileTelephone: '',
  217. cardFlag: '0',
  218. remark: '',
  219. },
  220. formInit: {},
  221. rules: {
  222. cardTypeId: [
  223. { required: true, message: "请填写卡类别", trigger: "blur" },
  224. ],
  225. cardNo: [
  226. { required: true, message: "请填写卡号", trigger: "blur" },
  227. ],
  228. discount: [
  229. { required: true, message: "请填写卡折扣", trigger: "blur" },
  230. ],
  231. expiryDate: [
  232. { required: true, message: "请填写卡有效期", trigger: "blur" },
  233. ],
  234. customerName: [
  235. { required: true, message: "请填写卡主姓名", trigger: "blur" },
  236. ],
  237. idNo: [
  238. { required: true, message: "请填写卡主身份证", trigger: "blur" },
  239. ],
  240. mobileTelephone: [
  241. { required: true, message: "请填写卡主身份证", trigger: "blur" },
  242. ],
  243. cardFlag: [
  244. { required: true, message: "请填写卡启用状态", trigger: "blur" },
  245. ]
  246. },
  247. curChoosedRow: {}, //当前选择的行数据
  248. pickerOptions: {
  249. shortcuts: [
  250. {
  251. text: "最近一周",
  252. onClick(picker) {
  253. const end = new Date();
  254. const start = new Date();
  255. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  256. picker.$emit("pick", [start, end]);
  257. },
  258. },
  259. {
  260. text: "最近一个月",
  261. onClick(picker) {
  262. const end = new Date();
  263. const start = new Date();
  264. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  265. picker.$emit("pick", [start, end]);
  266. },
  267. },
  268. {
  269. text: "最近三个月",
  270. onClick(picker) {
  271. const end = new Date();
  272. const start = new Date();
  273. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  274. picker.$emit("pick", [start, end]);
  275. },
  276. },
  277. ],
  278. },
  279. };
  280. },
  281. created() {
  282. this.formInit = { ...this.form };
  283. },
  284. //挂载完成
  285. mounted() {
  286. this.dicInit();
  287. },
  288. computed: {
  289. ...mapState(["window", "dict"]),
  290. },
  291. methods: {
  292. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  293. dddw, moment,
  294. handleSelectionChange(val) {
  295. this.multipleSelection = val;
  296. },
  297. rowClick(row) {
  298. this.curChoosedRow = row;
  299. },
  300. add() {
  301. this.form = { ...this.formInit };
  302. this.dialogVisible = true;
  303. },
  304. edit() {
  305. if (!this.curChoosedRow.id) {
  306. this.$message.warning("请先选择要操作的数据!");
  307. return;
  308. }
  309. this.form = { ...this.curChoosedRow };
  310. this.dialogVisible = true;
  311. },
  312. del() {
  313. let lfind = -1;
  314. if (!this.curChoosedRow.id) {
  315. this.$message.warning("请先选择要操作的数据!");
  316. return;
  317. }
  318. //执行删除操作
  319. lfind = arrayExistObj(this.dataList, 'id', this.curChoosedRow.id);
  320. if (lfind > - 1) this.dataList.splice(lfind, 1);
  321. this.curChoosedRow.id = null;
  322. },
  323. //按条码号查个人数据
  324. signByPatientRegisterNo() {
  325. let val = this.form.patientRegisterNo
  326. console.log(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
  327. getapi(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
  328. .then((res) => {
  329. if (res.code != -1) {
  330. if (res.data) {
  331. this.signCore([res.data.id])
  332. this.form.patientRegisterNo = ''
  333. }
  334. }
  335. });
  336. },
  337. //提交
  338. onSubmit(formName) {
  339. this.$refs[formName].validate((valid, fields) => {
  340. if (!valid) {
  341. //console.log('fields',fields,Object.keys(fields));
  342. this.$message.error(fields[Object.keys(fields)[0]][0].message);
  343. return;
  344. }
  345. //编辑
  346. if (this.form.id) {
  347. } else {
  348. //新增
  349. }
  350. });
  351. },
  352. //查询
  353. btnQuery() {
  354. let body = {}
  355. console.log(`this.patientRegister.query`, this.patientRegister.query)
  356. if (this.patientRegister.query.customerOrgFlag) {
  357. if (this.patientRegister.query.CustomerOrgParentId) {
  358. body.customerOrgId = this.patientRegister.query.CustomerOrgParentId
  359. } else {
  360. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId
  361. }
  362. }
  363. if (this.patientRegister.query.sex) body.sexId = this.patientRegister.query.sex
  364. if (this.patientRegister.query.patientName) body.patientName = this.patientRegister.query.patientName
  365. if (this.patientRegister.query.completeFlag) body.completeFlag = this.patientRegister.query.completeFlag
  366. //StartDate EndDate
  367. if (this.patientRegister.query.dateRange) {
  368. body.startDate = moment(new Date(this.patientRegister.query.dateRange[0])).format("yyyy-MM-DD")
  369. body.endDate = moment(new Date(this.patientRegister.query.dateRange[1])).format("yyyy-MM-DD")
  370. }
  371. if (this.patientRegister.query.idCardNo) body = { idNo: this.patientRegister.query.idCardNo }
  372. if (this.patientRegister.query.patientNo) body = { patientNo: this.patientRegister.query.patientNo }
  373. if (this.patientRegister.query.patientRegisterNo) body = { patientRegisterNo: this.patientRegister.query.patientRegisterNo }
  374. console.log('/api/app/patientregister/getlistinfilter', body)
  375. postapi('/api/app/patientregister/getlistinfilter', body)
  376. .then((res) => {
  377. this.dataList = res.data;
  378. });
  379. },
  380. dicInit(){
  381. //支付方式
  382. getapi("/api/app/pay-mode").then((res) => {
  383. if (res.code == 1) {
  384. this.dict.payMode = res.data;
  385. }
  386. });
  387. }
  388. },
  389. //监听事件
  390. watch: {
  391. //触发查询事件
  392. "patientRegister.query.times"(newVal, oldVal) {
  393. if (newVal != oldVal) {
  394. //alert('触发查询事件')
  395. this.query();
  396. }
  397. },
  398. },
  399. };
  400. </script>
  401. <style scoped>
  402. .query {
  403. margin-left: 10px;
  404. }
  405. .listBtn {
  406. margin-top: 20px;
  407. }
  408. .btnClass {
  409. width: 110px;
  410. text-align: center;
  411. }
  412. .btnClass {
  413. width: 110px;
  414. }
  415. </style>