Selaa lähdekoodia

前端更新sdy

zhongtianhaoyuan 3 vuotta sitten
vanhempi
commit
00133616f1

+ 1 - 1
src/views/houseSelfCollect/inspectInfo.vue

@@ -115,7 +115,7 @@
       <div slot="footer">
         <inspectInfoPrint :printData="inspect" ref="saveImg"></inspectInfoPrint>
         <div class="bottom-row4">
-          <el-button type="primary">关闭</el-button>
+          <el-button type="primary" @click="isShowPrint= false">关闭</el-button>
           <el-button type="primary" @click="printSmall">打印小票</el-button>
           <el-button type="primary" @click="printBig">打印单据</el-button>
         </div>

+ 1 - 1
src/views/houseSelfCollect/inspectionManagement.vue

@@ -166,7 +166,6 @@ export default {
       })
     },
     warehouseNameChange(e) {
-      console.log(this.warehouseList)
       for(let i = 0 ; i < this.warehouseList.length; i++){
         if(this.warehouseList[i].value == e){
            this.warehouseName = this.warehouseList[i].value
@@ -176,6 +175,7 @@ export default {
           this.purchasePriceList = this.warehouseList[i].purchasePriceList
         }
       }
+      this.getList()
     },
     del(row) {
       //删除

+ 1 - 1
src/views/houseSelfCollect/weighingManagement.vue

@@ -116,7 +116,6 @@
       center
       :visible.sync="isShowPrint"
       title="粮食检斤单"
-      id="dialog"
     >
       <weightCheckPrint :tableData="dialogData"></weightCheckPrint>
     </el-dialog>
@@ -184,6 +183,7 @@ export default {
          this.purchasePriceList = this.warehouseList[i].warehouseList
         }
       }
+      this.getList()
     },
     weightCheck(row, num) {
       this.$router.push({

+ 47 - 4
src/views/houseSelfCollect/weightCheck.vue

@@ -161,13 +161,22 @@
       center
       :visible.sync="isShowPrint"
       title="粮食检斤单"
+      @close="closeDialog"
     >
       <weightCheckPrint :tableData="inspect"></weightCheckPrint>
+      <el-button type="primary" @click="inspect = false">关闭</el-button>
+      <el-button type="primary" @click="printSmall">打印小票</el-button>
+      <el-button type="primary" @click="printBig">打印单据</el-button>
     </el-dialog>
   </div>
 </template>
 <script>
-import { tare, grossWeight, getamount,getPrint } from '@/model/houseSelfCollect/index'
+import {
+  tare,
+  grossWeight,
+  getamount,
+  getPrint,
+} from '@/model/houseSelfCollect/index'
 import weightCheckPrint from './component/weightCheckPrint.vue'
 export default {
   components: {
@@ -227,6 +236,41 @@ export default {
           this.weighingList.buckleMiscellaneous
       }
     },
+    printSmall() {
+      window.location.href =
+        '../../../../static/weightCheck.html?type=1&tableData=' +
+        JSON.stringify(this.tableData)
+    },
+    printBig() {
+      window.location.href =
+        '../../../../static/weightCheck.html?type=2&tableData=' +
+        JSON.stringify(this.tableData)
+    },
+    closeDialog() {
+      html2canvas(this.$refs.saveImg.$el).then((canvas) => {
+        let dataURL = canvas.toDataURL('image/png')
+        this.imgUrl = dataURL
+        if (this.imgUrl !== '') {
+          let b = this.dataURLtoFile(this.imgUrl, 'aa')
+          console.log(b)
+          let formdata = new FormData()
+          formdata.append('file', b)
+          axios({
+            method: 'post',
+            url: 'https://www.zthymaoyi.com/upload/admin',
+            data: formdata,
+          }).then((response) => {
+            //编辑接口
+            this.weighingList.pictureAddress = response.data.url
+            getinspectEdit(this.weighingList)
+              .toPromise()
+              .then((response) => {})
+          })
+
+          this.dialogTableVisible = true
+        }
+      })
+    },
     print() {
       if (!this.weighingList.grossWeight) {
         this.$message({
@@ -355,9 +399,9 @@ export default {
                 }
               })
           } else if (this.tpyeNo == 2) {
-            
             this.weighingList.warehouseId = this.warehouseId
-           this.weighingList.skinInspector =sessionStorage.getItem('ws-pf_staffName'),
+            ;(this.weighingList.skinInspector =
+              sessionStorage.getItem('ws-pf_staffName')),
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
@@ -378,7 +422,6 @@ export default {
                     .catch((response) => {
                       // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
                     })
-              
                 })
                 .catch((response) => {
                   // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))