|
@@ -279,43 +279,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <pdf ref="myPdfComponent" src="http://zfiresupply.oss-cn-hangzhou.aliyuncs.com/uploadfile/1661914838175.pdf?Expires=1661918438&OSSAccessKeyId=LTAI4GK1q4mnpCFbonMd1pji&Signature=Y0eM%2FuG8Q88rPr0pp%2BDkM5QC%2FDc%3D">
|
|
|
- </pdf> -->
|
|
|
- <print-preview ref="preView" />
|
|
|
- <!-- <PrintTest v-if="isShowPrint" /> -->
|
|
|
- <!-- <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />-->
|
|
|
|
|
|
- <el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
|
|
|
- <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :xs="24" :sm="24" :lg="24">
|
|
|
- <el-form-item label="密码" prop="password">
|
|
|
- <el-input v-model="dialogForm.password" autocomplete="off" placeholder="请输入密码"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="12">
|
|
|
- <el-form-item label="操作人" prop="createMan">
|
|
|
- <el-input v-model="dialogForm.createMan" readonly></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
|
|
|
- <el-form-item label="操作日期" prop="createDate">
|
|
|
- <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd"
|
|
|
- style="width: 100%;" placeholder="选择日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancelDialogForm">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitDialogForm">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- <PrintTest v-if="isShowPrint" /> -->
|
|
|
- <!-- <printPreview ref='preView'/> -->
|
|
|
- <!-- <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" /> -->
|
|
|
+ <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
@@ -325,35 +290,10 @@ import { getSumList } from '@/api/supply/deliver'
|
|
|
import { checkPassword } from "@/api/supply/pickup";
|
|
|
import { getCategoryList, getSalesmanList } from '@/api/common'
|
|
|
import SumPrint from '@/views/supply/deliver/components/sum_print'
|
|
|
-import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
|
|
|
-disAutoConnect();
|
|
|
|
|
|
-import panel from './components/design/panel'
|
|
|
-import { getDetail, detailArr } from './components/design/print-data'
|
|
|
-import printPreview from './components/design/preview.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
SumPrint,
|
|
|
- printPreview
|
|
|
- },
|
|
|
- filters: {
|
|
|
- orderTypeFilter(val) {
|
|
|
- const MAP = {
|
|
|
- HOME: '家用单',
|
|
|
- TRADE: '商用单',
|
|
|
- RETAIL: '零售单',
|
|
|
- RETAIL_POLICY: '销售政策单',
|
|
|
- PERMU_HOME: '置换家用单',
|
|
|
- PERMU_TRADE: '置换商用单',
|
|
|
- PERMU_RETAIL: '置换零售单',
|
|
|
- PERMU_RETAIL_POLICY: '置换销售政策单',
|
|
|
- REQUISITION_HOME: '调拨家用单',
|
|
|
- REQUISITION_TRADE: '调拨商用单',
|
|
|
- REQUISITION_RETAIL: '调拨零售单',
|
|
|
- REQUISITION_RETAIL_POLICY: '调拨销售政策单',
|
|
|
- }
|
|
|
- return MAP[val];
|
|
|
- }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -383,51 +323,6 @@ export default {
|
|
|
tableSelection: [],
|
|
|
queryItem: {},
|
|
|
isShowPrint: false,
|
|
|
- curPaper: {
|
|
|
- type: 'A5',
|
|
|
- width: 500,
|
|
|
- height: 147.6
|
|
|
- },
|
|
|
- paperTypes: {
|
|
|
- 'A3': {
|
|
|
- width: 420,
|
|
|
- height: 296.6
|
|
|
- },
|
|
|
- 'A4': {
|
|
|
- width: 210,
|
|
|
- height: 296.6
|
|
|
- },
|
|
|
- 'A5': {
|
|
|
- width: 210,
|
|
|
- height: 147.6
|
|
|
- },
|
|
|
- 'B3': {
|
|
|
- width: 500,
|
|
|
- height: 352.6
|
|
|
- },
|
|
|
- 'B4': {
|
|
|
- width: 250,
|
|
|
- height: 352.6
|
|
|
- },
|
|
|
- 'B5': {
|
|
|
- width: 250,
|
|
|
- height: 175.6
|
|
|
- }
|
|
|
- },
|
|
|
- scaleValue: 1,
|
|
|
- scaleMax: 5,
|
|
|
- scaleMin: 0.5,
|
|
|
- isShowDialog: false,
|
|
|
- dialogForm: {
|
|
|
- password: "",
|
|
|
- createMan: "",
|
|
|
- createDate: "",
|
|
|
- },
|
|
|
- dialogFormRules: {
|
|
|
- password: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
|
|
- },
|
|
|
- hiprintTemplate:''
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -620,91 +515,15 @@ export default {
|
|
|
|
|
|
// 点击打印
|
|
|
toPrint() {
|
|
|
- // this.$refs
|
|
|
this.queryItem = this.tableSelection;
|
|
|
- // console.log(this.tableSelection);
|
|
|
- // this.isShowPrint = true;
|
|
|
- // this.$refs.myPdfComponent.print()
|
|
|
- // console.log(this.hiprintTemplate, detailArr);
|
|
|
- // getDetail(this.tableSelection)
|
|
|
- // this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
- if (!this.tableSelection[0].printNum) {
|
|
|
- this.queryItem = this.tableSelection;
|
|
|
- // this.isShowPrint = true;
|
|
|
- getDetail(this.tableSelection)
|
|
|
- this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
- } else {
|
|
|
- this.queryItem = this.tableSelection;
|
|
|
- this.dialogForm.createMan = JSON.parse(
|
|
|
- localStorage.getItem("supply_user")
|
|
|
- ).nickName;
|
|
|
- this.dialogForm.createDate = this.getDate();
|
|
|
- this.isShowDialog = true;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 关闭弹窗
|
|
|
- cancelDialogForm() {
|
|
|
- this.isShowDialog = false;
|
|
|
- this.$refs.dialogForm.resetFields();
|
|
|
- },
|
|
|
-
|
|
|
- // 提交 弹窗
|
|
|
- submitDialogForm() {
|
|
|
- this.$refs.dialogForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- let params = {
|
|
|
- shipId: this.queryItem[0].invoiceId,
|
|
|
- password: this.dialogForm.password,
|
|
|
- };
|
|
|
- checkPassword(params).then((res) => {
|
|
|
- this.cancelDialogForm();
|
|
|
- getDetail(this.tableSelection)
|
|
|
- this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- getDate() {
|
|
|
- var date = new Date();
|
|
|
- var seperator1 = "-";
|
|
|
- var year = date.getFullYear();
|
|
|
- var month = date.getMonth() + 1;
|
|
|
- var strDate = date.getDate();
|
|
|
- if (month >= 1 && month <= 9) {
|
|
|
- month = "0" + month;
|
|
|
- }
|
|
|
- if (strDate >= 0 && strDate <= 9) {
|
|
|
- strDate = "0" + strDate;
|
|
|
- }
|
|
|
- var currentdate = year + seperator1 + month + seperator1 + strDate;
|
|
|
- return currentdate;
|
|
|
-
|
|
|
+ this.isShowPrint = true;
|
|
|
},
|
|
|
|
|
|
backList() {
|
|
|
this.queryItem = {};
|
|
|
this.isShowPrint = false;
|
|
|
},
|
|
|
- /**
|
|
|
- * 设置纸张大小
|
|
|
- * @param type [A3, A4, A5, B3, B4, B5, other]
|
|
|
- * @param value {width,height} mm
|
|
|
- */
|
|
|
- setPaper(type, value) {
|
|
|
- try {
|
|
|
- if (Object.keys(this.paperTypes).includes(type)) {
|
|
|
- this.curPaper = { type: type, width: value.width, height: value.height }
|
|
|
- this.hiprintTemplate.setPaper(value.width, value.height)
|
|
|
- } else {
|
|
|
- this.curPaper = { type: 'other', width: value.width, height: value.height }
|
|
|
- this.hiprintTemplate.setPaper(value.width, value.height)
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(`操作失败: ${error}`)
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|