Commit 16761b67 authored by 沈翠玲's avatar 沈翠玲

退料申请增加打印按钮

parent 0a89a7c0
...@@ -35,6 +35,15 @@ export function addMaterialReturn(data) { ...@@ -35,6 +35,15 @@ export function addMaterialReturn(data) {
}) })
} }
export function getCheckItem(data) {
return request({
url: '/pro/materialReturn/materialReturnItem',
method: 'post',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
params: data
})
}
// 修改退料申请 // 修改退料申请
export function updateMaterialReturn(data) { export function updateMaterialReturn(data) {
return request({ return request({
......
...@@ -431,7 +431,7 @@ export default { ...@@ -431,7 +431,7 @@ export default {
}, },
/** 完成按钮操作 */ /** 完成按钮操作 */
handleFinish(row) { handleFinish(row) {
this.$modal.confirm('是否确认完成?').then(function() { this.$modal.confirm(`是否确认组合单${row.combinationCode}的排版任务已经完成?`).then(function() {
return finishApi(row.id); return finishApi(row.id);
}).then(() => { }).then(() => {
this.getList(); this.getList();
......
...@@ -85,6 +85,16 @@ ...@@ -85,6 +85,16 @@
v-hasPermi="['pro:materialReturn:export']" v-hasPermi="['pro:materialReturn:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
size="mini"
:disabled="single"
@click="handlePrint"
v-hasPermi="['pro:materialReturn:print']"
>打印</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<requestItems ref="requestitemsref" key="requestitemsref" :applyNos="applyNos" ></requestItems> <requestItems ref="requestitemsref" key="requestitemsref" :applyNos="applyNos" ></requestItems>
...@@ -215,8 +225,9 @@ ...@@ -215,8 +225,9 @@
</template> </template>
<script> <script>
import { listMaterialReturns,listMaterialReturn, getMaterialReturn, delMaterialReturn, addMaterialReturn, updateMaterialReturn } from "@/api/mes/pro/return"; import { listMaterialReturns,listMaterialReturn, getMaterialReturn, delMaterialReturn, addMaterialReturn, updateMaterialReturn, getCheckItem } from "@/api/mes/pro/return";
import requestItems from "@/components/MaterialReturn/returnItem.vue"; import requestItems from "@/components/MaterialReturn/returnItem.vue";
import { postPrintPdf } from '@/utils/ruoyi'
export default { export default {
components: {requestItems}, components: {requestItems},
name: "MaterialReturn", name: "MaterialReturn",
...@@ -234,7 +245,7 @@ export default { ...@@ -234,7 +245,7 @@ export default {
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
selectRows: [],
applyNos: null, applyNos: null,
// 总条数 // 总条数
total: 0, total: 0,
...@@ -284,6 +295,35 @@ export default { ...@@ -284,6 +295,35 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
async handlePrint(){
const row = this.selectRows[0]
const recods = await getCheckItem({taskId: row.taskId, returnReason: '' });
let b='';
if(recods.code == 200){
for(let i = 0;i<recods.data.length;i++){
b=b+'\n'+recods.data[i].itemCode+':'+recods.data[i].batchCode;
}
postPrintPdf(
"qrcode-50*50-2",
{
detail:[
{
barcode: row.applyNo,
showText: '退料单号:'+row.applyNo+b,
gp: 1
},
{
barcode: row.applyNo,
showText: '退料单号:'+row.applyNo+b,
gp: 1
}
]
}
);
}
},
/** 查询退料申请列表 */ /** 查询退料申请列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -363,6 +403,7 @@ export default { ...@@ -363,6 +403,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.materialReturnId) this.ids = selection.map(item => item.materialReturnId)
this.selectRows = selection
this.applyno = selection.map(item => item.applyNo) this.applyno = selection.map(item => item.applyNo)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment