|
|
@@ -9,7 +9,7 @@
|
|
|
<el-input v-model="searchInfo" placeholder="搜索工单编号、产品代号" style="width: 180px;"></el-input>
|
|
|
<el-button type="primary" icon="search" @click="onSubmit" title="搜索" ></el-button>
|
|
|
<el-button type="primary" icon="edit" @click="ontlssclick" class="bt" title="按工序投料反馈,试算某产量的投料">U8投料试算</el-button>
|
|
|
- <el-button type="primary" class="bt" icon="edit" @click="jsfjClick">技术附件</el-button>
|
|
|
+ <el-button type="primary" class="bt" icon="edit" @click="jsfjClick">技术附件</el-button>
|
|
|
<el-button type="primary" icon="edit" @click="onyycpzlclick" class="bt" title="重新引用 产品资料!">引用产品资料</el-button>
|
|
|
<el-button type="primary" icon="edit" @click="oneditgxclhsclick" class="bt" title="工序产量核算">工序产量核算</el-button>
|
|
|
<el-button type="primary" icon="edit" @click="oneditgylctzclick" class="bt" title="根据实际生产需要,对工艺流程做调整">工艺流程调整</el-button>
|
|
|
@@ -111,10 +111,10 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!--引用产品资料-->
|
|
|
- <el-dialog v-model="onyycpzllist" title="获取产品资料">
|
|
|
+ <el-dialog v-model="onyycpzllist" title="获取工单资料">
|
|
|
<div style=" padding: 0px; align-items: center;">
|
|
|
<el-form-item label="工单编号" prop="processName" class="mab">
|
|
|
- <el-input v-model="yycpzlformData['gdbh']" @keyup.enter="yycpzlProductValue" style="width: 23%;" />
|
|
|
+ <el-input v-model="yycpzlformData['gdbh']" ref="fanganRef" @click="yycpzlProductValue({ code: 'Tab'})" @keydown="yycpzlProductValue" style="width: 23%;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户代号" prop="processName" class="mab">
|
|
|
<el-input v-model="yycpzlformData['khdh']" disabled style="width: 23%;" />
|
|
|
@@ -129,6 +129,9 @@
|
|
|
<el-form-item label="创建选择" class="mab" >
|
|
|
<el-checkbox disabled v-model="yycpzlformData['yjzl']">获取印件资料</el-checkbox>
|
|
|
<el-checkbox disabled v-model="yycpzlformData['gyap']">获取工艺安排</el-checkbox>
|
|
|
+ <el-form-item label="" prop="processName" class="mab" label-width="100" >
|
|
|
+ <el-input v-model="yycpzlformData['fangan']" />
|
|
|
+ </el-form-item>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer" style="text-align: right;margin-left: 25%">
|
|
|
@@ -137,6 +140,19 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog v-model="openFangan" title="请选择方案" style="width: 300px;" destroy-on-close>
|
|
|
+ <el-tree
|
|
|
+ :data="WorkOrderDetailCopesFangan"
|
|
|
+ :props="{ children: 'children', label: '方案'}" style="border: 1px solid #efefef; padding: 5px;"
|
|
|
+ node-key="方案"
|
|
|
+ highlight-current
|
|
|
+ :current-node-key="defaultSelectionFangan"
|
|
|
+ @node-click="setFangan"
|
|
|
+ >
|
|
|
+
|
|
|
+ </el-tree>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!--工序产量核算-->
|
|
|
<el-dialog v-model="gxclhslist" title="印件投料核算" style="width: 20%;position: fixed; bottom: 35%; left: 35%">
|
|
|
<div style="display: flex; flex-direction: column; height: 100%;">
|
|
|
@@ -393,6 +409,7 @@
|
|
|
<div class="JKWTree-tree" style="height: 200px">
|
|
|
<h3>工单管理</h3>
|
|
|
<el-tree :data="treeData.data" @node-click="handleNodeClick"></el-tree>
|
|
|
+<!-- <el-tree :data="treeData.data" class="treecolor" @node-click="handleNodeClick"></el-tree>-->
|
|
|
</div>
|
|
|
</layout-sider>
|
|
|
|
|
|
@@ -543,31 +560,31 @@
|
|
|
<el-table-column align="left" label="建档时间" prop="建档时间" width="160"/>
|
|
|
<el-table-column align="left" label="更新时间" prop="更新时间" width="160"/>
|
|
|
</el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="技术资料附件" @click="showTable('技术资料附件')" name="fourth">
|
|
|
- <el-table ref="multipleTable"
|
|
|
- :row-style="{ height: '20px' }"
|
|
|
- :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :header-cell-style="{ padding: '0px' }"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- :cell-class-name="planUsageCellClass"
|
|
|
- highlight-current-row="true"
|
|
|
- @row-dblclick="ExcelShow"
|
|
|
- style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
-
|
|
|
- <!-- <el-table-column type="selection" width="55" />-->
|
|
|
- <el-table-column align="left" label="备注" prop="附件备注" width="120" />
|
|
|
- <el-table-column align="left" label="文件类型" prop="附件类型" width="120"/>
|
|
|
- <el-table-column align="left" label="关联编号" prop="关联编号" width="360"/>
|
|
|
- <el-table-column align="left" label="建档用户" prop="sys_id" width="120"/>
|
|
|
- <el-table-column align="left" label="建档日期" prop="sys_rq" width="160" />
|
|
|
- <el-table-column align="left" label="更新日期" prop="mod_rq" width="160" />
|
|
|
- <el-table-column fixed="right" label="操作" width="100">
|
|
|
- <template v-slot="{ row }">
|
|
|
- <button @click="jsfj_del(row)">删除</button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="技术资料附件" @click="showTable('技术资料附件')" name="fourth">
|
|
|
+ <el-table ref="multipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :cell-class-name="planUsageCellClass"
|
|
|
+ highlight-current-row="true"
|
|
|
+ @row-dblclick="ExcelShow"
|
|
|
+ style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
+
|
|
|
+ <!-- <el-table-column type="selection" width="55" />-->
|
|
|
+ <el-table-column align="left" label="备注" prop="附件备注" width="120" />
|
|
|
+ <el-table-column align="left" label="文件类型" prop="附件类型" width="120"/>
|
|
|
+ <el-table-column align="left" label="关联编号" prop="关联编号" width="360"/>
|
|
|
+ <el-table-column align="left" label="建档用户" prop="sys_id" width="120"/>
|
|
|
+ <el-table-column align="left" label="建档日期" prop="sys_rq" width="160" />
|
|
|
+ <el-table-column align="left" label="更新日期" prop="mod_rq" width="160" />
|
|
|
+ <el-table-column fixed="right" label="操作" width="100">
|
|
|
+ <template v-slot="{ row }">
|
|
|
+ <button @click="jsfj_del(row)">删除</button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
@@ -850,12 +867,18 @@
|
|
|
<div>
|
|
|
<el-form-item label="关键字:" class="mab" prop="keyOrder">
|
|
|
<el-space>
|
|
|
- <el-input v-model="khdh_keyword" @keyup.enter="khdh_ProductValue" style="width: 100%;"/>
|
|
|
+ <el-input v-model="khdh_keyword" @keyup.enter="khdh_ProductValue" style="width: 100%;" ref="xzgdzlInput" />
|
|
|
<el-button @click="gongdanSearchHandle(khdh_keyword, '客户代号')">刷新</el-button>
|
|
|
</el-space>
|
|
|
</el-form-item>
|
|
|
<div style="border:1px solid #eee; width:100%; height: 400px; overflow-y: auto">
|
|
|
- <el-tree :data="khdhDataList" :props="{children: 'children',label: 'name', value: '客户编号'}" @node-click="selectGongDanNode($event, '客户代号')" />
|
|
|
+ <el-tree
|
|
|
+ :data="khdhDataList"
|
|
|
+ :props="{children: 'children',label: 'name', value: '客户编号'}" :current-node-key="currentNodeKey"
|
|
|
+ highlight-current
|
|
|
+ node-key="客户编号"
|
|
|
+ @node-click="selectGongDanNode($event, '客户代号')" ref="xzgdzlTree"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
@@ -1188,28 +1211,28 @@
|
|
|
<!-- 技术附件 -->
|
|
|
<el-dialog v-model="jsfjdialogFormVisible" :before-close="jsfjcloseDialog" :title="产品技术附件资料" style="margin-top: 40px" height="500px" width="800px" destroy-on-close>
|
|
|
<el-form :model="jsfjformdata" label-position="right" ref="elFormRef" :rules="rule" label-width="75px">
|
|
|
- <el-row :gutter="24">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="关联编号:" prop="address" class="mab">
|
|
|
- <el-input v-model="jsfjformdata.关联编号" id="关联编号" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="24">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="附件备注:" prop="address" class="mab">
|
|
|
- <el-input v-model="jsfjformdata.附件备注" id="附件备注" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="24">
|
|
|
- <el-col :span="6"></el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <input style="font-size:16px;" type="file" @change="uploadExcel" >
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-button @click="yulan">预览</el-button>
|
|
|
- </el-col>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="关联编号:" prop="address" class="mab">
|
|
|
+ <el-input v-model="jsfjformdata.关联编号" id="关联编号" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="附件备注:" prop="address" class="mab">
|
|
|
+ <el-input v-model="jsfjformdata.附件备注" id="附件备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="6"></el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <input style="font-size:16px;" type="file" @change="uploadExcel" >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-button @click="yulan">预览</el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -1219,10 +1242,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+
|
|
|
<el-dialog v-model="luckyexcelVisible" :before-close="luckyexcelCloseDialog" width="100%" top="0vh">
|
|
|
<div id="luckyexcel" style="width: 100%;height: 90vh;"></div>
|
|
|
-</el-dialog>
|
|
|
+</el-dialog>
|
|
|
|
|
|
</el-main>
|
|
|
</layout-content>
|
|
|
@@ -1255,12 +1278,12 @@ export default {
|
|
|
</script>
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
-import $script from 'scriptjs'
|
|
|
+import $script from 'scriptjs'
|
|
|
import $ from 'jquery';
|
|
|
import LuckyExcel from 'luckyexcel';
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import { ref, reactive, computed } from 'vue'
|
|
|
+import { ref, reactive, computed, nextTick, watch } from 'vue'
|
|
|
import {
|
|
|
DataList,WorkList, gdzl_MachineList,PrintCodeList,getProductYjList, getProductZzList,
|
|
|
U8workOrder, ProcessDetailEdit, PrintedEdit, PrintJobOrder,WorkOrderAdd,PrintDetailAdd,
|
|
|
@@ -1269,9 +1292,9 @@ import {
|
|
|
ProductInformation, TestCoefficient, capacityList,getOrderProcessRight,
|
|
|
DataCorrection, U8Trial, ProcessFlow, AccountingParameter,setProductStatus,
|
|
|
getProduct, getProductGy, ProductInformationEdit, workOrderListDetail, editProduct, getOrderProcessCount, StatusEdit,
|
|
|
- PrintDetailDel, ProcessDetailDel,
|
|
|
- getGdAnnexTable,
|
|
|
- gdAnnexAdd,
|
|
|
+ PrintDetailDel, ProcessDetailDel,WorkOrderDetailCope,
|
|
|
+ getGdAnnexTable,
|
|
|
+ gdAnnexAdd,ProductCopeDetail,WorkOrderDetailListCope,
|
|
|
gdAnnexDel,
|
|
|
} from "@/api/yunyin/yunying";
|
|
|
import PrintPage from './components/print.vue'
|
|
|
@@ -1907,21 +1930,12 @@ const selectGongDanNode = (node, type) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const xzgdzlInput =ref()
|
|
|
+const xzgdzlTree = ref()
|
|
|
+const currentNodeKey = ref('')
|
|
|
+
|
|
|
//新增工单资料弹窗 键盘 input框跳转
|
|
|
const add_gdzlent = async (event,id1,id2,id3) => {
|
|
|
- if (id2 === '客户代号' && event.key==='Tab' || id2 === '客户代号' && event.key=== 'Enter') {
|
|
|
- await _gClientList(add_gdscgdformData['客户代号'])
|
|
|
- if (khdhDataList.value != null) {
|
|
|
- const row = khdhDataList.value.find(item => item.客户编号 === add_gdscgdformData['客户代号'])
|
|
|
- if (row) {
|
|
|
- add_gdscgdformData['客户名称'] = row.客户名称
|
|
|
- } else {
|
|
|
- khdhModal.value = true
|
|
|
- }
|
|
|
- } else {
|
|
|
- khdhModal.value = true
|
|
|
- }
|
|
|
- }
|
|
|
if (id2 === '产品代号' && event.key==='Tab' || id2 === '产品代号' && event.key=== 'Enter') {
|
|
|
await _ProductCodeList()
|
|
|
cpdhModal.value = true
|
|
|
@@ -1951,7 +1965,82 @@ const add_gdzlent = async (event,id1,id2,id3) => {
|
|
|
document.getElementById(id3).focus()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (id2 === '客户代号' && event.key==='Tab' || id2 === '客户代号' && event.key=== 'Enter') {
|
|
|
+ await _gClientList(add_gdscgdformData['客户代号'])
|
|
|
+ if (khdhDataList.value != null) {
|
|
|
+ const row = khdhDataList.value.find(item => item.客户编号 === add_gdscgdformData['客户代号'])
|
|
|
+ if (row) {
|
|
|
+ add_gdscgdformData['客户名称'] = row.客户名称
|
|
|
+ } else {
|
|
|
+ khdhModal.value = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ khdhModal.value = true
|
|
|
+ }
|
|
|
+ await nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ xzgdzlInput.value.focus()
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+let isdeFun = false
|
|
|
+watch(() => khdhModal.value, async v => {
|
|
|
+ await nextTick(() => {
|
|
|
+ if (xzgdzlTree.value !== undefined) {
|
|
|
+ const defun = (e) => {
|
|
|
+ isdeFun = true
|
|
|
+ if (e.code === 'Enter' && currentNodeKey.value !== '') {
|
|
|
+ selectGongDanNode(khdhDataList.value.find(item => item['客户编号'] == currentNodeKey.value), '客户代号')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowDown') {
|
|
|
+ if (currentNodeKey.value === '') {
|
|
|
+ currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
+ } else {
|
|
|
+ console.log(khdhDataList.value)
|
|
|
+ for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
+ const item = khdhDataList.value[i]
|
|
|
+ if (item['客户编号'] == currentNodeKey.value) {
|
|
|
+ if (khdhDataList.value[i + 1]) {
|
|
|
+ currentNodeKey.value = khdhDataList.value[i + 1].客户编号
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ currentNodeKey.value = khdhDataList.value[0].客户编号
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowUp') {
|
|
|
+ if (currentNodeKey.value === '') {
|
|
|
+ currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
+ } else {
|
|
|
+ for(let i = 0; i < khdhDataList.value.length; i++) {
|
|
|
+ const item = khdhDataList.value[i]
|
|
|
+ if (item['客户编号'] == currentNodeKey.value) {
|
|
|
+ if (khdhDataList.value[i - 1]) {
|
|
|
+ currentNodeKey.value = khdhDataList.value[i - 1].客户编号
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ currentNodeKey.value = khdhDataList.value[khdhDataList.value.length - 1].客户编号
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (v === true) {
|
|
|
+ isdeFun || document.body.addEventListener('keydown', defun)
|
|
|
+ isdeFun && document.body.removeEventListener('keydown', defun)
|
|
|
+ } else {
|
|
|
+ document.body.removeEventListener('keydown', defun)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+})
|
|
|
|
|
|
// =========== 新增印件资料 ===========
|
|
|
//默认弹窗关闭
|
|
|
@@ -2616,8 +2705,10 @@ const yycpzlformData = reactive({
|
|
|
yjzl:true,
|
|
|
gyap: true,
|
|
|
gyfa: '',
|
|
|
+ fangan: 'A',
|
|
|
});
|
|
|
const onyycpzllist = ref(false);
|
|
|
+const fanganRef = ref()
|
|
|
//引用产品资料【按钮】
|
|
|
const onyycpzlclick = () => {
|
|
|
if(_Gd_gdbh.value == null){
|
|
|
@@ -2625,19 +2716,33 @@ const onyycpzlclick = () => {
|
|
|
ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
|
|
|
}else{
|
|
|
yycpzlformData['gdbh'] = _Gd_gdbh.value;
|
|
|
- _ProductInformations();
|
|
|
+ _WorkOrderDetailCopedata();
|
|
|
onyycpzllist.value = true;
|
|
|
}
|
|
|
};
|
|
|
//引用产品资料【回车】
|
|
|
-const yycpzlProductValue = async () => {
|
|
|
- _ProductInformations();
|
|
|
+const yycpzlProductValue = async (e) => {
|
|
|
+ if (e.code === 'Tab') {
|
|
|
+ if (yycpzlformData['gdbh'] == null || yycpzlformData['gdbh'] == '') {
|
|
|
+ ElMessage({ type: 'warning', message: '工单那不能为空' })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ await _WorkOrderDetailCopedata();
|
|
|
+ fanganKeyDown()
|
|
|
+ }
|
|
|
};
|
|
|
+
|
|
|
+const yyzltableData = ref([]);
|
|
|
+const WorkOrderDetailCopesFangan = ref([])
|
|
|
+const defaultSelectionFangan = ref()
|
|
|
//引用产品资料->获取产品资料
|
|
|
-const _ProductInformations = async ()=>{
|
|
|
- let workOrder = yycpzlformData['gdbh'];
|
|
|
- const ProductInformations = await ProductInformation({workOrder:workOrder});
|
|
|
- if(ProductInformations.msg === '未找到工单信息'){
|
|
|
+const _WorkOrderDetailCopedata = async ()=>{
|
|
|
+ let search = yycpzlformData['gdbh'];
|
|
|
+ // 2403725 是带两个方案的
|
|
|
+ const WorkOrderDetailCopes = await ProductCopeDetail({workorder:search});
|
|
|
+ console.log(WorkOrderDetailCopes)
|
|
|
+ fanganRef.value.focus()
|
|
|
+ if(WorkOrderDetailCopes.msg === '未找到工单信息'){
|
|
|
yycpzlformData['khdh'] = '';
|
|
|
yycpzlformData['khmc'] = '';
|
|
|
yycpzlformData['cpdh'] = '';
|
|
|
@@ -2645,33 +2750,95 @@ const _ProductInformations = async ()=>{
|
|
|
ElMessage({type: 'warning',message: '未找到工单信息'})
|
|
|
return false;
|
|
|
}else{
|
|
|
- yycpzlformData['gdbh'] = ProductInformations.data['工单编号'];
|
|
|
- yycpzlformData['khdh'] = ProductInformations.data['客户代号'];
|
|
|
- yycpzlformData['khmc'] = ProductInformations.data['客户名称'];
|
|
|
- yycpzlformData['cpdh'] = ProductInformations.data['产品代号'];
|
|
|
- yycpzlformData['cpmc'] = ProductInformations.data['产品名称'];
|
|
|
+ yycpzlformData['gdbh'] = WorkOrderDetailCopes.data['工单编号'];
|
|
|
+ yycpzlformData['khdh'] = WorkOrderDetailCopes.data['客户编号'];
|
|
|
+ yycpzlformData['khmc'] = WorkOrderDetailCopes.data['客户名称'];
|
|
|
+ yycpzlformData['cpdh'] = WorkOrderDetailCopes.data['产品编号'];
|
|
|
+ yycpzlformData['cpmc'] = WorkOrderDetailCopes.data['产品名称'];
|
|
|
+ yycpzlformData['fangan'] = WorkOrderDetailCopes.data['方案'][0]['方案'];
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopes.data['方案'][0]['方案']
|
|
|
+ WorkOrderDetailCopesFangan.value = WorkOrderDetailCopes.data['方案']
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const setFangan = (node) => {
|
|
|
+ yycpzlformData['fangan'] = node['方案']
|
|
|
+ defaultSelectionFangan.value = node['方案']
|
|
|
+ document.removeEventListener('keydown', () => {})
|
|
|
+ openFangan.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const openFangan = ref(false)
|
|
|
+const fanganKeyDown = () => {
|
|
|
+ //2403725
|
|
|
+ if (WorkOrderDetailCopesFangan.value.length > 1) {
|
|
|
+ openFangan.value = true
|
|
|
+ document.addEventListener('keydown', (e) => {
|
|
|
+ let currentIndex
|
|
|
+ WorkOrderDetailCopesFangan.value.map( (item, index) => {
|
|
|
+ if (item['方案'] === defaultSelectionFangan.value[0]) {
|
|
|
+ currentIndex = index
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (e.code === 'ArrowDown') {
|
|
|
+ if (WorkOrderDetailCopesFangan.value[currentIndex + 1]) {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex + 1]['方案']
|
|
|
+ } else {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[0]['方案']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.code === 'ArrowUp') {
|
|
|
+ if (WorkOrderDetailCopesFangan.value[currentIndex - 1]) {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex - 1]['方案']
|
|
|
+ } else {
|
|
|
+ defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[WorkOrderDetailCopesFangan.value.length - 1]['方案']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.code === 'Enter') {
|
|
|
+ yycpzlformData['fangan'] = defaultSelectionFangan.value
|
|
|
+ document.removeEventListener('keydown', (e) => {
|
|
|
+ console.log(e)
|
|
|
+ })
|
|
|
+ openFangan.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-//引用产品资料【执行】
|
|
|
+//引用产品资料【执行】按钮
|
|
|
const yycpzlhandleConfirm = async () => {
|
|
|
_ProductInformationEdit();
|
|
|
};
|
|
|
//引用产品资料->获取产品资料
|
|
|
const _ProductInformationEdit = async ()=>{
|
|
|
+ console.log(yycpzlformData)
|
|
|
+ if(yycpzlformData['gdbh'] === null || yycpzlformData['gdbh'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '工单编号为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(yycpzlformData['cpdh'] === null || yycpzlformData['cpdh'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '产品代号为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(yycpzlformData['fangan'] === null || yycpzlformData['fangan'] === undefined){
|
|
|
+ ElMessage({type: 'warning', message: '工艺方案为空'});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let params = {}
|
|
|
- params.oldWorkOrder = _Gd_gdbh.value;
|
|
|
- params.newWorkOrder = yycpzlformData['gdbh'];
|
|
|
+ params.workorder = yycpzlformData['gdbh'];
|
|
|
+ params.productCode = yycpzlformData['cpdh'];
|
|
|
+ params.option = yycpzlformData['fangan'];
|
|
|
+ console.log(params)
|
|
|
try {
|
|
|
- const ProductInformationEditdata = await ProductInformationEdit(params);
|
|
|
+ const ProductInformationEditdata = await WorkOrderDetailListCope(params);
|
|
|
if (ProductInformationEditdata.code === 0) {
|
|
|
ElMessage({type: 'success', message: '更新成功'})
|
|
|
+ onyycpzllist.value = false;
|
|
|
} else {
|
|
|
ElMessage({type: 'error',message: '更新失败'})
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
}
|
|
|
- onyycpzllist.value = false;
|
|
|
}
|
|
|
//引用产品资料【放弃】
|
|
|
const yycpzlhandleCancel = () => {onyycpzllist.value = false;};
|
|
|
@@ -2708,10 +2875,25 @@ DataListdata();
|
|
|
const tableData = reactive([])
|
|
|
const _Gd_khdh = ref(null)
|
|
|
const handleNodeClick = async (node) => {
|
|
|
+ // // 取消所有节点的颜色
|
|
|
+ // const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
|
|
|
+ // allNodes.forEach(node => {
|
|
|
+ // node.querySelector('.el-tree-node__label').style.color = '';
|
|
|
+ // });
|
|
|
+ // // 获取点击的节点
|
|
|
+ // const clickedNodeId = node['$treeNodeId'];
|
|
|
+ // console.log(clickedNodeId);
|
|
|
+ // const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
|
|
|
+ // if (clickedNode) {
|
|
|
+ // console.log(clickedNode);
|
|
|
+ // // 给当前点击的节点改变颜色
|
|
|
+ // clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
+ // }
|
|
|
+
|
|
|
searchInfo.value = '';
|
|
|
gytableData.value = [];
|
|
|
yjtableData.value = [];
|
|
|
- bomtableData.value = [];
|
|
|
+ bomtableData.value = [];
|
|
|
jstableData.value = [];
|
|
|
_Gd_khdh.value = node.label.substring(0, 4);
|
|
|
_WorkList_page();
|
|
|
@@ -2773,7 +2955,7 @@ const yjtableData = ref([])
|
|
|
//工艺资料
|
|
|
const gytableData = ref([])
|
|
|
//BOM资料
|
|
|
-const bomtableData = ref([])
|
|
|
+const bomtableData = ref([])
|
|
|
//技术资料附件【暂时为空】
|
|
|
const jstableData = reactive([])
|
|
|
//全局调用工单编号
|
|
|
@@ -2790,8 +2972,8 @@ const tableRowClick = async (row) => {
|
|
|
const workOrderListDetail_data = await workOrderListDetail({Gd_gdbh:_Gd_gdbh.value});
|
|
|
yjtableData.value = workOrderListDetail_data.data.printList;
|
|
|
gytableData.value = workOrderListDetail_data.data.processList;
|
|
|
- bomtableData.value = workOrderListDetail_data.data.BOM;
|
|
|
- jstableData.splice(0, jstableData.length, ...workOrderListDetail_data.data.jsData);
|
|
|
+ bomtableData.value = workOrderListDetail_data.data.BOM;
|
|
|
+ jstableData.splice(0, jstableData.length, ...workOrderListDetail_data.data.jsData);
|
|
|
// jstableData.value = workOrderListDetail_data.data.jsData;
|
|
|
let tmp = yjtableData.value.map(item => item.印件号)
|
|
|
tmp = tmp.sort((a,b)=>b-a)
|
|
|
@@ -2805,7 +2987,7 @@ const type = ref('')
|
|
|
let scgdformData = ref({})
|
|
|
//双击修改
|
|
|
const updateCompanyFunc = async(row) => {
|
|
|
- console.log(row['工单编号'])
|
|
|
+ console.log(row)
|
|
|
// if(row['status'] === '*'){
|
|
|
// ElMessage({ type: 'warning', message: '未找到该工单印件资料' });
|
|
|
// return false;
|
|
|
@@ -3101,26 +3283,28 @@ const gdzl_MachineList_address = reactive({
|
|
|
const _cjmc = ref(null);
|
|
|
//双击修改
|
|
|
const gdgyupdateCompanyFunc = async(row) => {
|
|
|
- // gdgyformData['设备编号'] = [];
|
|
|
- console.log(row);
|
|
|
- console.log(row['机台编号']);
|
|
|
- // gdgyformData['设备编号'] = row['机台编号'];
|
|
|
-
|
|
|
if(row['车间名称']){
|
|
|
_cjmc.value = row['车间名称']
|
|
|
}else{
|
|
|
_cjmc.value = '';
|
|
|
}
|
|
|
+ gdgyformData['设备编号'] = []
|
|
|
//通过车间名称查询机台
|
|
|
const MachineList_jitai = await gdzl_MachineList({address:_cjmc.value});
|
|
|
if(MachineList_jitai.data === null || MachineList_jitai.data === ''){
|
|
|
ElMessage({type: 'warning', message: '未找到该车间机台'})
|
|
|
return false;
|
|
|
}
|
|
|
- console.log(MachineList_jitai.data)
|
|
|
- MachineList_jitai.data.unshift(row['机台编号']);
|
|
|
+ const jitai = row['机台编号'].split(' ')
|
|
|
+ console.log(jitai)
|
|
|
+ jitai.map(item => {
|
|
|
+ MachineList_jitai.data.map(jt => {
|
|
|
+ if (jt.indexOf(item) > -1 && item !== '') {
|
|
|
+ gdgyformData['设备编号'].push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
gdzl_MachineList_address.data = MachineList_jitai.data;
|
|
|
-
|
|
|
// 示例字符串
|
|
|
const processName = row['工序名称'];
|
|
|
// 初始化工艺名称和工序名称
|
|
|
@@ -3385,221 +3569,221 @@ const delgd_delclick = async () => {
|
|
|
gytableData.value = workOrderListDetail_data.data.processList;
|
|
|
bomtableData.value = workOrderListDetail_data.data.BOM;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//点击技术附件按钮
|
|
|
const jsfjClick = () => {
|
|
|
if(_Gd_gdbh.value == null){
|
|
|
cgugdlist.value = false;
|
|
|
ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
|
|
|
}else{
|
|
|
- initJsfjformdata();
|
|
|
+ initJsfjformdata();
|
|
|
jsfjformdata.value.关联编号 = _Gd_gdbh.value
|
|
|
jsfjdialogFormVisible.value = true
|
|
|
}
|
|
|
-}
|
|
|
-//技术附件弹窗
|
|
|
-const jsfjdialogFormVisible = ref(false)
|
|
|
-const jsfjformdata = ref({
|
|
|
- sys_id: '[272/超级用户]',
|
|
|
- 附件备注: '',
|
|
|
- 附件内容: '',
|
|
|
- 附件类型: '',
|
|
|
+}
|
|
|
+//技术附件弹窗
|
|
|
+const jsfjdialogFormVisible = ref(false)
|
|
|
+const jsfjformdata = ref({
|
|
|
+ sys_id: '[272/超级用户]',
|
|
|
+ 附件备注: '',
|
|
|
+ 附件内容: '',
|
|
|
+ 附件类型: '',
|
|
|
关联编号: '',
|
|
|
-});
|
|
|
+});
|
|
|
//技术附件弹窗取消
|
|
|
const initJsfjformdata = () => {
|
|
|
- jsfjformdata.value = {
|
|
|
- sys_id: '[272/超级用户]',
|
|
|
- 附件备注: '',
|
|
|
- 附件内容: '',
|
|
|
- 附件类型: '',
|
|
|
- 关联编号: '',
|
|
|
- }
|
|
|
-}
|
|
|
+ jsfjformdata.value = {
|
|
|
+ sys_id: '[272/超级用户]',
|
|
|
+ 附件备注: '',
|
|
|
+ 附件内容: '',
|
|
|
+ 附件类型: '',
|
|
|
+ 关联编号: '',
|
|
|
+ }
|
|
|
+}
|
|
|
//技术附件弹窗取消
|
|
|
const jsfjcloseDialog = () => {
|
|
|
jsfjdialogFormVisible.value = false
|
|
|
-}
|
|
|
-const uploadExcel = (event) =>{
|
|
|
- const files = event.target.files;
|
|
|
- let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
|
|
|
- // if(suffix!="xlsx"){
|
|
|
- // alert("Currently only supports the import of xlsx files");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- jsfjformdata.value.附件内容 = files[0]
|
|
|
- jsfjformdata.value.附件类型 = 'XLSX'
|
|
|
-}
|
|
|
-
|
|
|
-const yulan = (event) =>{
|
|
|
- if(!jsfjformdata.value.附件内容) return
|
|
|
- $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
- $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
- luckyexcelVisible.value = true
|
|
|
- LuckyExcel.transformExcelToLucky(jsfjformdata.value.附件内容, function(exportJson, luckysheetfile){
|
|
|
- if(exportJson.sheets==null || exportJson.sheets.length==0){
|
|
|
- alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if(luckyExcel) luckyExcel.destroy();
|
|
|
- luckysheet.create({
|
|
|
- container: 'luckyexcel', //容器的ID
|
|
|
- data: exportJson.sheets,
|
|
|
- title: exportJson.info.name, // 工作簿名称
|
|
|
- lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
- showtoolbar: false, // 是否显示工具栏
|
|
|
- showinfobar: false, // 是否显示顶部信息栏
|
|
|
- allowEdit: false, // 是否允许前台编辑
|
|
|
- enableAddRow: false, // 允许增加行
|
|
|
- enableAddCol: false, // 允许增加列
|
|
|
- userInfo: false, // 右上角的用户信息展示样式
|
|
|
- showRowBar: false, // 是否显示行号区域
|
|
|
- showColumnBar: false, // 是否显示列号区域
|
|
|
- sheetFormulaBar: false, // 是否显示公式栏
|
|
|
- enableAddBackTop: false,//返回头部按钮
|
|
|
- });
|
|
|
- luckyExcel = luckysheet;
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
-
|
|
|
-}
|
|
|
-const jsfj_del = (row) =>{
|
|
|
- ElMessageBox.confirm('确定要删除吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- gdAnnexDel({'UniqId':row.UniqId,'gdbh':_Gd_gdbh.value}).then(response => {
|
|
|
- if(response.code==0){
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功',
|
|
|
- })
|
|
|
-
|
|
|
- let row = {
|
|
|
- '工单编号':_Gd_gdbh.value,
|
|
|
- '产品代号':_Gd_cpdh.value,
|
|
|
- '产品名称':_Gd_cpmc.value,
|
|
|
- }
|
|
|
- tableRowClick (row)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//技术附件弹窗确定
|
|
|
-const jsfjenterDialog = () => {
|
|
|
- if(jsfjformdata.value.附件备注==''){
|
|
|
- ElMessage({
|
|
|
- type: 'error',
|
|
|
- message: '请填写附件备注'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- if(jsfjformdata.value.附件内容==''){
|
|
|
- ElMessage({
|
|
|
- type: 'error',
|
|
|
- message: '请上传文件'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- if(jsfjformdata.value.关联编号==''){
|
|
|
- ElMessage({
|
|
|
- type: 'error',
|
|
|
- message: '请填写关联编号'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- let fr = new FileReader();
|
|
|
- fr.readAsDataURL(jsfjformdata.value.附件内容);
|
|
|
- fr.onload = function () {
|
|
|
- const restoredData = new FormData();
|
|
|
- restoredData.append('sys_id', jsfjformdata.value.sys_id);
|
|
|
- restoredData.append('附件备注', jsfjformdata.value.附件备注);
|
|
|
- restoredData.append('附件内容', fr.result);
|
|
|
- restoredData.append('附件类型', jsfjformdata.value.附件类型);
|
|
|
- restoredData.append('关联编号', jsfjformdata.value.关联编号);
|
|
|
-
|
|
|
- gdAnnexAdd(restoredData).then(response => {
|
|
|
- if(response.code==0){
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '新增成功',
|
|
|
- })
|
|
|
- jsfjdialogFormVisible.value = false
|
|
|
- let row = {
|
|
|
- '工单编号':_Gd_gdbh.value,
|
|
|
- '产品代号':_Gd_cpdh.value,
|
|
|
- '产品名称':_Gd_cpmc.value,
|
|
|
- }
|
|
|
- tableRowClick (row)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-//技术资料excel展示
|
|
|
-const ExcelShow = (row) =>{
|
|
|
- if(!row.附件内容) return
|
|
|
- $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
- $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
- function dataURLtoBlob(dataUrl) {
|
|
|
- const byteString = atob(dataUrl.split(',')[1]);
|
|
|
- const ab = new ArrayBuffer(byteString.length);
|
|
|
- const ia = new Uint8Array(ab);
|
|
|
-
|
|
|
- for (let i = 0; i < byteString.length; i++) {
|
|
|
- ia[i] = byteString.charCodeAt(i);
|
|
|
- }
|
|
|
-
|
|
|
- return new Blob([ab], { type: 'application/octet-stream' });
|
|
|
- }
|
|
|
-
|
|
|
- const blob = dataURLtoBlob(row.附件内容);
|
|
|
- luckyexcelVisible.value = true
|
|
|
- LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
|
|
|
- if(exportJson.sheets==null || exportJson.sheets.length==0){
|
|
|
- alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if(luckyExcel) luckyExcel.destroy();
|
|
|
- luckysheet.create({
|
|
|
- container: 'luckyexcel', //容器的ID
|
|
|
- data: exportJson.sheets,
|
|
|
- title: exportJson.info.name, // 工作簿名称
|
|
|
- lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
- showtoolbar: false, // 是否显示工具栏
|
|
|
- showinfobar: false, // 是否显示顶部信息栏
|
|
|
- allowEdit: false, // 是否允许前台编辑
|
|
|
- enableAddRow: false, // 允许增加行
|
|
|
- enableAddCol: false, // 允许增加列
|
|
|
- userInfo: false, // 右上角的用户信息展示样式
|
|
|
- showRowBar: false, // 是否显示行号区域
|
|
|
- showColumnBar: false, // 是否显示列号区域
|
|
|
- sheetFormulaBar: false, // 是否显示公式栏
|
|
|
- enableAddBackTop: false,//返回头部按钮
|
|
|
- });
|
|
|
- luckyExcel = luckysheet;
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
- $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-let luckyExcel = null
|
|
|
-
|
|
|
-const luckyexcelVisible = ref(false)
|
|
|
+}
|
|
|
+const uploadExcel = (event) =>{
|
|
|
+ const files = event.target.files;
|
|
|
+ let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
|
|
|
+ // if(suffix!="xlsx"){
|
|
|
+ // alert("Currently only supports the import of xlsx files");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ jsfjformdata.value.附件内容 = files[0]
|
|
|
+ jsfjformdata.value.附件类型 = 'XLSX'
|
|
|
+}
|
|
|
+
|
|
|
+const yulan = (event) =>{
|
|
|
+ if(!jsfjformdata.value.附件内容) return
|
|
|
+ $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
+ $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
+ luckyexcelVisible.value = true
|
|
|
+ LuckyExcel.transformExcelToLucky(jsfjformdata.value.附件内容, function(exportJson, luckysheetfile){
|
|
|
+ if(exportJson.sheets==null || exportJson.sheets.length==0){
|
|
|
+ alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(luckyExcel) luckyExcel.destroy();
|
|
|
+ luckysheet.create({
|
|
|
+ container: 'luckyexcel', //容器的ID
|
|
|
+ data: exportJson.sheets,
|
|
|
+ title: exportJson.info.name, // 工作簿名称
|
|
|
+ lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
+ showtoolbar: false, // 是否显示工具栏
|
|
|
+ showinfobar: false, // 是否显示顶部信息栏
|
|
|
+ allowEdit: false, // 是否允许前台编辑
|
|
|
+ enableAddRow: false, // 允许增加行
|
|
|
+ enableAddCol: false, // 允许增加列
|
|
|
+ userInfo: false, // 右上角的用户信息展示样式
|
|
|
+ showRowBar: false, // 是否显示行号区域
|
|
|
+ showColumnBar: false, // 是否显示列号区域
|
|
|
+ sheetFormulaBar: false, // 是否显示公式栏
|
|
|
+ enableAddBackTop: false,//返回头部按钮
|
|
|
+ });
|
|
|
+ luckyExcel = luckysheet;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
+
|
|
|
+}
|
|
|
+const jsfj_del = (row) =>{
|
|
|
+ ElMessageBox.confirm('确定要删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ gdAnnexDel({'UniqId':row.UniqId,'gdbh':_Gd_gdbh.value}).then(response => {
|
|
|
+ if(response.code==0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功',
|
|
|
+ })
|
|
|
+
|
|
|
+ let row = {
|
|
|
+ '工单编号':_Gd_gdbh.value,
|
|
|
+ '产品代号':_Gd_cpdh.value,
|
|
|
+ '产品名称':_Gd_cpmc.value,
|
|
|
+ }
|
|
|
+ tableRowClick (row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//技术附件弹窗确定
|
|
|
+const jsfjenterDialog = () => {
|
|
|
+ if(jsfjformdata.value.附件备注==''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请填写附件备注'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(jsfjformdata.value.附件内容==''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请上传文件'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(jsfjformdata.value.关联编号==''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请填写关联编号'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let fr = new FileReader();
|
|
|
+ fr.readAsDataURL(jsfjformdata.value.附件内容);
|
|
|
+ fr.onload = function () {
|
|
|
+ const restoredData = new FormData();
|
|
|
+ restoredData.append('sys_id', jsfjformdata.value.sys_id);
|
|
|
+ restoredData.append('附件备注', jsfjformdata.value.附件备注);
|
|
|
+ restoredData.append('附件内容', fr.result);
|
|
|
+ restoredData.append('附件类型', jsfjformdata.value.附件类型);
|
|
|
+ restoredData.append('关联编号', jsfjformdata.value.关联编号);
|
|
|
+
|
|
|
+ gdAnnexAdd(restoredData).then(response => {
|
|
|
+ if(response.code==0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '新增成功',
|
|
|
+ })
|
|
|
+ jsfjdialogFormVisible.value = false
|
|
|
+ let row = {
|
|
|
+ '工单编号':_Gd_gdbh.value,
|
|
|
+ '产品代号':_Gd_cpdh.value,
|
|
|
+ '产品名称':_Gd_cpmc.value,
|
|
|
+ }
|
|
|
+ tableRowClick (row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//技术资料excel展示
|
|
|
+const ExcelShow = (row) =>{
|
|
|
+ if(!row.附件内容) return
|
|
|
+ $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
+ $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
+ function dataURLtoBlob(dataUrl) {
|
|
|
+ const byteString = atob(dataUrl.split(',')[1]);
|
|
|
+ const ab = new ArrayBuffer(byteString.length);
|
|
|
+ const ia = new Uint8Array(ab);
|
|
|
+
|
|
|
+ for (let i = 0; i < byteString.length; i++) {
|
|
|
+ ia[i] = byteString.charCodeAt(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ return new Blob([ab], { type: 'application/octet-stream' });
|
|
|
+ }
|
|
|
+
|
|
|
+ const blob = dataURLtoBlob(row.附件内容);
|
|
|
+ luckyexcelVisible.value = true
|
|
|
+ LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
|
|
|
+ if(exportJson.sheets==null || exportJson.sheets.length==0){
|
|
|
+ alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(luckyExcel) luckyExcel.destroy();
|
|
|
+ luckysheet.create({
|
|
|
+ container: 'luckyexcel', //容器的ID
|
|
|
+ data: exportJson.sheets,
|
|
|
+ title: exportJson.info.name, // 工作簿名称
|
|
|
+ lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
+ showtoolbar: false, // 是否显示工具栏
|
|
|
+ showinfobar: false, // 是否显示顶部信息栏
|
|
|
+ allowEdit: false, // 是否允许前台编辑
|
|
|
+ enableAddRow: false, // 允许增加行
|
|
|
+ enableAddCol: false, // 允许增加列
|
|
|
+ userInfo: false, // 右上角的用户信息展示样式
|
|
|
+ showRowBar: false, // 是否显示行号区域
|
|
|
+ showColumnBar: false, // 是否显示列号区域
|
|
|
+ sheetFormulaBar: false, // 是否显示公式栏
|
|
|
+ enableAddBackTop: false,//返回头部按钮
|
|
|
+ });
|
|
|
+ luckyExcel = luckysheet;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+let luckyExcel = null
|
|
|
+
|
|
|
+const luckyexcelVisible = ref(false)
|
|
|
const luckyexcelCloseDialog = () => {
|
|
|
luckyexcelVisible.value = false
|
|
|
}
|