倚楼听风雨 3 роки тому
батько
коміт
a02c4c8761

+ 10 - 11
cool-admin-midway-master/src/app/modules/shuyou/service/rent_computer.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-09-16 23:31:48
+ * @LastEditTime: 2022-09-17 22:27:10
  * @Description:
  * @FilePath: \cool-admin-3.x\cool-admin-midway-master\src\app\modules\shuyou\service\rent_computer.ts
  */
@@ -68,19 +68,15 @@ export class ShuyouRentComputerService extends BaseService {
     if (info) {
       const taskIds = await this.nativeQuery(
         `select 
-          a.task_id,
-          b.task_name
+          task_id
         from 
-          shuyou_rent_computer_usage a
-          LEFT JOIN shuyou_game_task b ON a.task_id = b.id
-        where a.pc_num = ?`,
+          shuyou_rent_computer_usage
+        where pc_num = ?`,
         [info.pc_num]
       );
       if (taskIds) {
         info.taskIdList = taskIds.map(e => {
-          // item.id+' [ '+item.task_name+' ] '
-          return (e.task_id);
-          // return (e.task_id +' [ '+e.task_name+' ] ');
+          return e.task_id;
         });
       }
     }
@@ -111,14 +107,17 @@ export class ShuyouRentComputerService extends BaseService {
           SELECT
             a.*,
             b.name as shop_name,c.name as rent_person_name,
-            GROUP_CONCAT(d.task_id) AS taskIdList
+            GROUP_CONCAT(d.task_id) AS taskIdList,
+            GROUP_CONCAT(DISTINCT f.name) AS directorNameList
           FROM
             shuyou_rent_computer a
             LEFT JOIN shuyou_rent_computer_shop b ON a.shop_id = b.id
             LEFT JOIN shuyou_game_director c ON a.rent_person_id = c.id
             LEFT JOIN shuyou_rent_computer_usage d ON a.pc_num = d.pc_num
+            LEFT JOIN shuyou_game_task e ON e.id = d.task_id
+            LEFT JOIN shuyou_game_director f ON f.id = e.directorId
           WHERE 1 = 1
-            ${this.setSql(pc_num, 'and pc_num = ?', [pc_num])}
+            ${this.setSql(pc_num, 'and a.pc_num = ?', [pc_num])}
           GROUP BY a.id
         `;
     return this.sqlRenderPage(sql, query);

+ 2 - 2
cool-admin-vue-vue3-ts-vite/src/cool/modules/shuyou/components/shuyouGameTaskName-select.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: YKH
  * @Date: 2022-09-05 20:50:57
- * @LastEditTime: 2022-09-16 23:31:58
+ * @LastEditTime: 2022-09-17 22:10:47
  * @Description: file content
  * @FilePath: \cool-admin-3.x\cool-admin-vue-vue3-ts-vite\src\cool\modules\shuyou\components\shuyouGameTaskName-select.vue
 -->
@@ -12,7 +12,7 @@
 	<el-select v-model="value" v-bind="props" filterable multiple @change="onChange"
 		placeholder="可搜索">
 		<el-option v-for="(item, index) in list" :key="index" :value="item.id"
-			:label="item.id" />
+		:label="item.id+' [ '+item.task_name+' ] '" />
 	</el-select>
 </template>
 

+ 13 - 5
cool-admin-vue-vue3-ts-vite/src/cool/modules/shuyou/views/rent_computer.vue

@@ -4,7 +4,7 @@
 			<cl-refresh-btn />
 			<cl-add-btn />
 			<cl-multi-delete-btn />
-			<demo-query-isabnormal />
+			<!-- <demo-query-isabnormal /> -->
 			<cl-flex1 />
 			<cl-search-key
 				field="pc_num"
@@ -83,7 +83,7 @@ export default defineComponent({
 					component: {
 						name: "el-input",
 						props: {
-							placeholder: "电脑编号"
+							placeholder: "租机方提供的电脑编号"
 						}
 					},
 					rules: {
@@ -98,7 +98,7 @@ export default defineComponent({
 					component: {
 						name: "el-input",
 						props: {
-							placeholder: "电脑名"
+							placeholder: "脚本上传的电脑名"
 						}
 					},
 					rules: {
@@ -354,8 +354,8 @@ export default defineComponent({
 					minWidth: 120
 				},
 				{
-					prop: "rent_person_name",
-					label: "租赁人",
+					prop: "directorNameList",
+					label: "使用人",
 					headerAlign: "left",
 					align: "left",
 					sortable: "custom",
@@ -384,6 +384,14 @@ export default defineComponent({
 					]
 				},
 				{
+					prop: "rent_person_name",
+					label: "租赁人",
+					headerAlign: "left",
+					align: "left",
+					sortable: "custom",
+					minWidth: 100
+				},
+				{
 					prop: "remark",
 					label: "备注",
 					headerAlign: "left",