zhangqiOMG 2 years ago
parent
commit
32c59b9574

+ 1 - 1
src/HDrpManagement/toolBorrowingMag/detail/index.vue

@@ -43,7 +43,7 @@
           <!-- <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button> -->
       </div>
       <div slot="slot0" >
-        <toolList></toolList>
+        <toolList :data="mainData"></toolList>
       </div>
        <div slot="slot1">
         <dispatch></dispatch>

+ 7 - 1
src/HDrpManagement/toolBorrowingMag/detail/tabs/toolList.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <addProduct :data="data" @onConfirm="listData"></addProduct>
     <el-table
       ref="multipleTable"
       :data="tableData"
@@ -150,7 +151,7 @@
           <p v-else>{{scope.row.remarks}}</p>
         </template>
       </el-table-column>
-      <el-table-column v-if="type === 'edit' && !data.sa_contractid" width="90" fixed="right">
+      <el-table-column v-if="!data.sa_contractid" width="90" fixed="right">
         <template slot-scope="scope">
           <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
         </template>
@@ -172,6 +173,8 @@
 </template>
 
 <script>
+import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
+
 export default {
   props:['data','type'],
   data () {
@@ -200,6 +203,9 @@ export default {
       value2:''
     }
   },
+  components:{
+    addProduct
+  },
   methods:{
     async listData () {
       this.param.content.sa_orderid = this.$route.query.id

+ 3 - 33
src/HDrpManagement/toolBorrowingMag/modules/edit.vue

@@ -191,15 +191,10 @@
       <div>
         <div class="mt-10">
           <p class="normal-title inline-16">订单产品</p>
-          <el-button v-if="!data.sa_contractid" type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
+          <!-- <el-button v-if="!data.sa_contractid" type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button> -->
         </div>
         <el-row :gutter="10">
-          <el-col :span="setcol">
-            <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
-          </el-col>
-          <el-col :span="24 - setcol">
-            <add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
-          </el-col>
+          <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
         </el-row>
       </div>
     </div>
@@ -214,13 +209,11 @@
 <script>
 import previewImage from '@/components/previewImage/index.vue'
 import toolList from '../detail/tabs/toolList.vue'
-import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
 export default {
   props:['data'],
   components:{
     previewImage,
-    toolList,
-    addProduct
+    toolList
   },
   data () {
     return {
@@ -368,29 +361,6 @@ export default {
     },
     addMoreProduct () {
       this.setcol === 12?this.setcol = 24 : this.setcol = 12
-    },
-    // 订单添加商品
-    async onConfirm (data) {
-      const res = await this.$api.requested({
-        "id": 20221109093602,
-        "content": {
-          "sa_orderid": this.$route.query.id, //订单ID
-          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
-          "type": "标准订单", //订单类型
-          "items": data.map(e=>{
-            return {
-              sa_orderitemsid:0,
-              itemid:e.itemid,
-              qty:e.orderminqty,
-              needdate:e.deliverydate
-            }
-          })
-        },
-      })
-      this.tool.showMessage(res,()=>{
-        this.setcol = 24
-        this.$refs['prolist'].listData()
-      })
     }
   },
   mounted () {

+ 1 - 1
src/HManagement/department/staff/detail/index.vue

@@ -19,7 +19,7 @@
       <div slot="customOperation" >
         <linkAccount class="inline-16" v-if="tool.checkAuth($route.name,'update')"  :data="mainData"  @onSuccess="queryMainData"></linkAccount>
         <createUser class="inline-16" v-if="tool.checkAuth($route.name,'update') && !mainData.userid" :data="mainData"  @onSuccess="queryMainData"></createUser>
-        <restPas v-if="tool.checkAuth($route.name,'restpas')" class="inline-16"></restPas>
+        <restPas v-if="tool.checkAuth($route.name,'restpas')" :userid="mainData.userid" class="inline-16"></restPas>
       </div>
       <div class="container normal-panel" slot="slot0" >
         <baseInfo :mainInfo="mainData"></baseInfo>

+ 2 - 1
src/HManagement/department/staff/detail/modules/restPassword.vue

@@ -10,13 +10,14 @@
 
 <script>
 export default {
+  props:['userid'],
   methods:{
     async resetPassword () {
       const res = await this.$api.requested({
         "classname": "webmanage.users.users",
         "method": "resetPassword",
         "content": {
-            "userid": this.$route.query.id
+            "userid": this.userid
         }
       })
       if (res.code === 0) return this.$notify({

+ 1 - 1
src/SDrpManagement/salerToolBorrowing/detail/index.vue

@@ -19,7 +19,7 @@
           <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
       </div>
       <div slot="slot0" >
-        <toolList></toolList>
+        <toolList :data="mainData"></toolList>
       </div>
       <div slot="slot1" >
       </div>

+ 7 - 1
src/SDrpManagement/salerToolBorrowing/detail/tabs/toolList.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <add-product ref="addpro" :data="data" @onConfirm="listData"></add-product>
     <el-table
       ref="multipleTable"
       :data="tableData"
@@ -150,7 +151,7 @@
           <p v-else>{{scope.row.remarks}}</p>
         </template>
       </el-table-column>
-      <el-table-column v-if="type === 'edit' && !data.sa_contractid" width="90" fixed="right">
+      <el-table-column v-if="!data.sa_contractid" width="90" fixed="right">
         <template slot-scope="scope">
           <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
         </template>
@@ -172,6 +173,8 @@
 </template>
 
 <script>
+import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
+
 export default {
   props:['data','type'],
   data () {
@@ -200,6 +203,9 @@ export default {
       value2:''
     }
   },
+  components:{
+    addProduct
+  },
   methods:{
     async listData () {
       this.param.content.sa_orderid = this.$route.query.id

+ 3 - 33
src/SDrpManagement/salerToolBorrowing/modules/edit.vue

@@ -191,15 +191,9 @@
       <div>
         <div class="mt-10">
           <p class="normal-title inline-16">订单产品</p>
-          <el-button v-if="!data.sa_contractid" type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
         </div>
         <el-row :gutter="10">
-          <el-col :span="setcol">
-            <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
-          </el-col>
-          <el-col :span="24 - setcol">
-            <add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
-          </el-col>
+          <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
         </el-row>
       </div>
     </div>
@@ -214,13 +208,11 @@
 <script>
 import previewImage from '@/components/previewImage/index.vue'
 import toolList from '../detail/tabs/toolList.vue'
-import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
 export default {
   props:['data'],
   components:{
     previewImage,
-    toolList,
-    addProduct
+    toolList
   },
   data () {
     return {
@@ -369,29 +361,7 @@ export default {
     addMoreProduct () {
       this.setcol === 12?this.setcol = 24 : this.setcol = 12
     },
-    // 订单添加商品
-    async onConfirm (data) {
-      const res = await this.$api.requested({
-        "id": 20221109093602,
-        "content": {
-          "sa_orderid": this.$route.query.id, //订单ID
-          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
-          "type": "标准订单", //订单类型
-          "items": data.map(e=>{
-            return {
-              sa_orderitemsid:0,
-              itemid:e.itemid,
-              qty:e.orderminqty,
-              needdate:e.deliverydate
-            }
-          })
-        },
-      })
-      this.tool.showMessage(res,()=>{
-        this.setcol = 24
-        this.$refs['prolist'].listData()
-      })
-    }
+    
   },
   mounted () {
   }

+ 1 - 1
src/SDrpManagement/toolBorrowing/detail/index.vue

@@ -19,7 +19,7 @@
         <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
       </div>
       <div slot="slot0" >
-        <toolList ref="tool"></toolList>
+        <toolList ref="tool" :data="mainData"></toolList>
       </div>
       <div slot="slot1" >
       </div>

+ 7 - 1
src/SDrpManagement/toolBorrowing/detail/tabs/toolList.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <add-product ref="addpro" :data="data" @onConfirm="listData"></add-product>
     <el-table
       ref="multipleTable"
       :data="tableData"
@@ -150,7 +151,7 @@
           <p v-else>{{scope.row.remarks}}</p>
         </template>
       </el-table-column>
-      <el-table-column v-if="type === 'edit' && !data.sa_contractid" width="90" fixed="right">
+      <el-table-column v-if="!data.sa_contractid" width="90" fixed="right">
         <template slot-scope="scope">
           <el-button v-if="tool.checkAuth($route.name,'billDetail')" type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
         </template>
@@ -172,6 +173,8 @@
 </template>
 
 <script>
+import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
+
 export default {
   props:['data','type'],
   data () {
@@ -200,6 +203,9 @@ export default {
       value2:''
     }
   },
+  components:{
+    addProduct
+  },
   methods:{
     async listData () {
       this.param.content.sa_orderid = this.$route.query.id

+ 3 - 10
src/SDrpManagement/toolBorrowing/modules/edit.vue

@@ -204,15 +204,9 @@
       <div>
         <div class="mt-10">
           <p class="normal-title inline-16">订单产品</p>
-          <el-button v-if="!data.sa_contractid" type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
         </div>
         <el-row :gutter="10">
-          <el-col :span="setcol">
-            <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
-          </el-col>
-          <el-col :span="24 - setcol">
-            <add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
-          </el-col>
+            <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'"></tool-list>
         </el-row>
       </div>
     </div>
@@ -227,13 +221,12 @@
 <script>
 import previewImage from '@/components/previewImage/index.vue'
 import toolList from '../detail/tabs/toolList.vue'
-import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
+
 export default {
   props:['data'],
   components:{
     previewImage,
-    toolList,
-    addProduct
+    toolList
   },
   data () {
     return {

+ 97 - 58
src/template/toolBorrowingCanUseProduct/index.vue

@@ -1,61 +1,72 @@
 <template>
-<div> 
-  <div class="flex-align-center flex-between mt-10">
-    <el-input style="width:200px" size="small"  suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" clearable></el-input>
-    <el-button type="primary" size="small" :disabled="tableSelectData.length === 0" @click="onConfirm">添加选中商品</el-button>
-  </div>
-  <div>
-    <el-table
-      ref="multipleTable"
-      :data="tableData"
-      style="width: 100%"
-      :header-cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
-      :cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
-      size="mini"
-      border
-      @selection-change="selectionChange">
-      <el-table-column
-        type="selection"
-        width="55">
-      </el-table-column>
-      <el-table-column
-        prop="itemname"
-        label="产品名称"
-        width="180">
-      </el-table-column>
-      <el-table-column
-        prop="itemno"
-        label="产品编号"
-        width="180">
-      </el-table-column>
-      <el-table-column
-        label="型号">
-        <template slot-scope="scope">
-          <p><span>{{scope.row.model}}</span></p>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="unit"
-        label="计量单位"
-        width="90">
-        <template slot-scope="scope">
-          <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}/{{scope.row.auxunit}}</el-tag>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div style="margin-top:16px;text-align:right">
-      <el-pagination
-        background
-        small
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-size="params.content.pageSize"
-        layout="total, prev, pager, next, jumper"
-        :total="total">
-      </el-pagination>
+<div>
+  <el-button :disabled="data.status !== '新建'" class="normal-margin" type="primary" size="small" @click="onShow(drawer=true)">添加工具</el-button>
+  <el-drawer
+    title="新增"
+    :visible.sync="drawer"
+    append-to-body
+    size="70%"
+    direction="rtl">
+    <div class="drawer__panel">
+      <div class="flex-align-center flex-between mt-10">
+        <el-input style="width:200px" size="small"  suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" clearable></el-input>
+        <el-button type="primary" size="small" :disabled="tableSelectData.length === 0" @click="onConfirm">添加选中商品</el-button>
+      </div>
+      <div>
+        <el-table
+          ref="multipleTable"
+          :data="tableData"
+          style="width: 100%"
+          :header-cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
+          :cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
+          size="mini"
+          border
+          @selection-change="selectionChange">
+          <el-table-column
+            type="selection"
+            width="55">
+          </el-table-column>
+          <el-table-column
+            prop="itemname"
+            label="产品名称"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="itemno"
+            label="产品编号"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            label="型号">
+            <template slot-scope="scope">
+              <p><span>{{scope.row.model}}</span></p>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="unit"
+            label="计量单位"
+            width="90">
+            <template slot-scope="scope">
+              <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}/{{scope.row.auxunit}}</el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="margin-top:16px;text-align:right">
+          <el-pagination
+            background
+            small
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="params.content.pageSize"
+            layout="total, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
+        </div>
+      </div>
     </div>
-  </div>
+  </el-drawer>
+
 </div>
 </template>
 
@@ -67,6 +78,7 @@ export default {
   props:['data'],
   data () {
     return {
+      drawer:false,
       params:{
         "id": 20230116111602,
         "content": {
@@ -89,6 +101,9 @@ export default {
     previewImage
   },
   methods:{
+    onShow () {
+      this.listData()
+    },
     async listData () {
       this.params.content.sa_orderid = this.$route.query.id
       const res = await this.$api.requested(this.params)
@@ -109,15 +124,39 @@ export default {
     selectionChange (val) {
       this.tableSelectData = val
     },
+    // 订单添加商品
+    async reqData (data) {
+      const res = await this.$api.requested({
+        "id": 20221109093602,
+        "content": {
+          "sa_orderid": this.$route.query.id, //订单ID
+          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
+          "type": "工具借用单", //订单类型
+          "items": data.map(e=>{
+            return {
+              sa_orderitemsid:0,
+              itemid:e.itemid,
+              qty:e.orderminqty,
+              needdate:e.deliverydate
+            }
+          })
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.drawer = false
+        this.$emit('onConfirm')
+      })
+    },
     onConfirm () {
-      this.$emit('onConfirm',this.tableSelectData)
+      this.reqData(this.tableSelectData)
+     
     },
     clearSelection () {
       this.$refs.multipleTable.clearSelection();
     }
   },
   mounted () {
-    this.listData()
+    
   }
 }