|
@@ -0,0 +1,1875 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <FullPage
|
|
|
|
+ title="生产订单详情"
|
|
|
|
+ :list="list"
|
|
|
|
+ @init="init"
|
|
|
|
+ :logList="logList"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ @searchData="init"
|
|
|
|
+ @changePage="changePage"
|
|
|
|
+ @changeSize="changeSize"
|
|
|
|
+ @selectTable="selectTable"
|
|
|
|
+ :tableColums="tableColums"
|
|
|
|
+ :tableData="tableData"
|
|
|
|
+ :pageIndex="pageIndex"
|
|
|
|
+ :total="total"
|
|
|
|
+ >
|
|
|
|
+ <div slot="titleButton">
|
|
|
|
+ <Button @click="back" type="primary" ghost style="margin-right: 10px"
|
|
|
|
+ >返回</Button
|
|
|
|
+ >
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ @click="openMeasureModal(selects)"
|
|
|
|
+ >修改尺寸</Button
|
|
|
|
+ >
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ @click="openShipModal(selects)"
|
|
|
|
+ >批量打印芯片</Button
|
|
|
|
+ >
|
|
|
|
+ <!-- <Button type="primary" ghost style="margin-right:10px;" @click="showBatchModal = true">批量绑定芯片</Button> -->
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ @click="batchSelectRouter"
|
|
|
|
+ >批量修改工艺路线</Button
|
|
|
|
+ >
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ @click="openModal(selects)"
|
|
|
|
+ >批量下生产排产</Button
|
|
|
|
+ >
|
|
|
|
+ <Button type="primary" ghost>批量打印订单</Button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <template slot="set" slot-scope="{ row }">
|
|
|
|
+ <div class="table-set">
|
|
|
|
+ <a @click="printChip(row)">打印芯片</a>
|
|
|
|
+ <!-- <a @click="bingChip(row)">绑定芯片</a> -->
|
|
|
|
+ <!-- <a @click="bingChip(row)" v-if="row.tagnum&&row.part_tag">更换芯片</a> -->
|
|
|
|
+ <a @click="openModal(row)" :disabled="row.part_state != 0"
|
|
|
|
+ >下生产排产</a
|
|
|
|
+ >
|
|
|
|
+ <!-- <a @click="downImg(row.url,row.product_title)">下载图纸</a> -->
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <Modal
|
|
|
|
+ class-name="vertical-center-modal"
|
|
|
|
+ title="修改尺寸"
|
|
|
|
+ v-model="showMeasureModal"
|
|
|
|
+ :width="500"
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ <Table
|
|
|
|
+ border
|
|
|
|
+ :columns="measureModalColumns"
|
|
|
|
+ :data="measureModalTableData"
|
|
|
|
+ >
|
|
|
|
+ </Table>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer">
|
|
|
|
+ <Button
|
|
|
|
+ @click="showMeasureModal = false"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ >取消</Button
|
|
|
|
+ >
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ @click="handleMeasureModalConfirm"
|
|
|
|
+ >确认</Button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+ <Modal
|
|
|
|
+ @on-ok="saveChip"
|
|
|
|
+ class-name="vertical-center-modal"
|
|
|
|
+ title="绑定芯片"
|
|
|
|
+ v-model="showChip"
|
|
|
|
+ :width="300"
|
|
|
|
+ @on-visible-change="vivibleModal"
|
|
|
|
+ >
|
|
|
|
+ <Form>
|
|
|
|
+ <FormItem label="芯片编号">
|
|
|
|
+ <Input v-model="chipInfo.tag" placeholder="请输入芯片编号"></Input>
|
|
|
|
+ </FormItem>
|
|
|
|
+ </Form>
|
|
|
|
+ </Modal>
|
|
|
|
+
|
|
|
|
+ <Modal
|
|
|
|
+ title="批量绑定"
|
|
|
|
+ fullscreen
|
|
|
|
+ v-model="showBatchModal"
|
|
|
|
+ @on-visible-change="visibleBatchModal"
|
|
|
|
+ >
|
|
|
|
+ <div class="batch-content">
|
|
|
|
+ <div style="margin-right: 10px; width: 60%">
|
|
|
|
+ <Table
|
|
|
|
+ @on-selection-change="batchSelect"
|
|
|
|
+ border
|
|
|
|
+ stripe
|
|
|
|
+ :columns="batchTablePartsColumn"
|
|
|
|
+ :data="batchTablePartsData"
|
|
|
|
+ ></Table>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="margin-left: 10px; width: 40%">
|
|
|
|
+ <Table
|
|
|
|
+ border
|
|
|
|
+ stripe
|
|
|
|
+ :columns="batchChipColumns"
|
|
|
|
+ :data="batchChipData"
|
|
|
|
+ ></Table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="batch-footer">
|
|
|
|
+ <Page :total="batchTotal" show-total />
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="modal-footer">
|
|
|
|
+ <Button @click="showBatchModal = false">取消</Button>
|
|
|
|
+ <Button type="primary" @click="batchBindChip">确认绑定</Button>
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+ <Modal
|
|
|
|
+ class-name="vertical-center-modal"
|
|
|
|
+ v-model="show_add"
|
|
|
|
+ title="选择工艺路线"
|
|
|
|
+ >
|
|
|
|
+ <div class="modal_process_route">
|
|
|
|
+ <div class="modal_process_route_top">
|
|
|
|
+ <div>
|
|
|
|
+ <span>工艺路线名称:</span>
|
|
|
|
+ <Input
|
|
|
|
+ v-model="tempProcessLine.title"
|
|
|
|
+ style="width:120px"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ ></Input>
|
|
|
|
+ </div>
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleSearchProcessLine(tempProcessLine.title)"
|
|
|
|
+ >搜索</Button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="modal_process_route_content">
|
|
|
|
+ <Table
|
|
|
|
+ border
|
|
|
|
+ :columns="processLineColumns"
|
|
|
|
+ :data="processLineTableData"
|
|
|
|
+ >
|
|
|
|
+ <template slot="processLineSet" slot-scope="{ row, index }">
|
|
|
|
+ <a
|
|
|
|
+ style="margin:0 5px"
|
|
|
|
+ @click="handleProcessLineSet(row, index)"
|
|
|
|
+ >选择</a
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </Table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+ <Modal
|
|
|
|
+ class-name="vertical-center-modal-Process"
|
|
|
|
+ width="80%"
|
|
|
|
+ v-model="show_add_detail"
|
|
|
|
+ :mask-closable="false"
|
|
|
|
+ title="工艺路线修改"
|
|
|
|
+ >
|
|
|
|
+ <div class="modal_process_route-process">
|
|
|
|
+ <div>
|
|
|
|
+ <span style="width: 100px">id: </span
|
|
|
|
+ ><Input
|
|
|
|
+ v-model="info.id"
|
|
|
|
+ disabled
|
|
|
|
+ placeholder="自动生成"
|
|
|
|
+ style="width: 150px"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <span style="width: 100px">工艺路线名称: </span
|
|
|
|
+ ><Input
|
|
|
|
+ v-model="info.title"
|
|
|
|
+ placeholder="请输入工艺路线名称"
|
|
|
|
+ size="small"
|
|
|
|
+ style="width: 250px"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="modal_content">
|
|
|
|
+ <div class="modal_content_left">
|
|
|
|
+ <span>已选:</span>
|
|
|
|
+ <SlickList
|
|
|
|
+ :distance="10"
|
|
|
|
+ :lockToContainerEdges="true"
|
|
|
|
+ axis="x,y,xy"
|
|
|
|
+ lockAxis="xy"
|
|
|
|
+ v-model="selectTags"
|
|
|
|
+ class="SortableList"
|
|
|
|
+ @input="getChangeLists"
|
|
|
|
+ >
|
|
|
|
+ <SlickItem
|
|
|
|
+ style="z-index: 9999"
|
|
|
|
+ v-for="(item, key) of selectTags"
|
|
|
|
+ :key="key"
|
|
|
|
+ class="SortableItem"
|
|
|
|
+ :index="key"
|
|
|
|
+ >
|
|
|
|
+ <Tooltip>
|
|
|
|
+ <div slot="content">
|
|
|
|
+ <p>工时:{{ item.time }}</p>
|
|
|
|
+ <p>工价:{{ item.wages }}</p>
|
|
|
|
+ <p>产能:{{ item.capacity }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="tag-modal">
|
|
|
|
+ <div class="before">{{ key + 1 }}</div>
|
|
|
|
+ <Tag
|
|
|
|
+ @on-close="closeTag(key, selectTags, item)"
|
|
|
|
+ color="primary"
|
|
|
|
+ type="border"
|
|
|
|
+ closable
|
|
|
|
+ >{{ item.title }}</Tag
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </Tooltip>
|
|
|
|
+ </SlickItem>
|
|
|
|
+ </SlickList>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="modal_content_right">
|
|
|
|
+ <div v-for="(item, index) of info.bps" :key="index">
|
|
|
|
+ <div v-if="item.cld && item.cld.length > 0">
|
|
|
|
+ <span style="font-weight:bold">{{ item.title }}</span>
|
|
|
|
+ <div
|
|
|
|
+ style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-for="(_item, _index) in item.cld"
|
|
|
|
+ :key="_index"
|
|
|
|
+ :style="
|
|
|
|
+ _item.p_id
|
|
|
|
+ ? [{ 'margin-left': '10px' }]
|
|
|
|
+ : [{ 'margin-left': '10px' }, { width: '100%' }]
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <div v-if="_item.cld && _item.cld.length > 0">
|
|
|
|
+ <div>
|
|
|
|
+ <div style="font-weight:bold;width:100%">
|
|
|
|
+ {{ _item.title }}:
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-for="(__item, __index) in _item.cld"
|
|
|
|
+ :key="__index"
|
|
|
|
+ :style="
|
|
|
|
+ __item.p_id
|
|
|
|
+ ? [{ 'margin-left': '10px' }]
|
|
|
|
+ : [{ 'margin-left': '10px' }, { width: '100%' }]
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <div v-if="__item.cld && __item.cld.length > 0">
|
|
|
|
+ <span style="font-weight:bold"
|
|
|
|
+ >{{ __item.title }}:</span
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
|
|
|
|
+ >
|
|
|
|
+ <Tooltip
|
|
|
|
+ v-for="(___item, ___index) of __item.cld"
|
|
|
|
+ :key="___index"
|
|
|
|
+ >
|
|
|
|
+ <div slot="content">
|
|
|
|
+ <p>工时:{{ ___item.time }}</p>
|
|
|
|
+ <p>工价:{{ ___item.wages }}</p>
|
|
|
|
+ <p>产能:{{ ___item.capacity }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <Checkbox
|
|
|
|
+ @on-change="
|
|
|
|
+ changeCheck($event, ___item, selectTags)
|
|
|
|
+ "
|
|
|
|
+ v-model="___item.show"
|
|
|
|
+ style="padding: 0px 5px"
|
|
|
|
+ >{{ ___item.title }}</Checkbox
|
|
|
|
+ >
|
|
|
|
+ </Tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <Tooltip v-if="__item.p_id">
|
|
|
|
+ <div slot="content">
|
|
|
|
+ <p>工时:{{ __item.time }}</p>
|
|
|
|
+ <p>工价:{{ __item.wages }}</p>
|
|
|
|
+ <p>产能:{{ __item.capacity }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <Checkbox
|
|
|
|
+ @on-change="
|
|
|
|
+ changeCheck($event, __item, selectTags)
|
|
|
|
+ "
|
|
|
|
+ v-model="__item.show"
|
|
|
|
+ style="padding: 0px 5px"
|
|
|
|
+ >{{ __item.title }}</Checkbox
|
|
|
|
+ >
|
|
|
|
+ </Tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <Tooltip v-if="_item.p_id">
|
|
|
|
+ <div slot="content">
|
|
|
|
+ <p>工时:{{ _item.time }}</p>
|
|
|
|
+ <p>工价:{{ _item.wages }}</p>
|
|
|
|
+ <p>产能:{{ _item.capacity }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <Checkbox
|
|
|
|
+ @on-change="changeCheck($event, _item, selectTags)"
|
|
|
|
+ v-model="_item.show"
|
|
|
|
+ style="padding: 0px 5px"
|
|
|
|
+ >{{ _item.title }}</Checkbox
|
|
|
|
+ >
|
|
|
|
+ </Tooltip>
|
|
|
|
+ <!-- <span v-else>{{ _item.title }}</span> -->
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div v-else>{{ item.title }}</div> -->
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer">
|
|
|
|
+ <Button @click="show_add_detail = false" type="primary" ghost
|
|
|
|
+ >取消</Button
|
|
|
|
+ >
|
|
|
|
+ <Button @click="saveTableData()" type="primary">确定</Button>
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+ </FullPage>
|
|
|
|
+ <Modal
|
|
|
|
+ class-name="vertical-center-modal-PL"
|
|
|
|
+ v-model="test_modal"
|
|
|
|
+ title="打印内容"
|
|
|
|
+ @on-ok="test_run_print(test_url, test_content)"
|
|
|
|
+ >
|
|
|
|
+ <Input type="textarea" v-model="test_content" :rows="40" />
|
|
|
|
+ </Modal>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { SlickList, SlickItem } from "vue-slicksort";
|
|
|
|
+import axios from "axios";
|
|
|
|
+import $ from "jquery";
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ SlickList,
|
|
|
|
+ SlickItem,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ measureModalColumns: [
|
|
|
|
+ {
|
|
|
|
+ title: "部件名称",
|
|
|
|
+ key: "part_title",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "高",
|
|
|
|
+ key: "high",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row, index } = params;
|
|
|
|
+ const currentRow = this.measureModalTableData[index];
|
|
|
|
+ return h("Input", {
|
|
|
|
+ props: {
|
|
|
|
+ value: currentRow.high,
|
|
|
|
+ type: "text",
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ "on-change": (e) => {
|
|
|
|
+ currentRow.high = e.target.value;
|
|
|
|
+ this.measureModalTableData.splice(index, 1, currentRow);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "宽",
|
|
|
|
+ key: "wide",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row, index } = params;
|
|
|
|
+ const currentRow = this.measureModalTableData[index];
|
|
|
|
+ return h("Input", {
|
|
|
|
+ props: {
|
|
|
|
+ value: currentRow.wide,
|
|
|
|
+ type: "text",
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ "on-change": (e) => {
|
|
|
|
+ currentRow.wide = e.target.value;
|
|
|
|
+ this.measureModalTableData.splice(index, 1, currentRow);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "厚",
|
|
|
|
+ key: "thick",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row, index } = params;
|
|
|
|
+ const currentRow = this.measureModalTableData[index];
|
|
|
|
+ return h("Input", {
|
|
|
|
+ props: {
|
|
|
|
+ value: currentRow.thick,
|
|
|
|
+ type: "text",
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ "on-change": (e) => {
|
|
|
|
+ currentRow.thick = e.target.value;
|
|
|
|
+ this.measureModalTableData.splice(index, 1, currentRow);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ measureModalTableData: [],
|
|
|
|
+ test_url: "",
|
|
|
|
+ test_modal: false,
|
|
|
|
+ test_content: null,
|
|
|
|
+ list: [
|
|
|
|
+ {
|
|
|
|
+ title: "楼幢",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "house",
|
|
|
|
+ placeholder: "请选择楼幢",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ title: "单元",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "unit",
|
|
|
|
+ placeholder: "请选择单元",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "楼层",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "layer",
|
|
|
|
+ placeholder: "请选择楼层",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "房号",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "number_detail",
|
|
|
|
+ placeholder: "请选择房号",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "部件",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "part",
|
|
|
|
+ placeholder: "请选择部件",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "产品名称",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "product",
|
|
|
|
+ placeholder: "请选择产品",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "是否存在工艺路线",
|
|
|
|
+ name: "Select",
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "process_router",
|
|
|
|
+ option: [
|
|
|
|
+ { label: "是", value: 1 },
|
|
|
|
+ { label: "否", value: 0 },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // title: "是否贴标签",
|
|
|
|
+ // name: "Select",
|
|
|
|
+ // value: "",
|
|
|
|
+ // serverName: "label",
|
|
|
|
+ // option: [
|
|
|
|
+ // { label: "是", value: 1 },
|
|
|
|
+ // { label: "否", value: 0 },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: '是否绑定芯片',
|
|
|
|
+ // name: 'Select',
|
|
|
|
+ // value: '',
|
|
|
|
+ // serverName: 'status',
|
|
|
|
+ // option: [
|
|
|
|
+ // { label: '是', value: 1 },
|
|
|
|
+ // { label: '否', value: 0 },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ title: "部件状态",
|
|
|
|
+ name: "Select",
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "part_state",
|
|
|
|
+ option: [
|
|
|
|
+ { label: "未下计划", value: 0 },
|
|
|
|
+ { label: "已下计划", value: 1 },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "图号",
|
|
|
|
+ name: "Select",
|
|
|
|
+ multiple: true,
|
|
|
|
+ filterable: true,
|
|
|
|
+ value: "",
|
|
|
|
+ serverName: "img_number",
|
|
|
|
+ placeholder: "请选择图号",
|
|
|
|
+ option: [],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ tableColums: [
|
|
|
|
+ { type: "selection", fixed: "left", width: "100", align: "center" },
|
|
|
|
+ {
|
|
|
|
+ title: "房号",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "number_detail",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row } = params;
|
|
|
|
+ return h(
|
|
|
|
+ "span",
|
|
|
|
+ `${row.house ? row.house + "-" : ""}${
|
|
|
|
+ row.unit ? row.unit + "-" : ""
|
|
|
|
+ }${row.layer ? row.layer + "-" : ""}${
|
|
|
|
+ row.number_detail ? row.number_detail : ""
|
|
|
|
+ }`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ { title: "单价", align: "center", key: "price", minWidth: 100 },
|
|
|
|
+ { title: "产品", align: "center", key: "product_title", minWidth: 150 },
|
|
|
|
+ {
|
|
|
|
+ title: "图纸",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "img_url",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row } = params;
|
|
|
|
+ return h("img", {
|
|
|
|
+ attrs: {
|
|
|
|
+ src:
|
|
|
|
+ this.$store.state.ip +
|
|
|
|
+ (params.row.url[0] ? params.row.url[0].img_url : ""),
|
|
|
|
+ style:
|
|
|
|
+ "max-width:50px;max-height:50px;position:relative;top:3px;",
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ click: (e) => {
|
|
|
|
+ this.$previewImg({
|
|
|
|
+ list: row.url,
|
|
|
|
+ baseUrl: this.$store.state.ip,
|
|
|
|
+ baseImgField: "img_url",
|
|
|
|
+ baseTitleField: "title",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ title: "图号",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "url_number",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "位置",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "position",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ },
|
|
|
|
+ { title: "部件名", align: "center", key: "part_title", minWidth: 200 },
|
|
|
|
+ {
|
|
|
|
+ title: "部件测量数据",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "measure",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "部件相关",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "properties",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "芯片",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "chip",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ tooltip: true,
|
|
|
|
+ tooltipTheme: "light",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "工艺要求",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "rework_require",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // title: "部件是否贴标签",
|
|
|
|
+ // align: "center",
|
|
|
|
+ // minWidth: 150,
|
|
|
|
+ // render: (h, params) =>
|
|
|
|
+ // h("span", {}, params.row.label == 0 ? "否" : "是"),
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: "零部件名称",
|
|
|
|
+ // align: "center",
|
|
|
|
+ // key: "sub_label",
|
|
|
|
+ // minWidth: 200,
|
|
|
|
+ // render: (h, params) => {
|
|
|
|
+ // const { row } = params;
|
|
|
|
+ // return h(
|
|
|
|
+ // "Tooltip",
|
|
|
|
+ // {
|
|
|
|
+ // props: {
|
|
|
|
+ // content: row.sub_label,
|
|
|
|
+ // placement: "top",
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ // [
|
|
|
|
+ // h(
|
|
|
|
+ // "div",
|
|
|
|
+ // {
|
|
|
|
+ // props: {},
|
|
|
|
+ // style: {
|
|
|
|
+ // width: "100px",
|
|
|
|
+ // overflow: "hidden",
|
|
|
|
+ // whiteSpace: "nowrap",
|
|
|
|
+ // textOverflow: "ellipsis",
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ // row.sub_label
|
|
|
|
+ // ),
|
|
|
|
+ // ]
|
|
|
|
+ // );
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: "零部件是否贴标签",
|
|
|
|
+ // align: "center",
|
|
|
|
+ // minWidth: 200,
|
|
|
|
+ // render: (h, params) =>
|
|
|
|
+ // h("span", {}, params.row.sub_is_tag == 0 ? "否" : "是"),
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ title: "部件状态",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h("span", {}, params.row.part_state == 0 ? "未下计划" : "已下计划"),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "预估完工工期",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "predict_time",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h("span", `${(params.row.predict_time / 8).toFixed(1)}天`),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "操作",
|
|
|
|
+ align: "center",
|
|
|
|
+ slot: "set",
|
|
|
|
+ width: "200",
|
|
|
|
+ fixed: "right",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ tableData: [],
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ total: 100,
|
|
|
|
+ showModal: false,
|
|
|
|
+ showType: 1,
|
|
|
|
+ logList: [],
|
|
|
|
+ classInfo: {},
|
|
|
|
+ proxyObj: {},
|
|
|
|
+ showPlan: false,
|
|
|
|
+ planInfo: {
|
|
|
|
+ pr_id: null,
|
|
|
|
+ start_time: "",
|
|
|
|
+ end_time: "",
|
|
|
|
+ },
|
|
|
|
+ selects: [],
|
|
|
|
+ order_no: null,
|
|
|
|
+ loading: false,
|
|
|
|
+ showChip: false,
|
|
|
|
+ chipInfo: {},
|
|
|
|
+ showBatchModal: false,
|
|
|
|
+ batchTablePartsColumn: [
|
|
|
|
+ { type: "selection", fixed: "left", minWidth: 90, align: "center" },
|
|
|
|
+ {
|
|
|
|
+ title: "项目名称",
|
|
|
|
+ key: "residential_name",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 200,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "房号",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "number_detail",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ render: (h, params) => {
|
|
|
|
+ const { row } = params;
|
|
|
|
+ return h(
|
|
|
|
+ "span",
|
|
|
|
+ `${row.house}-${row.unit}-${row.layer}-${row.number_detail}`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "产品",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "product_title",
|
|
|
|
+ minWidth: 150,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "位置",
|
|
|
|
+ align: "center",
|
|
|
|
+ key: "position",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // title: "部件",
|
|
|
|
+ // key: "",
|
|
|
|
+ // align: "center",
|
|
|
|
+ // key: "part_title",
|
|
|
|
+ // minWidth: 100,
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: "部件是否贴标签",
|
|
|
|
+ // key: "",
|
|
|
|
+ // align: "center",
|
|
|
|
+ // minWidth: 200,
|
|
|
|
+ // render: (h, params) =>
|
|
|
|
+ // h("span", {}, params.row.label == 1 ? "是" : "否"),
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ title: "零部件是否贴标签",
|
|
|
|
+ key: "",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 150,
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h("span", {}, params.row.sub_is_tag == 1 ? "是" : "否"),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "操作",
|
|
|
|
+ align: "center",
|
|
|
|
+ width: "100",
|
|
|
|
+ fixed: "right",
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h(
|
|
|
|
+ "a",
|
|
|
|
+ {
|
|
|
|
+ on: {
|
|
|
|
+ click: () => this.batchTablePartsData.splice(params.index, 1),
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ "删除"
|
|
|
|
+ ),
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ batchTablePartsData: [],
|
|
|
|
+ batchChipColumns: [
|
|
|
|
+ { title: "芯片编码", key: "", align: "center", key: "tag" },
|
|
|
|
+ {
|
|
|
|
+ title: "扫码时间",
|
|
|
|
+ key: "",
|
|
|
|
+ align: "center",
|
|
|
|
+ minWidth: 100,
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h("span", {}, this.func.replaceDate(params.row.scan_time * 1)),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "操作",
|
|
|
|
+ key: "",
|
|
|
|
+ align: "center",
|
|
|
|
+ render: (h, params) =>
|
|
|
|
+ h(
|
|
|
|
+ "a",
|
|
|
|
+ {
|
|
|
|
+ on: {
|
|
|
|
+ click: () => this.batchChipData.splice(params.index, 1),
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ "删除"
|
|
|
|
+ ),
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ batchChipData: [],
|
|
|
|
+ batchPageIndex: 1,
|
|
|
|
+ batchPageSize: 10,
|
|
|
|
+ batchTotal: 10,
|
|
|
|
+ batchSelectArray: [],
|
|
|
|
+ wxsoect: null,
|
|
|
|
+ arrList: [],
|
|
|
|
+ show_add_detail: false,
|
|
|
|
+ show_add: false,
|
|
|
|
+ processLineTableData: [],
|
|
|
|
+ info: {
|
|
|
|
+ title: "",
|
|
|
|
+ price: "",
|
|
|
|
+ parts_id: "",
|
|
|
|
+ id: null,
|
|
|
|
+ properties: [], //工序号
|
|
|
|
+ procedure: [], //工艺属性id
|
|
|
|
+ list: [],
|
|
|
|
+ bps: [],
|
|
|
|
+ procedure_id: "",
|
|
|
|
+ },
|
|
|
|
+ selectTags: [], //已选列表
|
|
|
|
+ tempProcessLine: {
|
|
|
|
+ title: "",
|
|
|
|
+ },
|
|
|
|
+ processLineColumns: [
|
|
|
|
+ { title: "序号", type: "index", align: "center", key: "" },
|
|
|
|
+ // { title: 'ID', align: 'center', key: 'id' },
|
|
|
|
+ { title: "工艺路线名称", align: "center", key: "title" },
|
|
|
|
+ { title: "操作", align: "center", key: "id", slot: "processLineSet" },
|
|
|
|
+ ],
|
|
|
|
+ showMeasureModal: false,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getOptions();
|
|
|
|
+ // const wxsoect = new WebSocket("ws://localhost:8080");
|
|
|
|
+ // this.wxsoect = wxsoect;
|
|
|
|
+ // console.log("this.wxsoect :>> ", this.wxsoect);
|
|
|
|
+ // wxsoect.onopen = function(evt) {
|
|
|
|
+ // console.log(`已成功打开`);
|
|
|
|
+ // };
|
|
|
|
+
|
|
|
|
+ // wxsoect.onclose = function(evt) {
|
|
|
|
+ // console.log(`已断开socket连接`);
|
|
|
|
+ // };
|
|
|
|
+ // wxsoect.onerror = function(err) {
|
|
|
|
+ // throw new Error(err);
|
|
|
|
+ // };
|
|
|
|
+ // wxsoect.onmessage = function(message) {
|
|
|
|
+ // console.log(message);
|
|
|
|
+ // };
|
|
|
|
+ this.axios("/api/bp_list").then((res) => {
|
|
|
|
+ this.info.bps = res.data;
|
|
|
|
+ });
|
|
|
|
+ this.axios("/api/bpp_list").then((res) => {
|
|
|
|
+ res.data.map((v) => {
|
|
|
|
+ if (v.select) {
|
|
|
|
+ v.cld.map((z) => {
|
|
|
|
+ v.select.map((k) => {
|
|
|
|
+ z.show = k == z.id ? true : false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ v.cld.map((v) => (v.show = false));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.info.list = res.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ init(row) {
|
|
|
|
+ this.pageIndex = 1;
|
|
|
|
+ row.page_index = this.pageIndex;
|
|
|
|
+ row.page_size = this.pageSize;
|
|
|
|
+ Object.assign(row, this.$route.query);
|
|
|
|
+ if (this.func.isType(row.house) == "Array") {
|
|
|
|
+ row.house = row.house.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.unit) == "Array") {
|
|
|
|
+ row.unit = row.unit.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.layer) == "Array") {
|
|
|
|
+ row.layer = row.layer.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.number_detail) == "Array") {
|
|
|
|
+ row.number_detail = row.number_detail.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.part) == "Array") {
|
|
|
|
+ row.part = row.part.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.product) == "Array") {
|
|
|
|
+ row.product = row.product.join(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.func.isType(row.img_number) == "Array") {
|
|
|
|
+ row.img_number = row.img_number.join(",");
|
|
|
|
+ }
|
|
|
|
+ this.proxyObj = row;
|
|
|
|
+ this.getData(row);
|
|
|
|
+ },
|
|
|
|
+ getData(row) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.axios("/api/orders_produce_parts_list", { params: row }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ this.order_no = res.data.order_no;
|
|
|
|
+ this.logList = res.data.detail;
|
|
|
|
+ this.tableData = res.data.list;
|
|
|
|
+ this.total = res.data.total;
|
|
|
|
+ res.data.house.map((v) => {
|
|
|
|
+ v.value = v.house;
|
|
|
|
+ v.label = v.house;
|
|
|
|
+ });
|
|
|
|
+ res.data.unit.map((v) => {
|
|
|
|
+ v.value = v.unit;
|
|
|
|
+ v.label = v.unit;
|
|
|
|
+ });
|
|
|
|
+ res.data.layer.map((v) => {
|
|
|
|
+ v.value = v.layer;
|
|
|
|
+ v.label = v.layer;
|
|
|
|
+ });
|
|
|
|
+ res.data.number_detail.map((v) => {
|
|
|
|
+ v.value = v.number;
|
|
|
|
+ v.label = v.number;
|
|
|
|
+ });
|
|
|
|
+ res.data.part.map((v) => {
|
|
|
|
+ v.value = v.title;
|
|
|
|
+ v.label = v.title;
|
|
|
|
+ });
|
|
|
|
+ res.data.img_number.map((v) => {
|
|
|
|
+ v.value = v.title;
|
|
|
|
+ v.label = v.title;
|
|
|
|
+ });
|
|
|
|
+ this.list[0].option = res.data.house;
|
|
|
|
+ this.list[1].option = res.data.unit;
|
|
|
|
+ this.list[2].option = res.data.layer;
|
|
|
|
+ this.list[3].option = res.data.number_detail;
|
|
|
|
+ this.list[4].option = res.data.part;
|
|
|
|
+ this.list[9].option = res.data.img_number;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ getOptions() {
|
|
|
|
+ this.axios("/api/order_detail_word", {
|
|
|
|
+ params: { order_no: this.$route.query.order_no },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ res.data.part.map((v) => {
|
|
|
|
+ v.value = v.title;
|
|
|
|
+ v.label = v.title;
|
|
|
|
+ });
|
|
|
|
+ res.data.produce.map((v) => {
|
|
|
|
+ v.value = v.title;
|
|
|
|
+ v.label = v.title;
|
|
|
|
+ });
|
|
|
|
+ res.data.product.map((v) => {
|
|
|
|
+ v.value = v.title;
|
|
|
|
+ v.label = v.title;
|
|
|
|
+ });
|
|
|
|
+ // for (let i in res.data.url_number) {
|
|
|
|
+ // var j = {};
|
|
|
|
+ // j.value = res.data.url_number[i];
|
|
|
|
+ // j.title = res.data.url_number[i];
|
|
|
|
+ // j.lable = res.data.url_number[i];
|
|
|
|
+ // this.arrList.push(j);
|
|
|
|
+ // }
|
|
|
|
+ // res.data.url_number.map((v) => {
|
|
|
|
+ // var j = {};
|
|
|
|
+ // j.value = v;
|
|
|
|
+ // j.label = v;
|
|
|
|
+ // j.title = v;
|
|
|
|
+ // this.arrList.push(j);
|
|
|
|
+ // });
|
|
|
|
+ res.data.url_number.map((v) => {
|
|
|
|
+ v.value = v.url_number;
|
|
|
|
+ v.label = v.url_number;
|
|
|
|
+ });
|
|
|
|
+ // this.list[0].option = res.data.house;
|
|
|
|
+ // this.list[1].option = res.data.unit;
|
|
|
|
+ // this.list[2].option = res.data.layer;
|
|
|
|
+ // this.list[3].option = res.data.number_detail;
|
|
|
|
+ this.list[4].option = res.data.part;
|
|
|
|
+ this.list[5].option = res.data.product;
|
|
|
|
+ this.list[9].option = res.data.url_number;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changePage(e) {
|
|
|
|
+ this.pageIndex = e;
|
|
|
|
+ this.proxyObj.page_index = e;
|
|
|
|
+ this.getData(this.proxyObj);
|
|
|
|
+ },
|
|
|
|
+ changeSize(e) {
|
|
|
|
+ this.pageSize = e;
|
|
|
|
+ this.proxyObj.page_size = this.pageSize;
|
|
|
|
+ this.getData(this.proxyObj);
|
|
|
|
+ },
|
|
|
|
+ back() {
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
+ },
|
|
|
|
+ openModal(row) {
|
|
|
|
+ if (Array.isArray(row)) {
|
|
|
|
+ //批量下生产操作
|
|
|
|
+ if (row.length < 1) {
|
|
|
|
+ return this.$Message.warning("请至少选择一项");
|
|
|
|
+ }
|
|
|
|
+ let result = [];
|
|
|
|
+ row.map((v) => result.push(v.pr_id));
|
|
|
|
+ this.planInfo.pr_id = result.join(",");
|
|
|
|
+ } else {
|
|
|
|
+ //单个下生产
|
|
|
|
+ this.planInfo.pr_id = row.pr_id;
|
|
|
|
+ }
|
|
|
|
+ this.downProduction({
|
|
|
|
+ title: "下生产排产",
|
|
|
|
+ type: 1,
|
|
|
|
+ params: this.planInfo,
|
|
|
|
+ then: (e) => {
|
|
|
|
+ this.getData(this.proxyObj);
|
|
|
|
+ },
|
|
|
|
+ cancel: (e) => {},
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ selectTable(e) {
|
|
|
|
+ this.selects = e;
|
|
|
|
+ },
|
|
|
|
+ vivibleModal(e) {
|
|
|
|
+ if (!e) {
|
|
|
|
+ this.planInfo = {
|
|
|
|
+ order_no: null,
|
|
|
|
+ start_time: "",
|
|
|
|
+ end_time: "",
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ downImg(url, filename) {
|
|
|
|
+ if (!url) {
|
|
|
|
+ return this.$Message.error("暂无可下载资源");
|
|
|
|
+ }
|
|
|
|
+ let img = new Image();
|
|
|
|
+ img.onload = (e) => {
|
|
|
|
+ const canvas = document.createElement("canvas");
|
|
|
|
+ canvas.width = img.width;
|
|
|
|
+ canvas.height = img.height;
|
|
|
|
+ if (canvas.getContext) {
|
|
|
|
+ let context = canvas.getContext("2d");
|
|
|
|
+ context.drawImage(img, 0, 0, img.width, img.height); //绘制图纸
|
|
|
|
+ let downUrl = canvas.toDataURL("image/png");
|
|
|
|
+ let link = document.createElement("a");
|
|
|
|
+ link.href = downUrl;
|
|
|
|
+ link.style.display = "none";
|
|
|
|
+ link.download = filename || "图纸.png"; // 文件名称
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ URL.revokeObjectURL(link.href); //释放URL对象
|
|
|
|
+ document.body.removeChild(link);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ img.src = this.$store.state.ip + url;
|
|
|
|
+ img.crossOrigin = "anonymous";
|
|
|
|
+ },
|
|
|
|
+ bingChip(row) {
|
|
|
|
+ this.showChip = true;
|
|
|
|
+ this.chipInfo.pr_id = row.pr_id;
|
|
|
|
+ },
|
|
|
|
+ saveChip() {
|
|
|
|
+ this.axios.post("/api/tag_bind", this.chipInfo).then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$Message.success(res.msg || "操作成功");
|
|
|
|
+ this.getData(this.proxyObj);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ vivibleModal(e) {
|
|
|
|
+ if (!e) {
|
|
|
|
+ this.chipInfo = {};
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getChipData() {
|
|
|
|
+ this.axios("/api/tag_list", {
|
|
|
|
+ params: {
|
|
|
|
+ page_size: this.batchPageSize,
|
|
|
|
+ page_index: this.pageIndex,
|
|
|
|
+ status: 0,
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ res.code == 200
|
|
|
|
+ ? (() => {
|
|
|
|
+ this.batchChipData = res.data.data;
|
|
|
|
+ this.batchTotal = res.data.total;
|
|
|
|
+ })()
|
|
|
|
+ : "";
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ visibleBatchModal(e) {
|
|
|
|
+ if (e) {
|
|
|
|
+ this.getChipData();
|
|
|
|
+ this.batchTablePartsData = this.selects;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ batchSelect(e) {
|
|
|
|
+ this.batchSelectArray = e;
|
|
|
|
+ },
|
|
|
|
+ batchBindChip() {
|
|
|
|
+ if (!this.batchSelectArray.length) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ let pr_id = "",
|
|
|
|
+ tag = "";
|
|
|
|
+ this.batchSelectArray.forEach((v, i) => {
|
|
|
|
+ this.batchChipData[i].tag
|
|
|
|
+ ? (() => {
|
|
|
|
+ pr_id +=
|
|
|
|
+ v.pr_id + (i == this.batchSelectArray.length - 1 ? "" : ",");
|
|
|
|
+ tag +=
|
|
|
|
+ this.batchChipData[i].tag +
|
|
|
|
+ (i == this.batchSelectArray.length - 1 ? "" : ",");
|
|
|
|
+ })()
|
|
|
|
+ : "";
|
|
|
|
+ });
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/tag_bind", { pr_id: pr_id, tag: tag })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$Message.success(res.msg || "操作成功");
|
|
|
|
+ this.getData(this.proxyObj);
|
|
|
|
+ this.showBatchModal = false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ batchSelectRouter() {
|
|
|
|
+ if (this.selects.length < 1) {
|
|
|
|
+ return this.$Message.error("请至少选择一项");
|
|
|
|
+ }
|
|
|
|
+ this.show_add = true;
|
|
|
|
+ this.handleSearchProcessLine(this.tempProcessLine.title);
|
|
|
|
+ return;
|
|
|
|
+ this.selectProcessRouter({
|
|
|
|
+ params: {
|
|
|
|
+ id: this.selects.reduce(
|
|
|
|
+ (pre, cur, index) =>
|
|
|
|
+ (pre +=
|
|
|
|
+ cur.pr_id + `${index == this.selects.length - 1 ? "" : ","}`),
|
|
|
|
+ ""
|
|
|
|
+ ),
|
|
|
|
+ },
|
|
|
|
+ then: () => {},
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleProcessLineSet(row, index) {
|
|
|
|
+ this.info.id = row.id;
|
|
|
|
+ this.info.title = row.title;
|
|
|
|
+ this.info.procedure_id = row.procedure_id;
|
|
|
|
+ this.selectTags = [];
|
|
|
|
+ const arr = this.info.procedure_id
|
|
|
|
+ ? this.info.procedure_id.split(",")
|
|
|
|
+ : [];
|
|
|
|
+ for (const key in this.info.bps) {
|
|
|
|
+ const el = this.info.bps[key];
|
|
|
|
+ el.cld.forEach((z) => {
|
|
|
|
+ z.show = false;
|
|
|
|
+ z.cld &&
|
|
|
|
+ z.cld.length > 0 &&
|
|
|
|
+ z.cld.forEach((elem) => {
|
|
|
|
+ elem.show = false;
|
|
|
|
+ elem.cld &&
|
|
|
|
+ elem.cld.length > 0 &&
|
|
|
|
+ elem.cld.forEach((ele) => {
|
|
|
|
+ ele.show = false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ arr.forEach((element) => {
|
|
|
|
+ for (const key in this.info.bps) {
|
|
|
|
+ const el = this.info.bps[key];
|
|
|
|
+ for (const k in el.cld) {
|
|
|
|
+ const e = el.cld[k];
|
|
|
|
+ if (e.id == element) {
|
|
|
|
+ e.show = true;
|
|
|
|
+ e.p_id && this.selectTags.push(e);
|
|
|
|
+ }
|
|
|
|
+ e.cld &&
|
|
|
|
+ e.cld.length > 0 &&
|
|
|
|
+ e.cld.forEach((z) => {
|
|
|
|
+ if (z.id == element) {
|
|
|
|
+ z.show = true;
|
|
|
|
+ z.p_id && this.selectTags.push(z);
|
|
|
|
+ }
|
|
|
|
+ z.cld &&
|
|
|
|
+ z.cld.length > 0 &&
|
|
|
|
+ z.cld.forEach((elem) => {
|
|
|
|
+ if (elem.id == element) {
|
|
|
|
+ elem.show = true;
|
|
|
|
+ elem.p_id && this.selectTags.push(elem);
|
|
|
|
+ }
|
|
|
|
+ elem.cld &&
|
|
|
|
+ elem.cld.length > 0 &&
|
|
|
|
+ elem.cld.forEach((ele) => {
|
|
|
|
+ if (ele.id == element) {
|
|
|
|
+ ele.show = true;
|
|
|
|
+ ele.p_id && this.selectTags.push(ele);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.show_add_detail = true;
|
|
|
|
+ this.show_add = false;
|
|
|
|
+ },
|
|
|
|
+ handleSearchProcessLine(title) {
|
|
|
|
+ this.axios({
|
|
|
|
+ method: "get",
|
|
|
|
+ url: "/api/technological_route",
|
|
|
|
+ params: {
|
|
|
|
+ title,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.processLineTableData = res.data.data;
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {});
|
|
|
|
+ },
|
|
|
|
+ openMeasureModal(row) {
|
|
|
|
+ if (row.length < 1) {
|
|
|
|
+ return this.$Message.warning("请至少选择一项");
|
|
|
|
+ }
|
|
|
|
+ this.measureModalTableData = [];
|
|
|
|
+ row.map((v) => {
|
|
|
|
+ let measure = v.measure.split("*");
|
|
|
|
+ this.measureModalTableData.push({
|
|
|
|
+ id: v.pr_id,
|
|
|
|
+ part_title: v.part_title,
|
|
|
|
+ high: measure[0],
|
|
|
|
+ wide: measure[1],
|
|
|
|
+ thick: measure[2],
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.showMeasureModal = true;
|
|
|
|
+ },
|
|
|
|
+ handleMeasureModalConfirm() {
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/update_product_pr_measure", {
|
|
|
|
+ ...this.measureModalTableData,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$Message.success("修改成功");
|
|
|
|
+ this.showMeasureModal = false;
|
|
|
|
+ this.init(this.proxyObj);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ openShipModal(row) {
|
|
|
|
+ // if (this.wxsoect.readyState != 1) {
|
|
|
|
+ // return this.$Message.error("打印机未正常连接,请检查");
|
|
|
|
+ // }
|
|
|
|
+ // if (Array.isArray(row) && row.length < 1) {
|
|
|
|
+ // return this.$Message.warning("请先择");
|
|
|
|
+ // }
|
|
|
|
+ const result = row.map((pre) => pre.id);
|
|
|
|
+ this.confirmDelete({
|
|
|
|
+ title: "批量打印芯片",
|
|
|
|
+ type: "primary",
|
|
|
|
+ content: "确认批量打印么?",
|
|
|
|
+ then: (res) => {
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/print_ship", {
|
|
|
|
+ ...this.proxyObj,
|
|
|
|
+ ids: result.join(","),
|
|
|
|
+ })
|
|
|
|
+ .then((resp) => {
|
|
|
|
+ if (resp.code == 200) {
|
|
|
|
+ const result = resp.data;
|
|
|
|
+ console.log(result, "多打印");
|
|
|
|
+ this.handlePrintChips(resp.data);
|
|
|
|
+ // if (result && result.length > 0) {
|
|
|
|
+ // result.map((ele) => this.printDemo(ele));
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ test_run_print(url, data) {
|
|
|
|
+ let sub_data = JSON.parse(data);
|
|
|
|
+ sub_data.printparams = JSON.stringify(sub_data.printparams);
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "post",
|
|
|
|
+ url,
|
|
|
|
+ data: sub_data,
|
|
|
|
+ dataType: "json",
|
|
|
|
+ timeout: 5000,
|
|
|
|
+ success: function(result) {
|
|
|
|
+ if (result.retval == "0") {
|
|
|
|
+ this.$Message.success("发送成功");
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.error("发送失败,返回结果:" + result.msg);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handlePrintChips(contents) {
|
|
|
|
+ this.axios.get("/api/get_print_url").then((res) => {
|
|
|
|
+ let data = {};
|
|
|
|
+ // let url = "http://192.168.0.145:888/postek/print"; //request_url
|
|
|
|
+ let url = `http://${res.data.request_url}:888/postek/print`; //request_url
|
|
|
|
+ data.reqParam = "1";
|
|
|
|
+ let printparamsJsonArray = [];
|
|
|
|
+ // let IP = "192.168.1.58";//print_url
|
|
|
|
+ // let IP = "192.168.0.199"; //print_url
|
|
|
|
+ let IP = res.data.print_url;
|
|
|
|
+ let port = 9100;
|
|
|
|
+ let IP_Port = IP + "," + port;
|
|
|
|
+ printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
|
|
|
|
+ printparamsJsonArray.push({ PTK_ClearBuffer: "" });
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetDirection: "B" });
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetDarkness: "10" });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
|
|
|
|
+ contents.map((content) => {
|
|
|
|
+ //贝斯特打印格式
|
|
|
|
+ //上
|
|
|
|
+ const printContent_l1 = `项目:${content.client_name}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l1_2 = `区域:${
|
|
|
|
+ content.house ? content.house + "-" : ""
|
|
|
|
+ }${content.layer ? content.layer : ""}${
|
|
|
|
+ content.position ? content.position : ""
|
|
|
|
+ }`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l2 = `房号:${content.number_detail}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l2_2 = `产品:${content.product_title}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l3 = `图号:${content.url_number}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l3_2 = `部件:${content.part_title}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l4 = `木皮:${content.color_title}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
|
|
|
|
+ });
|
|
|
|
+ const printContent_l4_2 = `尺寸:${content.measure}`;
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
|
|
|
|
+ });
|
|
|
|
+ //下
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType:
|
|
|
|
+ "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
|
|
|
|
+ });
|
|
|
|
+ // 17,35 420
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_RWRFIDLabel:
|
|
|
|
+ "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
|
|
|
|
+ });
|
|
|
|
+ // contents.map((content) => {
|
|
|
|
+ // //江山打印格式
|
|
|
|
+ // //上
|
|
|
|
+ // const printContent_l1 = `单号:${content.order_no}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
|
|
|
|
+ // });
|
|
|
|
+ // const printContent_l1_2 = `型号:${content.product_title}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
|
|
|
|
+ // });
|
|
|
|
+ // const printContent_l2 = `尺寸:${content.measure}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
|
|
|
|
+ // });
|
|
|
|
+ // const printContent_l2_2 = `工艺:${content.process_title}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
|
|
|
|
+ // });
|
|
|
|
+ // const printContent_l3 = `颜色:${content.color_title}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
|
|
|
|
+ // });
|
|
|
|
+ // const printContent_l3_2 = `部件:${content.part_title}`;
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
|
|
|
|
+ // });
|
|
|
|
+ // //下
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_DrawText_TrueType:
|
|
|
|
+ // "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({
|
|
|
|
+ // PTK_RWRFIDLabel:
|
|
|
|
+ // "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
|
|
|
|
+ // });
|
|
|
|
+ // printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ printparamsJsonArray.push({ PTK_CloseConnect: "" });
|
|
|
|
+ data.printparams = printparamsJsonArray;
|
|
|
|
+ // data.printparams = JSON.stringify(printparamsJsonArray);
|
|
|
|
+ this.test_content = JSON.stringify(data);
|
|
|
|
+ this.test_url = url;
|
|
|
|
+ this.test_modal = true;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleConnectPrinter() {
|
|
|
|
+ let data = {};
|
|
|
|
+ data.reqParam = "1";
|
|
|
|
+ let printparamsJsonArray = [];
|
|
|
|
+ //若有且仅有一台POSTEK打印机 不用去获取USB端口号 usbPort=255即可
|
|
|
|
+ printparamsJsonArray.push({ PTK_OpenUSBPort: 255 });
|
|
|
|
+ //清空缓存
|
|
|
|
+ printparamsJsonArray.push({ PTK_ClearBuffer: "" });
|
|
|
|
+ //设置打印方向 B为从底部开始打印 T为从顶部开始打印
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetDirection: "B" });
|
|
|
|
+ //设置打印速度 最高速度由打印机的型号决定
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
|
|
|
|
+ //设置打印黑度 最大打印黑度20 树脂碳带一般设置15左右
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetDarkness: "10" });
|
|
|
|
+ //必须正确设置标签的宽高--防止内容打偏 宽高可用尺子量取也可以查看标签的规格 一般桌面型打印机的最大打印宽度为110毫米 实际有效打印宽度根据打印机的参数决定
|
|
|
|
+ // {"PTK_SetLabelHeight" : "height,gap,gapOffset,bFlag"}
|
|
|
|
+ // height:标签的高度,以点(dots)为单位。取值:0 - 65535 的正整数
|
|
|
|
+ // gap:标签间的定位间隙\黑标\穿孔的高度,以点(dots)为单位。
|
|
|
|
+ // 取值:0 – 65535 的正整数。
|
|
|
|
+ // 当 gap=0 时,设置标签为连续纸;当实际标签不是连续纸而 gap 设置为 0
|
|
|
|
+ // 时会出现打印内容偏移的现象
|
|
|
|
+ // gapOffset:标签间隙\黑线\穿孔定位偏移值,以点(dots)为单位,参数类型为正
|
|
|
|
+ // 整数
|
|
|
|
+ // bFlag:定位偏移值(gapOffset)是否有效;true - 有效,false - 无效
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_SetLabelHeight: 75 + "," + 2 + ",0,false",
|
|
|
|
+ });
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetLabelWidth: 10 });
|
|
|
|
+ //打印一行微软雅黑的文字 具体的参数函数请参考开发文档
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetFontGap: "10" });
|
|
|
|
+
|
|
|
|
+ // {"PTK_DrawText" : "x,y,pdirec,pFont,pHorizontal,pVertical,pColor,pstr"}
|
|
|
|
+
|
|
|
|
+ // pColor:文本样式,参数值及说明如下 N - 白底黑字,R - 黑底白字
|
|
|
|
+ printparamsJsonArray.push({
|
|
|
|
+ PTK_DrawText_TrueType: "10,10,0,6,2,2,N," + $("#printlabel").val(),
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ //执行打印 必须有PTK_PrintLabel 否则不执行打印 {"PTK_PrintLabel" : "number,cpnumber"}
|
|
|
|
+ // number:打印标签的数量。取值:1 – 65535 的正整数
|
|
|
|
+ // cpnumber:每张标签的复制份数。取值:1 – 65535 的正整数
|
|
|
|
+ printparamsJsonArray.push({ PTK_CloseConnect: "" });
|
|
|
|
+ //执行打印完关闭打印机USB端口
|
|
|
|
+ printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
|
|
|
|
+ },
|
|
|
|
+ printDemo(data) {
|
|
|
|
+ if (!data) return 0;
|
|
|
|
+ const st = this.wxsoect;
|
|
|
|
+ const {
|
|
|
|
+ client_name,
|
|
|
|
+ product_title,
|
|
|
|
+ part_title,
|
|
|
|
+ measure,
|
|
|
|
+ process,
|
|
|
|
+ url_number,
|
|
|
|
+ chip,
|
|
|
|
+ house,
|
|
|
|
+ unit,
|
|
|
|
+ layer,
|
|
|
|
+ number_detail,
|
|
|
|
+ position,
|
|
|
|
+ } = data;
|
|
|
|
+ st.send("OpenPort|255");
|
|
|
|
+ st.send("ZM_ClearBuffer");
|
|
|
|
+ st.send("ZM_SetPrintSpeed|4");
|
|
|
|
+ st.send("ZM_SetDarkness|12");
|
|
|
|
+
|
|
|
|
+ if (location.origin.indexOf("121.37.173.82") > -1) {
|
|
|
|
+ st.send("ZM_SetLabelHeight|136|32");
|
|
|
|
+ } else {
|
|
|
|
+ st.send("ZM_SetLabelHeight|160|16");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ st.send("ZM_SetLabelWidth|664");
|
|
|
|
+ st.send(
|
|
|
|
+ `ZM_DrawTextTrueTypeW|70|10|24|0|Arial|1|600|0|0|0|A1| 项目:${client_name ||
|
|
|
|
+ ""} 图号:${url_number ||
|
|
|
|
+ ""} 区域: ${house}号楼(${unit}单元)-${layer}层${number_detail} || "}`
|
|
|
|
+ );
|
|
|
|
+ st.send(
|
|
|
|
+ `ZM_DrawTextTrueTypeW|70|40|24|0|Arial|1|600|0|0|0|A2| 产品:${product_title ||
|
|
|
|
+ ""} 部件:${part_title || ""} `
|
|
|
|
+ );
|
|
|
|
+ st.send(
|
|
|
|
+ `ZM_DrawTextTrueTypeW|70|70|24|0|Arial|1|600|0|0|0|A3| 材料: ${process ||
|
|
|
|
+ ""} `
|
|
|
|
+ );
|
|
|
|
+ st.send(
|
|
|
|
+ `ZM_DrawTextTrueTypeW|70|100|24|0|Arial|1|600|0|0|0|A4| 尺寸: ${measure ||
|
|
|
|
+ ""} 位置:${position || ""}`
|
|
|
|
+ );
|
|
|
|
+ st.send(`ZM_RW_RfidFormat|1|0|0|${chip.length}|1|${chip}`);
|
|
|
|
+ st.send("ZM_PrintLabel_R|1|1");
|
|
|
|
+ st.send("ClosePort");
|
|
|
|
+ },
|
|
|
|
+ // printDemo(data) {
|
|
|
|
+ // console.log(data);
|
|
|
|
+ // if (!data) return 0;
|
|
|
|
+ // const st = this.wxsoect;
|
|
|
|
+ // const {
|
|
|
|
+ // client_name,
|
|
|
|
+ // product_title,
|
|
|
|
+ // part_title,
|
|
|
|
+ // measure,
|
|
|
|
+ // process,
|
|
|
|
+ // url_number,
|
|
|
|
+ // chip,
|
|
|
|
+ // } = data;
|
|
|
|
+ // st.send("OpenPort|255");
|
|
|
|
+ // st.send("ZM_ClearBuffer");
|
|
|
|
+ // st.send("ZM_SetPrintSpeed|4");
|
|
|
|
+ // st.send("ZM_SetDarkness|12");
|
|
|
|
+ // st.send("ZM_SetLabelHeight|160|16");
|
|
|
|
+ // st.send("ZM_SetLabelWidth|664");
|
|
|
|
+ // st.send(
|
|
|
|
+ // `ZM_DrawTextTrueTypeW|40|0|36|0|Arial|1|600|0|0|0|A1|项目名称:${
|
|
|
|
+ // client_name || ""
|
|
|
|
+ // } 产品名称:${product_title || ""}`
|
|
|
|
+ // );
|
|
|
|
+ // st.send(
|
|
|
|
+ // `ZM_DrawTextTrueTypeW|40|60|36|0|Arial|1|600|0|0|0|A3|部件名称:${
|
|
|
|
+ // part_title || ""
|
|
|
|
+ // } 规格:${measure || ""}`
|
|
|
|
+ // );
|
|
|
|
+ // st.send(
|
|
|
|
+ // `ZM_DrawTextTrueTypeW|40|120|36|0|Arial|1|600|0|0|0|A2|饰面:${
|
|
|
|
+ // process || ""
|
|
|
|
+ // } 图号:${url_number || ""}`
|
|
|
|
+ // );
|
|
|
|
+ // st.send(`ZM_RW_RfidFormat|1|0|0|${chip.length}|1|${chip}`);
|
|
|
|
+ // st.send("ZM_PrintLabel_R|1|1");
|
|
|
|
+ // st.send("ClosePort");
|
|
|
|
+ // },
|
|
|
|
+ printChip(rows) {
|
|
|
|
+ // if (this.wxsoect.readyState != 1) {
|
|
|
|
+ // return this.$Message.error("打印机未正常连接,请检查");
|
|
|
|
+ // }
|
|
|
|
+ this.axios("/api/get_sub_part", { params: { id: rows.id } }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.confirmForm({
|
|
|
|
+ title: "打印芯片",
|
|
|
|
+ forms: [
|
|
|
|
+ {
|
|
|
|
+ title: "部件",
|
|
|
|
+ name: "CheckboxGroup",
|
|
|
|
+ serverName: "id",
|
|
|
|
+ checklist: [{ label: res.data.title, value: res.data.id }],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "零部件",
|
|
|
|
+ name: "CheckboxGroup",
|
|
|
|
+ serverName: "sub_part",
|
|
|
|
+ checkName: "spare_parts",
|
|
|
|
+ checkValue: "id",
|
|
|
|
+ checklist: res.data.sub_part,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ then: (result) => {
|
|
|
|
+ const { id, sub_part } = result;
|
|
|
|
+ const params = {
|
|
|
|
+ ids: rows.id,
|
|
|
|
+ id: id && id.length > 0 ? id.join(",") : "",
|
|
|
|
+ sub_part:
|
|
|
|
+ sub_part && sub_part.length > 0 ? sub_part.join(",") : "",
|
|
|
|
+ ...this.proxyObj,
|
|
|
|
+ };
|
|
|
|
+ this.axios("/api/print_ship", { params: params }).then(
|
|
|
|
+ (resp) => {
|
|
|
|
+ if (resp.code == 200) {
|
|
|
|
+ const result = resp.data;
|
|
|
|
+ if (result && result.length > 0) {
|
|
|
|
+ result.map((ele) => this.printDemo(ele));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ saveTableData() {
|
|
|
|
+ // this.tableData = JSON.parse(JSON.stringify(this.selectTags));
|
|
|
|
+ let order_product_part_ids = [];
|
|
|
|
+ this.selects.map((item) => order_product_part_ids.push(item.parts_id));
|
|
|
|
+ let produce = [];
|
|
|
|
+ this.selectTags.map((item) => produce.push(item.id));
|
|
|
|
+ this.axios({
|
|
|
|
+ method: "post",
|
|
|
|
+ url: "/api/order_part_route_edit",
|
|
|
|
+ data: {
|
|
|
|
+ order_product_part_ids: order_product_part_ids.join(","),
|
|
|
|
+ process: this.selects[0].procedure_properties,
|
|
|
|
+ produce: produce.join(","),
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.$Message.success(res.msg);
|
|
|
|
+ this.init(this.proxyObj);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ closeTag(key, arr, row) {
|
|
|
|
+ //取消tag标签展示操作并同步下方的复选框ui同步
|
|
|
|
+ for (const key in this.info.bps) {
|
|
|
|
+ const element = this.info.bps[key];
|
|
|
|
+ element.cld.map((p) => {
|
|
|
|
+ p.id == row.id ? (p.show = false) : "";
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ arr.splice(key, 1);
|
|
|
|
+ return;
|
|
|
|
+ this.info.bps.map((v) => {
|
|
|
|
+ v.cld.map((p) => {
|
|
|
|
+ p.id == row.id ? (p.show = false) : "";
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changeCheck(e, item, selectArray) {
|
|
|
|
+ //复选框选中与非选中同时同步tag标签跟随操作
|
|
|
|
+ item.show = e;
|
|
|
|
+ if (e) {
|
|
|
|
+ selectArray.push(item);
|
|
|
|
+ } else {
|
|
|
|
+ let id = item.id;
|
|
|
|
+ let id_index = selectArray.findIndex((v) => v.id == id);
|
|
|
|
+ selectArray.splice(id_index, 1);
|
|
|
|
+ }
|
|
|
|
+ let temparr = [];
|
|
|
|
+ this.selectTags.forEach((el) => {
|
|
|
|
+ temparr.push(el.id);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getChangeLists(e) {},
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.nav {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.table-set {
|
|
|
|
+ a {
|
|
|
|
+ margin: 0 5px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.batch-content {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+.batch-footer {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 10px 0;
|
|
|
|
+}
|
|
|
|
+.vertical-center-modal-PL {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .ivu-modal {
|
|
|
|
+ top: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.modal_process_route {
|
|
|
|
+ div {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 5px 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.modal_process_route-process {
|
|
|
|
+ div {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 5px 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.tag-modal {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .before {
|
|
|
|
+ width: 20px;
|
|
|
|
+ background: #3764ff;
|
|
|
|
+ height: 24px;
|
|
|
|
+ border-radius: 5px 0 0 5px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+/deep/.ivu-modal-body {
|
|
|
|
+ max-height: 500px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+}
|
|
|
|
+.modal_content_right {
|
|
|
|
+ max-height: 700px;
|
|
|
|
+ padding-left: 10px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+}
|
|
|
|
+.vertical-center-modal-Process {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .ivu-modal {
|
|
|
|
+ top: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.modal_content {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ height: 100%;
|
|
|
|
+ .modal_content_left {
|
|
|
|
+ position: relative;
|
|
|
|
+ max-width: 40%;
|
|
|
|
+ min-width: 30%;
|
|
|
|
+ border-right: 1px solid #d8d8d8;
|
|
|
|
+ }
|
|
|
|
+ .modal_content_right {
|
|
|
|
+ width: 60%;
|
|
|
|
+ max-height: 700px;
|
|
|
|
+ padding-left: 10px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|