Browse Source

2023-5-16

codeMan 1 year ago
parent
commit
65b23074a5

+ 37 - 5
src/HDrpManagement/prodectFileData/components/add.vue

@@ -7,7 +7,14 @@
         @close="onClose"
         append-to-body
     >
-      <search @searchActive="searchActive" :placeholder="placeholder"></search>
+      <search class="inline-16" @searchActive="searchActive" :placeholder="placeholder"></search>
+      <uploadAllData
+        class="inline-16"
+        :total="total"
+        @handlePullApi="handlePullApi"
+        @handleUploadApi="handleUploadApi"
+        @onSuccess="onSuccess"
+      ></uploadAllData>
       <div>
         <tablelayout :layout="tablecols" :data="productsList" :custom="true" :checkbox="true" height="calc(100vh - 452px)" @checkboxCallBack="checkboxCallBack">
           <template v-slot:customcol="scope">
@@ -34,7 +41,7 @@
               background
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
-              :current-page="currentPage"
+              :current-page="params.content.pageNumber"
               :page-sizes="[20, 50, 100, 200]"
               layout="total,sizes, prev, pager, next, jumper"
               :total="total">
@@ -52,6 +59,7 @@
 <script>
 import tablelayout from '@/components/table/index2'
 import search from './search'
+import uploadAllData from '@/components/uploadAllData/index'
 export default {
   name: "add",
   props:["plm_technicalinfoid"],
@@ -89,7 +97,8 @@ export default {
   },
   components:{
     tablelayout,
-    search
+    search,
+    uploadAllData
   },
   mounted() {
 
@@ -119,6 +128,25 @@ export default {
       this.selected = val.length
 
     },
+    /*拉取数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = this.params.id
+    },
+    /*上传数据*/
+    handleUploadApi (uploadApi,data) {
+      uploadApi.id = 20220926102003
+      let arr = data.map(e=>{
+        return {
+          plm_technicalinfo_itemid:0,
+          itemid:e.itemid
+        }
+      })
+      uploadApi.content = {
+        "plm_technicalinfoid":this.plm_technicalinfoid,
+        "iteminfos":arr
+      }
+    },
     async onSubmit(){
       console.log(this.multipleSelection)
       let arr = this.multipleSelection.map(e=>{
@@ -140,18 +168,22 @@ export default {
         this.$emit('addSuccess')
       })
     },
+    onSuccess () {
+      this.$emit('addSuccess')
+      this.drawer = false
+    },
     searchActive(data) {
       this.params.content.where.condition = data
       this.productsData()
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
-      this.param.content.pageSize = val
+      this.params.content.pageSize = val
       this.productsData()
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
-      this.param.content.pageNumber = val
+      this.params.content.pageNumber = val
       this.productsData()
     },
   }

+ 18 - 3
src/HDrpManagement/serveWorkBill/components/printTable.vue

@@ -21,7 +21,7 @@
             <td class="td__title">保质期</td>
             <td>{{detail.workorder.isouritem === 1?'内':'外'}}</td>
             <td class="td__title">服务方式</td>
-            <td>{{ detail.workorder.projectleader || '--' }}</td>
+            <td>{{ detail.workorder.type || '--' }}</td>
           </tr>
           <tr>
             <td class="td__title">服务单号</td>
@@ -475,7 +475,6 @@
           </tr>
         </table>
       </div>
-      
       <!-- <el-button style="margin:20px 0" type="primary" size="small" @click="submit">生 成 图 片</el-button> -->
     </div>
   </div>
@@ -588,6 +587,7 @@ export default {
             context.drawImage(img,0,0,node.width, node.height)
             let dataURL = CANVAS.toDataURL("image/jpg")
             node.src = dataURL
+            console.log(that.detail.status,that.detail.status == '新建','结果',that.detail.status == '新建' || that.$route.query.action == 1,that.$route.query.action == 1);
             if (that.detail.status == '新建' || that.$route.query.action == 1) {
               that.submit()
             } else {
@@ -602,12 +602,27 @@ export default {
           }
           img.src = this.signatureName[0].url + '?time=' + Date.now();
         })
+      } else {
+        this.$nextTick(() => {
+          if (that.detail.status == '新建' || that.$route.query.action == 1) {
+            that.submit()
+          } else {
+            domtoimage.toJpeg(that.$refs.container,{
+              width:that.$refs.container.width,
+              height:that.$refs.container.height,
+              cacheBust:true
+            }).then((res) => {
+              that.previewImage = res
+            })
+          }
+        })
       }
 
       
     },
     submit () {
       let that = this
+      console.log(this.$refs.container);
       domtoimage.toBlob(this.$refs.container)
 	    .then(function (blob) {
         let file = new File([blob], that.detail.workorder.type, { type: blob.type })
@@ -616,7 +631,7 @@ export default {
         that.getUploadUrl(file,'jpg')
 
         that.previewImage = URL.createObjectURL(blob)
-        console.log(that.previewImage);
+        console.log(that.previewImage,'执行');
       })
     },
     // 获取华为云上传地址

+ 1 - 1
src/HDrpManagement/serveWorkBill/modules/detail.vue

@@ -189,7 +189,7 @@ export default {
         type:'warning',
         message:'暂无单据信息'
       })      
-      window.open(result[0].url,'_self')
+      window.open(result[result.length - 1].url,'_self')
     },
     async teamChange (data) {
       let result = data.map(item => {

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

@@ -14,7 +14,7 @@
       @pageChange="pageChange"
       @onEditSuccess="onEditSuccess">
       <div slot="customOperation" class="inline-16">
-          <Edit v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" class="inline-16" @onSuccess="queryMainData()" :data="mainData" />
+          <Edit v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" class="inline-16" @onSuccess="queryMainData();$refs.tool.listData()" :data="mainData" />
           <el-button v-if="tool.checkAuth($route.name,'confirmDate')" :disabled="mainData.status !== '交期待确认'" class="inline-16"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
           <confirmDate v-if="tool.checkAuth($route.name,'replyDate')" class="inline-16" :data="mainData" @onSuccess="queryMainData"></confirmDate>
 

+ 4 - 4
src/HDrpManagement/toolBorrowingMag/detail/tabs/toolList.vue

@@ -336,7 +336,7 @@ export default {
     },
     async updateOrder (val) {
       const res  = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": val
       })
       this.$emit('onSuccess')
@@ -400,7 +400,7 @@ export default {
         }
       })
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -417,7 +417,7 @@ export default {
     /*单独添加*/
     async addTool(data){
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -440,7 +440,7 @@ export default {
     },
     /*一键添加*/
     uploadData (uploadApi,data) {
-      uploadApi.id = 20221109093602
+      uploadApi.id = 20230116101602
       uploadApi.content = {
         "sa_orderid": this.$route.query.id, //订单ID
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID

+ 9 - 4
src/HDrpManagement/toolBorrowingMag/modules/add.vue

@@ -13,8 +13,10 @@
         <el-row :gutter="15">
           <el-form size="small" ref="form" :model="form" :rules="rules" label-width="100px" :status-icon="false">
             <el-col :span="24">
-              <el-form-item label="企业信息" prop="sys_enterpriseid">
-                <enterprise @rowClick="rowClick" ref="enterprise"></enterprise>
+              <el-form-item label="企业信息" prop="enterprisename">
+                <enterprise @rowClick="rowClick" ref="enterprise">
+                  <el-input readonly :validate-event="false" v-model="form.enterprisename" @focus="$refs.enterprise.queryEnterpriseArchives()"  placeholder="输入经销商信息" clearable></el-input>
+                </enterprise>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -76,7 +78,8 @@ export default {
         "rebate_used":0,//默认0,是否使用返利金
         "billdate":"",//单据日期,默认创建日期
         "signbacknum":"",
-        "promname":""
+        "promname":"",
+        "enterprisename":''
       },
       rules: {
         sa_brandid: [{
@@ -94,7 +97,7 @@ export default {
           message: '请选择选子分类',
           trigger: 'change'
         }],
-        sys_enterpriseid:[{
+        enterprisename:[{
           required: true,
           message: '订货企业不能为空',
           trigger: 'blur'
@@ -175,7 +178,9 @@ export default {
       // this.tradefieldOptions = res1.data
     },
     rowClick (row) {
+      console.log(row);
       this.form.sys_enterpriseid = row.sys_enterpriseid
+      this.form.enterprisename = row.enterprisename
       this.$refs['contract'].listData(row.sys_enterpriseid)
     },
     contractClick (row) {

+ 0 - 1
src/HDrpManagement/toolBorrowingMag/modules/edit.vue

@@ -380,7 +380,6 @@ export default {
       })
     },
     onDelSuccess () {
-      this.$refs.addpro.listData()
     },
     addMoreProduct () {
       this.setcol === 12?this.setcol = 24 : this.setcol = 12

+ 4 - 4
src/SDrpManagement/salerToolBorrowing/detail/tabs/toolList.vue

@@ -325,7 +325,7 @@ export default {
     },
     async updateOrder (val) {
       const res  = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": val
       })
       this.$emit('onSuccess')
@@ -366,7 +366,7 @@ export default {
         }
       })
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -383,7 +383,7 @@ export default {
     /*单独添加*/
     async addTool(data){
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -406,7 +406,7 @@ export default {
     },
     /*一键添加*/
     uploadData (uploadApi,data) {
-      uploadApi.id = 20221109093602
+      uploadApi.id = 20230116101602
       uploadApi.content = {
         "sa_orderid": this.$route.query.id, //订单ID
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID

+ 8 - 4
src/SDrpManagement/salerToolBorrowing/modules/add.vue

@@ -13,8 +13,10 @@
         <el-row :gutter="15">
           <el-form size="small" ref="form" :model="form" :rules="rules" label-width="100px" :status-icon="false">
             <el-col :span="24">
-              <el-form-item label="企业信息" prop="sys_enterpriseid">
-                <enterprise ref="enterprise" :type="9" @rowClick="rowClick"></enterprise>
+              <el-form-item label="企业信息" prop="enterprisename">
+                <enterprise ref="enterprise" :type="9" @rowClick="rowClick">
+                  <el-input readonly :validate-event="false" v-model="form.enterprisename" @focus="$refs.enterprise.queryEnterpriseArchives()"  placeholder="输入经销商信息" clearable></el-input>
+                </enterprise>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -76,7 +78,8 @@ export default {
         "rebate_used":0,//默认0,是否使用返利金
         "billdate":"",//单据日期,默认创建日期
         "signbacknum":"",
-        "promname":""
+        "promname":"",
+        "enterprisename":''
       },
       rules: {
         sa_brandid: [{
@@ -94,7 +97,7 @@ export default {
           message: '请选择选子分类',
           trigger: 'change'
         }],
-        sys_enterpriseid:[{
+        enterprisename:[{
           required: true,
           message: '订货企业不能为空',
           trigger: 'blur'
@@ -180,6 +183,7 @@ export default {
     },
     rowClick (row) {
       this.form.sys_enterpriseid = row.sys_enterpriseid
+      this.form.enterprisename = row.enterprisename
       this.$refs['contract'].listData(row.sys_enterpriseid)
     },
     contractClick (row) {

+ 3 - 3
src/SDrpManagement/toolBorrowing/detail/tabs/toolList.vue

@@ -367,7 +367,7 @@ export default {
         }
       })
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -384,7 +384,7 @@ export default {
     /*单独添加*/
     async addTool(data){
       let res = await this.$api.requested({
-        "id": 20221109093602,
+        "id": 20230116101602,
         "content": {
           "sa_orderid": this.$route.query.id, //订单ID
           "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
@@ -407,7 +407,7 @@ export default {
     },
     /*一键添加*/
     uploadData (uploadApi,data) {
-      uploadApi.id = 20221109093602
+      uploadApi.id = 20230116101602
       uploadApi.content = {
         "sa_orderid": this.$route.query.id, //订单ID
         "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID

+ 6 - 2
src/template/enterprise/index.vue

@@ -50,8 +50,11 @@
           </el-pagination>
         </div>
       </div>
-      <el-button v-if="showType === 'button'"  slot="reference" type="primary" size="mini" @click="queryEnterpriseArchives">选择企业</el-button>
-      <el-input v-else readonly :validate-event="false" slot="reference" v-model="form.enterprisename" @focus="queryEnterpriseArchives"  placeholder="输入经销商信息" clearable></el-input>
+      <div slot="reference" v-if="Object.keys($slots).length"><slot></slot></div>
+      <div v-else slot="reference">
+        <el-button v-if="showType === 'button'" type="primary" size="mini" @click="queryEnterpriseArchives">选择企业</el-button>
+        <el-input v-else readonly :validate-event="false" v-model="form.enterprisename" @focus="queryEnterpriseArchives"  placeholder="输入经销商信息" clearable></el-input>
+      </div>
     </el-popover>
   </div>
 </template>
@@ -120,6 +123,7 @@ export default {
   },
   mounted () {
     // this.queryEnterpriseArchives()
+    console.log(Object.keys(this.$slots).length);
   }
 }