index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <a-card title="总体概况">
  3. <template #extra>
  4. <a-button type="primary" @click="open">
  5. <template #icon><setting-outlined /></template>
  6. 参数设置
  7. </a-button>
  8. </template>
  9. <a-row :gutter="32" style="margin-bottom: 10px">
  10. <a-col :span="6">
  11. <div class="box">
  12. <div class="box_num">{{whole.count}}</div>
  13. <div class="box_title">今日洗消</div>
  14. </div>
  15. </a-col>
  16. <a-col :span="6">
  17. <div class="box">
  18. <div class="box_num" style="color: #2ECD7A">{{whole.count1}}</div>
  19. <div class="box_title">今日合格</div>
  20. </div>
  21. </a-col>
  22. <a-col :span="6">
  23. <div class="box">
  24. <div class="box_num" style="color: #F7050E">{{whole.count2}}</div>
  25. <div class="box_title">今日异常</div>
  26. </div>
  27. </a-col>
  28. <a-col :span="6">
  29. <div class="box">
  30. <div class="box_num" style="color: #698DF7">{{whole.rank}}%</div>
  31. <div class="box_title">洗消合格率</div>
  32. </div>
  33. </a-col>
  34. </a-row>
  35. <a-card title="洗消数量曲线" style="margin-bottom: 10px">
  36. <template #extra>
  37. <div class="pcrForm">
  38. <a-form>
  39. <a-row :gutter="16" align="middle">
  40. <a-col :span="12">
  41. <a-form-item label="类型">
  42. <a-select v-model:value="personType" allow-clear>
  43. <a-select-option v-for="item in personList" :key="item.value" :value="item.value">{{item.text}}</a-select-option>
  44. </a-select>
  45. </a-form-item>
  46. </a-col>
  47. <a-col :span="12">
  48. <a-form-item label="日期">
  49. <a-select v-model:value="type">
  50. <a-select-option v-for="item in typeList" :key="item.id" :value="item.id">{{item.label}}</a-select-option>
  51. </a-select>
  52. </a-form-item>
  53. </a-col>
  54. </a-row>
  55. </a-form>
  56. </div>
  57. </template>
  58. <div class="chart_content">
  59. <chart-pcr v-if="lineChart.length > 0" :id="2" :list="lineChart"></chart-pcr>
  60. <a-empty v-else style="padding-top: 100px" />
  61. </div>
  62. </a-card>
  63. <a-card>
  64. <a-form>
  65. <a-row :gutter="16">
  66. <a-col :span="4">
  67. <a-form-item label="来访类型">
  68. <a-select v-model:value="comeId">
  69. <a-select-option v-for="item in personList" :key="item.value" :value="item.value">{{item.text}}</a-select-option>
  70. </a-select>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :span="4">
  74. <a-form-item label="目的地">
  75. <a-select v-model:value="destId" :disabled="destList.length === 0">
  76. <a-select-option v-for="item in destList" :key="item.id" :value="item.id">{{item.locationName}}</a-select-option>
  77. </a-select>
  78. </a-form-item>
  79. </a-col>
  80. <a-col :span="6">
  81. <a-form-item label="来访时间">
  82. <a-range-picker v-model:value="dateTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD" />
  83. </a-form-item>
  84. </a-col>
  85. <a-col :span="4">
  86. <a-space>
  87. <a-button type="primary" @click="table.refresh(true)">查询</a-button>
  88. <a-button @click="reset">重置</a-button>
  89. <!-- <a-button type="primary" @click="derive">导出</a-button>-->
  90. </a-space>
  91. </a-col>
  92. </a-row>
  93. </a-form>
  94. <s-table
  95. ref="table"
  96. :columns="columns"
  97. :data="loadData"
  98. :expand-row-by-click="true"
  99. :alert="options.alert.show"
  100. bordered
  101. :row-key="(record) => record.id"
  102. :row-selection="options.rowSelection"
  103. @resizeColumn="(w, col) => {
  104. col.width = w
  105. }"
  106. >
  107. <template #operator class="table-operator">
  108. <a-space>
  109. <xn-batch-delete :selectedRowKeys="selectedRowKeys" @batchDelete="deleteAll" />
  110. </a-space>
  111. </template>
  112. <template #bodyCell="{ column, record }">
  113. <template v-if="column.dataIndex === 'vistitType'">
  114. <a-tag color="#2db7f5">
  115. <template v-if="record.vistitType === 0">人员</template>
  116. <template v-else-if="record.vistitType === 1">环保车</template>
  117. <template v-else-if="record.vistitType === 2">拉猪车</template>
  118. <template v-else-if="record.vistitType === 3">饲料车</template>
  119. <template v-else-if="record.vistitType === 4">送猪车</template>
  120. <template v-else-if="record.vistitType === 5">物资</template>
  121. <template v-else-if="record.vistitType === 6">餐车</template>
  122. </a-tag>
  123. </template>
  124. <template v-if="column.dataIndex === 'billStatus'">
  125. <a-tag v-if="record.billStatus === 0" color="#f50">待审核</a-tag>
  126. <a-tag v-else-if="record.billStatus === 1" color="#87d068">审核通过</a-tag>
  127. <a-tag v-else-if="record.billStatus === 2" color="#f50">审核拒绝</a-tag>
  128. <a-tag v-else-if="record.billStatus === 3" color="#87d068">审核通过</a-tag>
  129. </template>
  130. <template v-if="column.dataIndex === 'action'">
  131. <a-popconfirm title="删除此消息吗?" @confirm="del(record)">
  132. <a-button type="link" danger size="small">删除</a-button>
  133. </a-popconfirm>
  134. </template>
  135. </template>
  136. </s-table>
  137. </a-card>
  138. </a-card>
  139. <Form ref="formRef"></Form>
  140. </template>
  141. <script setup name="washing">
  142. import chartPcr from '../chart/chartPcr.vue'
  143. import Form from './form.vue'
  144. import washEntranceApi from "@/api/wash/washEntranceApi";
  145. const formRef = ref()
  146. const open = () => {
  147. formRef.value.onOpen()
  148. }
  149. // 总体概况
  150. const whole = ref({
  151. count: 0,
  152. count1: 0,
  153. count2: 0,
  154. rank: 0
  155. })
  156. const init = () => {
  157. let params = {
  158. dataType: 1
  159. }
  160. washEntranceApi.getWashingWhole(params).then((res) => {
  161. whole.value = res
  162. })
  163. }
  164. const personType = ref('')
  165. const personList = ref([
  166. {
  167. value: 0,
  168. text: '人员'
  169. },
  170. {
  171. value: 1,
  172. text: '环保车'
  173. },
  174. {
  175. value: 3,
  176. text: '饲料车'
  177. },
  178. {
  179. value: 4,
  180. text: '送猪车'
  181. },
  182. {
  183. value: 5,
  184. text: '物资'
  185. },
  186. ])
  187. const type = ref(2)
  188. const typeList = ref([
  189. {
  190. id: 1,
  191. label: '今日'
  192. },
  193. {
  194. id: 2,
  195. label: '本周'
  196. },
  197. {
  198. id: 3,
  199. label: '本月'
  200. },
  201. ])
  202. const lineChart = ref([])
  203. const initLineChart = () => {
  204. let params = {
  205. personType: personType.value,
  206. type: type.value,
  207. dataType: 1
  208. }
  209. washEntranceApi.getWashingLineChart(params).then((res) => {
  210. lineChart.value = res
  211. })
  212. }
  213. watch(type, () => {
  214. initLineChart()
  215. })
  216. watch(personType, () => {
  217. initLineChart()
  218. })
  219. const comeId = ref('')
  220. const destId = ref('')
  221. const destList = ref([])
  222. const dateTime = ref([])
  223. const initLocation = () => {
  224. let params = {
  225. vistitType: comeId.value
  226. }
  227. washEntranceApi.getLocationList(params).then(res => {
  228. destList.value = res
  229. })
  230. }
  231. watch(comeId, () => {
  232. destId.value = ''
  233. destList.value = []
  234. initLocation()
  235. })
  236. const reset = () => {
  237. comeId.value = ''
  238. destId.value = ''
  239. dateTime.value = []
  240. }
  241. const derive = () => {
  242. }
  243. const table = ref()
  244. const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
  245. const show = ref(true)
  246. const columns = [
  247. {
  248. title: '姓名',
  249. dataIndex: 'admissionUserName',
  250. width: 150,
  251. fixed: true
  252. },
  253. {
  254. title: '来访类型',
  255. dataIndex: 'vistitType',
  256. width: 150,
  257. resizable: true,
  258. ellipsis: true
  259. },
  260. {
  261. title: '手机号',
  262. dataIndex: 'phone',
  263. width: 150,
  264. resizable: true,
  265. ellipsis: true
  266. },
  267. {
  268. title: '车牌号',
  269. dataIndex: 'carNum',
  270. width: 150,
  271. resizable: true,
  272. ellipsis: true
  273. },
  274. {
  275. title: '目的地',
  276. dataIndex: 'destName',
  277. width: 150,
  278. resizable: true,
  279. ellipsis: true
  280. },
  281. {
  282. title: '检测地点',
  283. dataIndex: 'testLocation',
  284. width: 150,
  285. resizable: true,
  286. ellipsis: true,
  287. sorter: true
  288. },
  289. {
  290. title: '检测结果',
  291. dataIndex: 'billStatus',
  292. width: 150,
  293. resizable: true,
  294. ellipsis: true
  295. },
  296. {
  297. title: '操作',
  298. dataIndex: 'action',
  299. width: 200,
  300. fixed: 'right'
  301. }
  302. ]
  303. const selectedRowKeys = ref([])
  304. // 列表选择配置
  305. const options = {
  306. // columns数字类型字段加入 needTotal: true 可以勾选自动算账
  307. alert: {
  308. show: true,
  309. clear: () => {
  310. selectedRowKeys.value = ref([])
  311. }
  312. },
  313. rowSelection: {
  314. onChange: (selectedRowKey, selectedRows) => {
  315. selectedRowKeys.value = selectedRowKey
  316. }
  317. }
  318. }
  319. const loadData = (parameter) => {
  320. let params = {
  321. type: comeId.value,
  322. destId: destId.value,
  323. startTime: dateTime.value.length ? dateTime.value[0] : '',
  324. endTime: dateTime.value.length ? dateTime.value[1] : '',
  325. dataType: 1
  326. }
  327. return washEntranceApi.getWashingTableList(Object.assign(parameter, params)).then((data) => {
  328. return data
  329. })
  330. }
  331. const deleteAll = (params) => {
  332. let l = []
  333. params.forEach(item => {
  334. l.push(item.id)
  335. })
  336. let str = l.join(',')
  337. let data = {
  338. ids: str
  339. }
  340. washEntranceApi.delWashingTableList(data).then(() => {
  341. table.value.clearRefreshSelected()
  342. })
  343. }
  344. const del = (row) => {
  345. let params = {
  346. ids: row.id
  347. }
  348. washEntranceApi.delWashingTableList(params).then(() => {
  349. table.value.refresh(true)
  350. })
  351. }
  352. onMounted(() => {
  353. init()
  354. initLineChart()
  355. })
  356. </script>
  357. <style scoped>
  358. .box {
  359. width: 100%;
  360. height: 180px;
  361. border: 1px solid #797979;
  362. border-radius: 10px;
  363. text-align: center;
  364. box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  365. }
  366. .box_num {
  367. font-size: 48px;
  368. padding-top: 20px;
  369. padding-bottom: 10px;
  370. }
  371. .box_title {
  372. font-size: 24px;
  373. }
  374. .chart_content {
  375. width: 100%;
  376. height: 400px;
  377. }
  378. .pcrForm {
  379. width: 360px;
  380. }
  381. </style>