代码更新

This commit is contained in:
2022-11-10 09:19:37 +08:00
parent 7859e6938e
commit d35dd61ac1
14 changed files with 899 additions and 17 deletions

View File

@@ -0,0 +1,176 @@
<template>
<el-dialog
title="发货信息"
append-to-body
:visible.sync="dialogVisible"
:before-close="handleClose"
width="1100px"
destroy-on-close
v-if="dialogShow"
@close="close"
>
<el-form ref="form" :model="formMst" :rules="rules" size="mini" label-width="130px">
<el-row>
<el-col :span="8">
<el-form-item label="收货单位:">
<el-input v-model="formMst.consignee" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收货人:">
<el-input v-model="formMst.receiver" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收货地址:">
<el-input v-model="formMst.receiptaddress" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="收货人联系电话:">
<el-input v-model="formMst.receiptphone" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物流公司:">
<el-input v-model="formMst.logisticscompany" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="司机:">
<el-input v-model="formMst.drivername" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="车牌号:">
<el-input v-model="formMst.carno" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="司机联系电话:">
<el-input v-model="formMst.driverphone" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同号:">
<el-input v-model="formMst.contractno" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="送货单位:">
<el-input v-model="formMst.deliveryunit" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="送货方地址:">
<el-input v-model="formMst.deliveryaddress" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="送货方联系人:">
<el-input v-model="formMst.deliveryname" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="送货联系电话:">
<el-input v-model="formMst.deliveryphone" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物流公司编码:">
<el-input v-model="formMst.trans_code" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预估运费:">
<el-input v-model="formMst.estimated_freight" size="mini" style="width: 210px" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" type="primary" @click="moneySubmit">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
</span>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
export default {
name: 'SunShowDialog',
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.formMst = this.openParam
}
}
},
data() {
return {
formMst: {},
dialogVisible: false
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.$refs['form'].resetFields()
this.$emit('update:dialogShow', false)
this.crud.resetQuery(true)
},
moneySubmit() {
checkoutbill.moneySubmit(this.formMst).then(res => {
this.crud.notify('保存成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.crud.toQuery()
this.close()
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -162,4 +162,11 @@ export function getType() {
method: 'get'
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne }
export function moneySubmit(data) {
return request({
url: '/api/checkoutbill/moneySubmit',
method: 'post',
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit }

View File

@@ -158,7 +158,7 @@
<el-table-column
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
label="操作"
width="115"
width="200"
align="center"
fixed="right"
>
@@ -169,6 +169,20 @@
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
<el-button
type="text"
icon="el-icon-upload"
@click="openMoney(scope.row)"
>
发货信息
</el-button>
<el-button
type="text"
icon="el-icon-upload"
@click="print(scope.row)"
>
打印
</el-button>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
@@ -201,6 +215,7 @@
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
<MoneyDialog :dialog-show.sync="openMoneyDialog" :open-param="openParam" />
</div>
</template>
@@ -212,15 +227,17 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/outbill/AddDialog'
import MoneyDialog from '@/views/wms/st/outbill/MoneyDialog'
import DivDialog from '@/views/wms/st/outbill/DivDialog'
import TaskDialog from '@/views/wms/st/outbill/TaskDialog'
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
export default {
name: 'Checkoutbill',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog, MoneyDialog },
cruds() {
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
optShow: {
@@ -233,7 +250,7 @@ export default {
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE','ST_INV_OUT_TYPE'],
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -242,6 +259,7 @@ export default {
edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del']
},
openMoneyDialog: false,
divShow: false,
taskShow: false,
dis_flag: true,
@@ -359,6 +377,173 @@ export default {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
},
openMoney(row) {
this.openParam = row
this.openMoneyDialog = true
},
print(jo) {
checkoutbill.getOutBillDtl({ 'iostorinv_id': jo.iostorinv_id }).then(res => {
debugger
var total_array = []
for (var i = 0; i < res.length; i++) {
var jre = res[i]
var single_array = []
single_array.push(jre.seq_no)
single_array.push(jre.source_bill_code)
single_array.push(jre.material_name)
single_array.push(jre.material_spec)
single_array.push(jre.qty_unit_name)
single_array.push(jre.plan_qty)
single_array.push(jre.remark)
total_array.push(single_array)
}
// 对total_array进行分页每40条数据分为一页
var page = Math.ceil(total_array.length / 10) // 页数,向上取整
var left = parseInt(total_array.length % 10) // 最后一页条数
// 组织打印格式
var jastr = []
jastr[0] = this.print_getTableHtml({
heads: [{ width: '50px', name: '序号', colname: '0' },
{ width: '135px', name: '订单号', colname: '1' },
{ width: '250px', name: '物料名称', colname: '2' },
{ width: '60px', name: '型号规格', colname: '3' },
{ width: '60px', name: '单位', colname: '4' },
{ width: '100px', name: '数量', colname: '5' },
{ width: '50px', name: '备注', colname: '6' }
],
rows: total_array
})
jo.lastSize = left + 2 // 最后一页的数据量加2个单位显示生成人等字段
this.print2(jastr, jo)
alert('打印成功!')
})
},
print2(jastr, jo) {
debugger
var LODOP = getLodop()
// for循环
var num = jastr.length
LODOP.ADD_PRINT_TABLE('28%', 0, '100%', '100%', jastr[0])
LODOP.ADD_PRINT_HTM('10%', '5%', '100%', '100%', '地址:' + jo.deliveryaddress)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -1)
LODOP.ADD_PRINT_HTM('10%', '40%', '100%', '100%', '联系人:' + jo.deliveryname)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -2)
LODOP.ADD_PRINT_HTM('10%', '70%', '100%', '100%', '联系电话:' + jo.deliveryphone)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -3)
LODOP.ADD_PRINT_HTM('15%', '5%', '100%', '100%', '仓储:______________')
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -4)
LODOP.ADD_PRINT_HTM('15%', '40%', '100%', '100%', '财务部:______________')
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -5)
LODOP.ADD_PRINT_HTM('15%', '70%', '100%', '100%', '司机签字:______________')
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -6)
LODOP.ADD_PRINT_HTM('20%', '5%', '100%', '100%', '客户(签字盖章):______________')
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', -7)
// 另起一页
LODOP.SET_PRINT_STYLE('FontSize', 17)
LODOP.SET_PRINT_STYLE('Bold', 1)
LODOP.ADD_PRINT_TEXT('-7%', '30%', '100%', '100%', '甘肃海亮新能源材料有限公司')
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.SET_PRINT_STYLE('FontSize', 15)
LODOP.SET_PRINT_STYLE('Bold', 1)
LODOP.ADD_PRINT_TEXT('-1%', '45%', '100%', '100%', '送货单')
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
// 后台数据
LODOP.ADD_PRINT_HTM('3%', '5%', '100%', '100%', '实际发货日期:' + jo.biz_date)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('3%', '70%', '100%', '100%', '送货单号:' + jo.bill_code)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('7%', '5%', '100%', '100%', '收货单位:' + jo.consignee)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('7%', '70%', '100%', '100%', '收货人:' + jo.receiver)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('11%', '5%', '100%', '100%', '收货地址:' + jo.receiptaddress)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('11%', '70%', '100%', '100%', '联系电话:' + jo.receiptphone)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('15%', '5%', '100%', '100%', '物流公司:' + jo.logisticscompany)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('15%', '70%', '100%', '100%', '司机:' + jo.drivername)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('19%', '5%', '100%', '100%', '车牌号:' + jo.carno)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('19%', '70%', '100%', '100%', '联系电话:' + jo.driverphone)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('23%', '5%', '100%', '100%', '合同号:' + jo.contractno)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('23%', '45%', '100%', '100%', '总箱数:' + jo.num)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.ADD_PRINT_HTM('23%', '70%', '100%', '100%', '总毛重:' + jo.total_qty)
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
LODOP.NEWPAGE()
LODOP.SET_PRINT_STYLE('FontSize', 12)
LODOP.SET_PRINT_STYLE('Bold', 0)
LODOP.ADD_PRINT_TEXT('6%', '69%', 165, 22, '页码:[第#页/共&页]')
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 2)
//
// LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
// LODOP.PRINT();
LODOP.PREVIEWA()
},
print_getTableHtml(jparam) {
var _heads = jparam.heads
var _rows = jparam.rows
var _foothtml = jparam.foothtml
var strStyle = '<style> table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>'
var arr = []
arr.push('<table border=1 cellSpacing=0 cellPadding=1 width=\'100%\' style=\'border-collapse:collapse;font-size:13px\' bordercolor=\'#333333\'>')
arr.push(' <thead>')
arr.push(' <tr>')
for (var i = 0; i < _heads.length; i++) {
var head = _heads[i]
arr.push(' <td width=\'' + head.width + '\'>')
arr.push(' <div align=center><b>' + head.name + '</b></div>')
arr.push(' </td>')
}
arr.push(' </tr>')
arr.push(' </thead>')
arr.push(' <tbody>')
for (var i = 0; i < _rows.length; i++) {
var row = _rows[i]
arr.push(' <tr>')
for (var j = 0; j < _heads.length; j++) {
var head = _heads[j]
arr.push(' <td align=center>' + row[head.colname] + '</td>')
}
arr.push(' </tr>')
}
arr.push(' </tbody>')
if (_foothtml) {
arr.push(' <tfoot>' + _foothtml + '</tfoot>')
}
arr.push('</table>')
return strStyle + arr.join('')
}
}
}