Parcourir la source

Merge branch 'master' of http://47.114.101.16:7070/ssy/jobticket

Administrator il y a 2 ans
Parent
commit
e3f042af49

+ 2 - 4
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceDeviceController.java

@@ -52,11 +52,9 @@ public class TInvoiceDeviceController extends BaseController
      *  查询装置区域下拉列表数据
      */
     @GetMapping("/select")
-    public AjaxResult select()
+    public AjaxResult select(TInvoiceDevice tInvoiceDevice)
     {
-
-        List<String> list = tInvoiceDeviceService.selectTInvoiceDeviceAllList();
-
+        List<String> list = tInvoiceDeviceService.selectTInvoiceDeviceAllList(tInvoiceDevice);
         return AjaxResult.success(list);
     }
 

+ 1 - 1
master/src/main/java/com/ruoyi/project/invoice/mapper/TInvoiceDeviceMapper.java

@@ -72,5 +72,5 @@ public interface TInvoiceDeviceMapper
      * @param
      * @return 结果
      */
-    List<String> selectTInvoiceDeviceAllList();
+    List<String> selectTInvoiceDeviceAllList(TInvoiceDevice tInvoiceDevice);
 }

+ 1 - 1
master/src/main/java/com/ruoyi/project/invoice/service/ITInvoiceDeviceService.java

@@ -68,5 +68,5 @@ public interface ITInvoiceDeviceService
      * @param
      * @return 结果
      */
-    List<String> selectTInvoiceDeviceAllList();
+    List<String> selectTInvoiceDeviceAllList(TInvoiceDevice tInvoiceDevice);
 }

+ 2 - 2
master/src/main/java/com/ruoyi/project/invoice/service/impl/TInvoiceDeviceServiceImpl.java

@@ -109,8 +109,8 @@ public class TInvoiceDeviceServiceImpl implements ITInvoiceDeviceService
      * @return 结果
      */
     @Override
-    public List<String> selectTInvoiceDeviceAllList() {
+    public List<String> selectTInvoiceDeviceAllList(TInvoiceDevice tInvoiceDevice) {
 
-        return tInvoiceDeviceMapper.selectTInvoiceDeviceAllList();
+        return tInvoiceDeviceMapper.selectTInvoiceDeviceAllList(tInvoiceDevice);
     }
 }

+ 4 - 2
master/src/main/resources/mybatis/invoice/TInvoiceDeviceMapper.xml

@@ -62,9 +62,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ${params.dataScope}
     </select>
 
-    <select id="selectTInvoiceDeviceAllList"  resultType="java.lang.String">
-        select d.work_area  from t_invoice_device d                                                                                                                                                   left join sys_dept s on s.dept_id = d.dept_id
+    <select id="selectTInvoiceDeviceAllList" parameterType="TInvoiceDevice"  resultType="java.lang.String">
+        select d.work_area  from t_invoice_device d
+            left join sys_dept s on s.dept_id = d.dept_id
         where d.del_flag = 0
+        <if test="deptId != null "> and d.dept_id = #{deptId}</if>
     </select>
 
     <select id="selectTInvoiceDeviceById" parameterType="Long" resultMap="TInvoiceDeviceResult">

+ 16 - 19
ui/src/views/invoice/bookingworkticket/index.vue

@@ -395,6 +395,12 @@
             </el-form-item>
           </el-col>
 
+          <el-col :span="8">
+            <el-form-item label="作业装置" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" @select="getWorkArea"  placeholder="请选择归属部门"/>
+            </el-form-item>
+          </el-col>
+
           <el-col :span="8">
             <el-form-item label="作业区域" prop="workArea">
               <el-select v-model="form.workArea" placeholder="请选择作业区域">
@@ -407,11 +413,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="归属部门" prop="deptId">
-              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
-            </el-form-item>
-          </el-col>
+
         </el-row>
         <el-row>
           <el-col :span="12">
@@ -890,7 +892,7 @@ export default {
     this.getTreeselect()
     this.getTagList()
     //初始化作业区域、 初始化用户单位下拉框
-    this.getDeviceup();
+    // this.getDeviceup();
     this.getDicts("booking_work_status").then(response => {
       this.statusOptions = response.data;
     });
@@ -1032,19 +1034,10 @@ export default {
     },
 
     //得到作业区域下拉框
-    getDeviceup() {
+    getDeviceup(deptId) {
+      this.form.workArea = null
       const queryForm = {
-        pageNum: 1,
-        pageSize: 99999,
-        devName: null,
-        workArea: null,
-        regionalHead: null,
-        createrCode: null,
-        createdate: null,
-        updaterCode: null,
-        updatedate: null,
-        deptId: null,
-        remarks: null
+        deptId: deptId,
       };
       selectDevice(queryForm).then(response => {
         this.workAreaOptions = response.data
@@ -1293,7 +1286,7 @@ export default {
       getUserByUserName(names).then(response => {
         this.form.workUnit = response.data.dept.deptName;
         //默认是用户自己的部门
-        this.form.deptId = response.data.dept.deptId;
+        // this.form.deptId = response.data.dept.deptId;
       });
       this.open = true;
       this.title = "添加预约作业票台账";
@@ -1331,6 +1324,10 @@ export default {
         this.ruleForm.length = response.data.tInvoiceWorkcontentList.length
       });
     },
+    getWorkArea(node){
+      console.log(node.id)
+      this.getDeviceup(node.id)
+    },
     //校验
     getFormPromise(formDone) {
       return new Promise(resolve => {