Commit 550a9ad9 authored by 沈翠玲's avatar 沈翠玲

LPN

parent 28af525c
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="mini" @click="handleprint"
type="primary"
size="mini"
@click="handleprint"
>打印</el-button >打印</el-button
> >
</el-form-item> </el-form-item>
...@@ -38,14 +35,15 @@ ...@@ -38,14 +35,15 @@
v-hasPermi="['pro:scheduleSetupRule:export']" v-hasPermi="['pro:scheduleSetupRule:export']"
>导出</el-button> >导出</el-button>
</el-col> --> </el-col> -->
<right-toolbar <!-- <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
></right-toolbar> ></right-toolbar> -->
</el-row> </el-row>
<el-table <el-table
v-loading="loading" v-loading="loading"
v-if="scheduleSetupRuleList.length > 0"
:data="scheduleSetupRuleList" :data="scheduleSetupRuleList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
...@@ -78,21 +76,13 @@ ...@@ -78,21 +76,13 @@
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
</el-table> </el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel' import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport' import { postBatchPrintPdf } from '@/utils/ruoyi'
export default { export default {
name: 'lpnLabel', name: 'lpnLabel',
...@@ -142,15 +132,31 @@ export default { ...@@ -142,15 +132,31 @@ export default {
} }
}, },
created() { created() {
this.getList() // this.getList()
}, },
methods: { methods: {
handleprint(){ handleprint() {
if (this.timer !== null) return if (this.timer !== null) return
this.timer = setTimeout(()=>{ this.timer = setTimeout(async () => {
console.log('打印', this.queryParams)
this.timer = null this.timer = null
},100) await this.getList()
if (
!this.scheduleSetupRuleList ||
this.scheduleSetupRuleList.length === 0
)
return this.$modal.msgError('没有数据')
const valueList = this.scheduleSetupRuleList.map((v) => {
return {
packagePrint: {
lpnNo: v.lpnNo,
}
}
})
await postBatchPrintPdf('package-lpnV2', valueList).then(() => {
this.visible = false
this.getPackageList()
})
}, 100)
}, },
onItemSelected(obj) { onItemSelected(obj) {
if (obj != undefined && obj != null) { if (obj != undefined && obj != null) {
...@@ -160,9 +166,9 @@ export default { ...@@ -160,9 +166,9 @@ export default {
} }
}, },
/** 查询客户产品标签模板对照表列表 */ /** 查询客户产品标签模板对照表列表 */
getList() { async getList() {
this.loading = true this.loading = true
listlpnrecord(this.queryParams).then((response) => { await listlpnrecord(this.queryParams).then((response) => {
this.scheduleSetupRuleList = response.rows this.scheduleSetupRuleList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
......
...@@ -18,8 +18,16 @@ ...@@ -18,8 +18,16 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -41,6 +49,7 @@ ...@@ -41,6 +49,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
v-if="scheduleSetupRuleList.length > 0"
:data="scheduleSetupRuleList" :data="scheduleSetupRuleList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
...@@ -81,16 +90,14 @@ ...@@ -81,16 +90,14 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</div> </div>
</template> </template>
<script> <script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel' import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport' import { postBatchPrintPdf } from '@/utils/ruoyi'
export default { export default {
name: 'lpnLabel', name: 'lpnLabel',
data() { data() {
return { return {
...@@ -122,7 +129,6 @@ ...@@ -122,7 +129,6 @@
brandOptions: [], brandOptions: [],
templateOptions: [], templateOptions: [],
selectedRows: [], selectedRows: [],
timer: null,
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
...@@ -138,15 +144,21 @@ ...@@ -138,15 +144,21 @@
} }
}, },
created() { created() {
this.getList() // this.getList()
}, },
methods: { methods: {
handleprint(){ handleprint() {
if (this.timer !== null) return const valueList = this.selectedRows.map((v) => {
this.timer = setTimeout(()=>{ return {
console.log('打印', this.queryParams) packagePrint: {
this.timer = null lpnNo: v.lpnNo,
},100) },
}
})
postBatchPrintPdf('package-lpnV2', valueList).then(() => {
this.visible = false
this.getPackageList()
})
}, },
onItemSelected(obj) { onItemSelected(obj) {
if (obj != undefined && obj != null) { if (obj != undefined && obj != null) {
...@@ -156,9 +168,9 @@ ...@@ -156,9 +168,9 @@
} }
}, },
/** 查询客户产品标签模板对照表列表 */ /** 查询客户产品标签模板对照表列表 */
getList() { async getList() {
this.loading = true this.loading = true
listlpnrecord(this.queryParams).then((response) => { await listlpnrecord(this.queryParams).then((response) => {
this.scheduleSetupRuleList = response.rows this.scheduleSetupRuleList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
...@@ -301,6 +313,6 @@ ...@@ -301,6 +313,6 @@
) )
}, },
}, },
} }
</script> </script>
\ No newline at end of file
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