|
@@ -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'))
|