作者 张晓杰

生产订单、产品设计

  1 +// import api from './index'
  2 +import { axios } from '@/utils/request'
  3 +
  4 +export function listProductType(parameter) {
  5 + return axios({
  6 + url: '/order_form/tblProductType/listProductType',
  7 + method: 'get',
  8 + data: parameter
  9 + })
  10 + }
  11 +
  12 + export function getOneOrder(id) {
  13 + return axios({
  14 + url: '/order_form/tblOrderForm/queryById/'+id,
  15 + method: 'get',
  16 +
  17 + })
  18 + }
  1 +// import api from './index'
  2 +import { axios } from '@/utils/request'
  3 +
  4 +export function listSalary(parameter) {
  5 + return axios({
  6 + url: '/salary/base/listSalary',
  7 + method: 'get',
  8 + data: parameter
  9 + })
  10 + }
  11 +
  12 + export function queryDesignByOrderId(orderId) {
  13 + return axios({
  14 + url: '/product_design/tblProductDesign/queryByOrderId/'+orderId,
  15 + method: 'get'
  16 + })
  17 + }
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 //update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842 17 //update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
18 includedComponents() { 18 includedComponents() {
19 const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES) 19 const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES)
20 - console.log("includedRouters:" + includedRouters) 20 + // console.log("includedRouters:" + includedRouters)
21 21
22 //如果是缓存路由,则加入到 cache_included_routes 22 //如果是缓存路由,则加入到 cache_included_routes
23 if (this.$route.meta.keepAlive && this.$route.meta.componentName) { 23 if (this.$route.meta.keepAlive && this.$route.meta.componentName) {
@@ -54,7 +54,7 @@ export const JeecgListMixin = { @@ -54,7 +54,7 @@ export const JeecgListMixin = {
54 }, 54 },
55 created() { 55 created() {
56 if (!this.disableMixinCreated) { 56 if (!this.disableMixinCreated) {
57 - console.log(' -- mixin created -- ') 57 + // console.log(' -- mixin created -- ')
58 this.loadData(); 58 this.loadData();
59 //初始化字典配置 在自己页面定义 59 //初始化字典配置 在自己页面定义
60 this.initDictConfig(); 60 this.initDictConfig();
@@ -73,6 +73,7 @@ export const JeecgListMixin = { @@ -73,6 +73,7 @@ export const JeecgListMixin = {
73 }, 73 },
74 methods: { 74 methods: {
75 loadData(arg) { 75 loadData(arg) {
  76 + console.log('this.url:',this.url)
76 if (!this.url.list) { 77 if (!this.url.list) {
77 this.$message.error("请设置url.list属性!") 78 this.$message.error("请设置url.list属性!")
78 return 79 return
@@ -34,7 +34,7 @@ export default class signMd5Utils { @@ -34,7 +34,7 @@ export default class signMd5Utils {
34 let jsonObj = this.mergeObject(urlParams, requestParams); 34 let jsonObj = this.mergeObject(urlParams, requestParams);
35 //console.log("sign jsonObj: ",jsonObj) 35 //console.log("sign jsonObj: ",jsonObj)
36 let requestBody = this.sortAsc(jsonObj); 36 let requestBody = this.sortAsc(jsonObj);
37 - console.log("sign requestBody: ",requestBody) 37 + // console.log("sign requestBody: ",requestBody)
38 return md5(JSON.stringify(requestBody) + signatureSecret).toUpperCase(); 38 return md5(JSON.stringify(requestBody) + signatureSecret).toUpperCase();
39 } 39 }
40 40
@@ -5,15 +5,28 @@ @@ -5,15 +5,28 @@
5 <a-form layout="inline" @keyup.enter.native="searchQuery"> 5 <a-form layout="inline" @keyup.enter.native="searchQuery">
6 <a-row :gutter="24"> 6 <a-row :gutter="24">
7 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 7 <a-col :xl="6" :lg="7" :md="8" :sm="24">
8 - <a-form-item label="主料号">  
9 - <j-input placeholder="请输入主料号" v-model="queryParam.orderId"></j-input> 8 + <a-form-item label="订货单位">
  9 + <j-input placeholder="请输入订货单位" v-model="queryParam.orderCompany"></j-input>
10 </a-form-item> 10 </a-form-item>
11 </a-col> 11 </a-col>
12 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 12 <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <a-form-item label="工作令">
  14 + <j-input placeholder="请输入工作令" v-model="queryParam.workOrder"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <a-form-item label="产品类型">
  19 + <!-- <j-input placeholder="请选择产品类型" v-model="queryParam.productType"></j-input> -->
  20 + <a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
  21 + <a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
  22 + </a-select>
  23 + </a-form-item>
  24 + </a-col>
  25 + <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
13 <a-form-item label="订单日期"> 26 <a-form-item label="订单日期">
14 <j-date placeholder="请选择订单日期" v-model="queryParam.orderDate"></j-date> 27 <j-date placeholder="请选择订单日期" v-model="queryParam.orderDate"></j-date>
15 </a-form-item> 28 </a-form-item>
16 - </a-col> 29 + </a-col> -->
17 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 30 <a-col :xl="6" :lg="7" :md="8" :sm="24">
18 <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> 31 <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
19 <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> 32 <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@@ -83,43 +96,27 @@ @@ -83,43 +96,27 @@
83 </template> 96 </template>
84 97
85 <span slot="action" slot-scope="text, record"> 98 <span slot="action" slot-scope="text, record">
86 - <div v-if="record.status === '未下单'"> 99 + <div v-if="record.assignDesignStatus === '0'">
  100 + <a @click="handleAssignDesign(record)" >派任务</a>
  101 + <a-divider type="vertical" />
87 <a @click="handleEdit(record)" >编辑</a> 102 <a @click="handleEdit(record)" >编辑</a>
88 <a-divider type="vertical" /> 103 <a-divider type="vertical" />
89 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> 104 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
90 <a>删除</a> 105 <a>删除</a>
91 </a-popconfirm> 106 </a-popconfirm>
92 </div> 107 </div>
93 - <!-- 生产中 -->  
94 - <div v-else-if="record.status === '生产中'">  
95 - <a @click="handleVerify(record)" >检验</a>  
96 - </div>  
97 - <div v-else-if="record.status === '已完成'">  
98 - <a @click="delivery(record)" >出货</a>  
99 - </div>  
100 - <!-- 已出货 -->  
101 <div v-else> 108 <div v-else>
102 - <a @click="pics2Upload(record)" >收货</a>  
103 - </div>  
104 - <!-- 已收货 -->  
105 - <div>  
106 - 109 + <a @click="handleViewOrders(record)" >查看</a>
107 </div> 110 </div>
108 </span> 111 </span>
109 112
110 </a-table> 113 </a-table>
111 </div> 114 </div>
112 115
113 - <a-tabs defaultActiveKey="1">  
114 - <a-tab-pane tab="订单子项" key="1" >  
115 - <TblWorkOrderList :mainId="tblWorkOrderMainId" :orderId="orderId" @orderOk="workOrderOk"/>  
116 - </a-tab-pane>  
117 - </a-tabs>  
118 116
119 <tblOrderForm-modal ref="modalForm" @ok="modalFormOk"></tblOrderForm-modal> 117 <tblOrderForm-modal ref="modalForm" @ok="modalFormOk"></tblOrderForm-modal>
120 - <VerifyModal ref="verifyModal" @ok="()=>this.loadData()"></VerifyModal>  
121 - <PrintModal ref="printModal" @ok="()=>this.loadData()"></PrintModal>  
122 - <Pics2UploadModal ref="pics2Modal" @ok="()=>this.loadData()"></Pics2UploadModal> 118 + <AssignDesignModal ref="AssignDesignModal" @ok="modalFormOk"></AssignDesignModal>
  119 + <ViewOrdersModal ref="ViewOrdersModal" @ok="modalFormOk"></ViewOrdersModal>
123 </a-card> 120 </a-card>
124 </template> 121 </template>
125 122
@@ -127,28 +124,34 @@ @@ -127,28 +124,34 @@
127 124
128 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 125 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
129 import TblOrderFormModal from './modules/TblOrderFormModal' 126 import TblOrderFormModal from './modules/TblOrderFormModal'
130 - import VerifyModal from './modules/VerifyModal'  
131 - import PrintModal from './modules/PrintModal'  
132 - import Pics2UploadModal from './modules/Pics2UploadModal'  
133 import { getAction } from '@/api/manage' 127 import { getAction } from '@/api/manage'
134 - import TblWorkOrderList from './TblWorkOrderList' 128 + import AssignDesignModal from './modules/AssignDesignModal'
  129 + import ViewOrdersModal from './modules/ViewOrdersModal'
  130 + import {listProductType} from '@/api/ProductTpye'
135 import '@/assets/less/TableExpand.less' 131 import '@/assets/less/TableExpand.less'
136 132
137 export default { 133 export default {
138 name: "TblOrderFormList", 134 name: "TblOrderFormList",
139 mixins:[JeecgListMixin], 135 mixins:[JeecgListMixin],
140 components: { 136 components: {
141 - TblWorkOrderList,  
142 TblOrderFormModal, 137 TblOrderFormModal,
143 - VerifyModal,PrintModal,Pics2UploadModal 138 + AssignDesignModal,ViewOrdersModal
144 }, 139 },
145 data () { 140 data () {
146 return { 141 return {
147 description: '订单表管理页面', 142 description: '订单表管理页面',
  143 + options:[],
148 // 表头 144 // 表头
149 columns: [ 145 columns: [
150 { 146 {
151 - title:'主料号', 147 + title:'序号',
  148 + align:"center",
  149 + customRender: (text, record, index) => {
  150 + return `${(this.ipagination.current - 1) * this.ipagination.pageSize + index + 1}`
  151 + },
  152 + },
  153 + {
  154 + title:'订单编号',
152 align:"center", 155 align:"center",
153 dataIndex: 'orderId' 156 dataIndex: 'orderId'
154 }, 157 },
@@ -158,54 +161,91 @@ @@ -158,54 +161,91 @@
158 dataIndex: 'orderCompany' 161 dataIndex: 'orderCompany'
159 }, 162 },
160 { 163 {
161 - title:'订单日期', 164 + title:'工作令',
162 align:"center", 165 align:"center",
163 - dataIndex: 'orderDate',  
164 - customRender:function (text) {  
165 - return !text?"":(text.length>10?text.substr(0,10):text)  
166 - } 166 + dataIndex: 'workOrder'
167 }, 167 },
168 { 168 {
169 - title:'交货日期', 169 + title:'产品名称',
170 align:"center", 170 align:"center",
171 - dataIndex: 'deliveryDate',  
172 - customRender:function (text) {  
173 - return !text?"":(text.length>10?text.substr(0,10):text) 171 + dataIndex: 'productName',
  172 + // customRender:function (text) {
  173 + // return !text?"":(text.length>10?text.substr(0,10):text)
  174 + // }
  175 + },
  176 + {
  177 + title:'产品类型',
  178 + align:"center",
  179 + dataIndex: 'productType',
  180 + customRender: function (text) {
  181 + if (text === 'XC') {
  182 + return '线槽'
  183 + } else if (text === 'JD') {
  184 + return '接地'
  185 + } else if (text === 'QZ') {
  186 + return '卡子'
  187 + } else if (text === 'GX') {
  188 + return '柜、箱、盒'
  189 + } else if (text === 'SJ') {
  190 + return '司机室'
  191 + } else if (text === 'FS') {
  192 + return '附属钢'
  193 + } else {
  194 + return text
174 } 195 }
175 }, 196 },
  197 + },
176 { 198 {
177 - title:'状态', 199 + title:'任务下达时间',
178 align:"center", 200 align:"center",
179 - dataIndex: 'status' 201 + dataIndex: 'orderDate'
180 }, 202 },
181 { 203 {
182 - title:'实际完成时间', 204 + title:'派工时间',
183 align:"center", 205 align:"center",
184 - dataIndex: 'finishDate', 206 + dataIndex: 'dispatchDate',
185 customRender:function (text) { 207 customRender:function (text) {
186 return !text?"":(text.length>10?text.substr(0,10):text) 208 return !text?"":(text.length>10?text.substr(0,10):text)
187 } 209 }
188 }, 210 },
189 { 211 {
190 - title:'出货检验',  
191 - align:"center",  
192 - dataIndex: 'verifyResult'  
193 - },  
194 - {  
195 - title:'出货日期', 212 + title:'交货时间',
196 align:"center", 213 align:"center",
197 - dataIndex: 'deliveryDate1', 214 + dataIndex: 'deliveryDate',
198 customRender:function (text) { 215 customRender:function (text) {
199 return !text?"":(text.length>10?text.substr(0,10):text) 216 return !text?"":(text.length>10?text.substr(0,10):text)
200 } 217 }
201 }, 218 },
202 { 219 {
203 - title:'主料图片', 220 + title:'数量',
  221 + align:"center",
  222 + dataIndex: 'quantity'
  223 + },
  224 + {
  225 + title:'总工时',
204 align:"center", 226 align:"center",
205 - dataIndex: 'pics',  
206 - scopedSlots: {customRender: 'imgSlot'} 227 + dataIndex: 'totalWorkingHours'
207 }, 228 },
208 { 229 {
  230 + title:'已派发工时',
  231 + align:"center",
  232 + dataIndex: 'dispatchedWorkingHours'
  233 + },
  234 + // {
  235 + // title:'出货日期',
  236 + // align:"center",
  237 + // dataIndex: 'deliveryDate1',
  238 + // customRender:function (text) {
  239 + // return !text?"":(text.length>10?text.substr(0,10):text)
  240 + // }
  241 + // },
  242 + // {
  243 + // title:'主料图片',
  244 + // align:"center",
  245 + // dataIndex: 'pics',
  246 + // scopedSlots: {customRender: 'imgSlot'}
  247 + // },
  248 + {
209 title: '操作', 249 title: '操作',
210 dataIndex: 'action', 250 dataIndex: 'action',
211 align:"center", 251 align:"center",
@@ -236,13 +276,14 @@ @@ -236,13 +276,14 @@
236 total: 0 276 total: 0
237 }, 277 },
238 selectedMainId:'', 278 selectedMainId:'',
239 - superFieldList:[], 279 + // superFieldList:[],
240 tblWorkOrderMainId: '', 280 tblWorkOrderMainId: '',
241 orderId:'', 281 orderId:'',
242 } 282 }
243 }, 283 },
244 created() { 284 created() {
245 - this.getSuperFieldList(); 285 + // this.getSuperFieldList();
  286 + this.loadTree()
246 }, 287 },
247 computed: { 288 computed: {
248 importExcelUrl: function(){ 289 importExcelUrl: function(){
@@ -282,21 +323,26 @@ @@ -282,21 +323,26 @@
282 this.tblWorkOrderMainId = ''; 323 this.tblWorkOrderMainId = '';
283 this.orderId = ''; 324 this.orderId = '';
284 }, 325 },
285 - // 点击检验的操作  
286 - handleVerify(record){  
287 - this.$refs.verifyModal.edit(record);  
288 - this.$refs.verifyModal.disableSubmit = false; 326 + loadTree(){
  327 + var that = this;
  328 + listProductType().then((res)=>{
  329 + if(res.success){
  330 + // that.treeData = [];
  331 + that.options = res.result
  332 + }
  333 + });
289 }, 334 },
290 - // 出货单点击操作  
291 - delivery(record){  
292 - this.$refs.printModal.open(record);  
293 - this.$refs.printModal.disableSubmit = false; 335 + // 分派设计
  336 + handleAssignDesign(record){
  337 + this.$refs.AssignDesignModal.edit(record);
  338 + this.$refs.AssignDesignModal.disableSubmit = false;
294 }, 339 },
295 - // 收货点击操作  
296 - pics2Upload(record){  
297 - this.$refs.pics2Modal.edit(record);  
298 - this.$refs.pics2Modal.disableSubmit = false; 340 + //查看订单详情
  341 + handleViewOrders(record){
  342 + this.$refs.ViewOrdersModal.edit(record);
  343 + this.$refs.ViewOrdersModal.disableSubmit = false;
299 }, 344 },
  345 +
300 initDictConfig(){ 346 initDictConfig(){
301 }, 347 },
302 clickThenSelect(record) { 348 clickThenSelect(record) {
  1 +<template>
  2 + <j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
  3 + switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
  4 + <a-spin :spinning="confirmLoading">
  5 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  6 + <a-row>
  7 + <a-col :span="24">
  8 + <a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  9 + <a-input v-model="model.productName" placeholder="请输入产品名称" disabled></a-input>
  10 + </a-form-model-item>
  11 + </a-col>
  12 + <a-col :span="24">
  13 + <a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
  14 + <a-select size="small" v-model="model.productType" placeholder="请选择设计人员" allowClear disabled>
  15 + <a-select-option v-for="(item,index) in productTypeOptions" :key="index" :value="item.productTypeId" >{{ item.productTypeName }}</a-select-option>
  16 + </a-select>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
  21 + <a-input v-model="model.quantity" placeholder="请输入数量" disabled></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + <a-col :span="24">
  25 + <a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
  26 + <j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
  27 + :disabled-date="disabledEndDate" disabled/>
  28 + </a-form-model-item>
  29 + </a-col>
  30 + <!-- <a-col :span="24">
  31 + <a-form-model-item label="派工时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
  32 + <j-date placeholder="请选择交货日期" v-model="model.assignDesignDate" style="width: 100%"
  33 + :disabled-date="disabledEndDate" />
  34 + </a-form-model-item>
  35 + </a-col> -->
  36 + <a-col :span="24">
  37 + <a-form-model-item label="设计人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
  38 + <a-select size="small" v-model="model.designer" placeholder="请选择设计人员" allowClear>
  39 + <a-select-option v-for="(item,index) in options" :key="index" :value="item.jobId">{{ item.userName }}</a-select-option>
  40 + </a-select>
  41 + </a-form-model-item>
  42 + </a-col>
  43 + <a-col :span="24">
  44 + <a-form-model-item label="派工日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
  45 + <j-date placeholder="请选择派工日期" v-model="model.dispatchDate" style="width: 100%"
  46 + :disabled-date="disabledEndDate"/>
  47 + </a-form-model-item>
  48 + </a-col>
  49 + </a-row>
  50 + </a-form-model>
  51 + </a-spin>
  52 + </j-modal>
  53 +</template>
  54 +
  55 +<script>
  56 +
  57 +import { httpAction } from '@/api/manage'
  58 +import { validateDuplicateValue } from '@/utils/util'
  59 +import { duplicateCheck } from '@/api/api'
  60 +import {listSalary} from '@/api/TblSalaryBase'
  61 +import {listProductType} from '@/api/ProductTpye'
  62 +import moment from 'moment'
  63 +
  64 +export default {
  65 + name: "AssignDesignModal",
  66 + components: {
  67 + },
  68 + data() {
  69 + return {
  70 + title: "操作",
  71 + productTypeOptions:[],
  72 + options:[],
  73 + width: 800,
  74 + visible: false,
  75 + model: {
  76 + },
  77 + labelCol: {
  78 + xs: { span: 24 },
  79 + sm: { span: 5 },
  80 + },
  81 + wrapperCol: {
  82 + xs: { span: 24 },
  83 + sm: { span: 16 },
  84 + },
  85 +
  86 + confirmLoading: false,
  87 + validatorRules: {
  88 + // orderId: [
  89 + // { required: true, message: '请输入主料号!' },
  90 + // { validator: this.validateBidNo }
  91 + // ],
  92 + orderCompany: [
  93 + { required: true, message: '请输入订货单位!' },
  94 + ],
  95 + workOrder: [
  96 + { required: true, message: '请输入工作令!' },
  97 + ],
  98 + productName: [
  99 + { required: true, message: '请输入产品名称!' },
  100 + ],
  101 + productType: [
  102 + { required: true, message: '请输入产品类型!' },
  103 + ],
  104 + quantity: [
  105 + { required: true, message: '请输入数量!' },
  106 + ],
  107 + // orderDate: [
  108 + // { required: true, message: '请输入订单日期!' },
  109 + // ],
  110 + deliveryDate: [
  111 + { required: true, message: '请输入交货日期!' },
  112 + ],
  113 + // pics: [
  114 + // { required: true, message: '请输入主料图片!' },
  115 + // ],
  116 + },
  117 + url: {
  118 + edit: "/order_form/tblOrderForm/updateDesigner"
  119 + }
  120 +
  121 + }
  122 + },
  123 + created() {
  124 + // this.model.status = '未下单'
  125 + //备份model原始值
  126 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  127 + },
  128 + methods: {
  129 + add() {
  130 + this.edit(this.modelDefault);
  131 + },
  132 + edit(record) {
  133 + this.model = Object.assign({}, record);
  134 + this.model.assignDesignDate = new Date().toISOString()
  135 + this.visible = true;
  136 + this.loadProductType()
  137 + this.loadUser()
  138 + },
  139 + loadProductType(){
  140 + var that = this;
  141 + listProductType().then((res)=>{
  142 + if(res.success){
  143 + console.log(res)
  144 + that.productTypeOptions = res.result
  145 + console.log(that.productTypeOptions)
  146 + }
  147 + });
  148 + },
  149 + loadUser(){
  150 + var that = this;
  151 + listSalary().then((res)=>{
  152 + if(res.success){
  153 +
  154 + // that.treeData = [];
  155 + that.options = res.result
  156 + }
  157 + });
  158 + },
  159 + close() {
  160 + this.$emit('close');
  161 + this.visible = false;
  162 + this.$refs.form.clearValidate();
  163 + },
  164 + handleOk() {
  165 + const that = this;
  166 + // 触发表单验证
  167 + this.$refs.form.validate(valid => {
  168 + if (valid) {
  169 + console.log(this.model)
  170 + // return
  171 + that.confirmLoading = true;
  172 + let httpurl = this.url.edit;
  173 + let method = 'put';
  174 + httpAction(httpurl, this.model, method).then((res) => {
  175 + if (res.success) {
  176 + that.$message.success(res.message);
  177 + that.$emit('ok');
  178 + } else {
  179 + that.$message.warning(res.message);
  180 + }
  181 + }).finally(() => {
  182 + that.confirmLoading = false;
  183 + that.close();
  184 + })
  185 + } else {
  186 + return false
  187 + }
  188 + })
  189 + },
  190 + handleCancel() {
  191 + this.close()
  192 + },
  193 + validateBidNo(rule, value, callback) {
  194 + var params = {
  195 + tableName: 'tbl_order_form',
  196 + fieldName: 'order_id',
  197 + fieldVal: value,
  198 + dataId: this.model.id,
  199 + }
  200 + duplicateCheck(params).then((res) => {
  201 + if (res.success) {
  202 + callback()
  203 + } else {
  204 + callback('编号已存在!')
  205 + }
  206 + })
  207 + },
  208 + disabledEndDate(val) {
  209 + return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
  210 + },
  211 +
  212 + }
  213 +}
  214 +</script>
  1 +<template>
  2 + <j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
  3 + switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
  4 + <a-spin :spinning="confirmLoading">
  5 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  6 + <a-row>
  7 + <!-- <a-col :span="24">
  8 + <a-form-model-item label="主料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
  9 + <a-input v-model="model.orderId" placeholder="请输入主料号"></a-input>
  10 + </a-form-model-item>
  11 + </a-col> -->
  12 + <a-col :span="24">
  13 + <a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
  14 + <a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
  15 + </a-form-model-item>
  16 + </a-col>
  17 + <a-col :span="24">
  18 + <a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
  19 + <a-input v-model="model.workOrder" placeholder="请输入工作令"></a-input>
  20 + </a-form-model-item>
  21 + </a-col>
  22 + <a-col :span="24">
  23 + <a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  24 + <a-input v-model="model.productName" placeholder="请输入产品名称"></a-input>
  25 + </a-form-model-item>
  26 + </a-col>
  27 + <a-col :span="24">
  28 + <a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
  29 + <a-input v-model="model.productType" placeholder="请选择产品类型"></a-input>
  30 + </a-form-model-item>
  31 + </a-col>
  32 + <a-col :span="24">
  33 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
  34 + <a-input v-model="model.quantity" placeholder="请输入数量"></a-input>
  35 + </a-form-model-item>
  36 + </a-col>
  37 +
  38 + <a-col :span="24">
  39 + <a-form-model-item label="订单日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDate">
  40 + <j-date placeholder="请选择订单日期" v-model="model.orderDate" style="width: 100%"
  41 + :disabled-date="disabledEndDate" />
  42 + </a-form-model-item>
  43 + </a-col>
  44 + <a-col :span="24">
  45 + <a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
  46 + <j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
  47 + :disabled-date="disabledEndDate" />
  48 + </a-form-model-item>
  49 + </a-col>
  50 + <a-col :span="24">
  51 + <a-form-model-item label="主料图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
  52 + <j-image-upload isMultiple v-model="model.pics"></j-image-upload>
  53 + </a-form-model-item>
  54 + </a-col>
  55 + </a-row>
  56 + </a-form-model>
  57 + </a-spin>
  58 + </j-modal>
  59 +</template>
  60 +
  61 +<script>
  62 +
  63 +import { httpAction } from '@/api/manage'
  64 +import { validateDuplicateValue } from '@/utils/util'
  65 +import { duplicateCheck } from '@/api/api'
  66 +import moment from 'moment'
  67 +
  68 +export default {
  69 + name: "TblOrderFormModal",
  70 + components: {
  71 + },
  72 + data() {
  73 + return {
  74 + title: "操作",
  75 + width: 800,
  76 + visible: false,
  77 + model: {
  78 + },
  79 + labelCol: {
  80 + xs: { span: 24 },
  81 + sm: { span: 5 },
  82 + },
  83 + wrapperCol: {
  84 + xs: { span: 24 },
  85 + sm: { span: 16 },
  86 + },
  87 +
  88 + confirmLoading: false,
  89 + validatorRules: {
  90 + // orderId: [
  91 + // { required: true, message: '请输入主料号!' },
  92 + // { validator: this.validateBidNo }
  93 + // ],
  94 + orderCompany: [
  95 + { required: true, message: '请输入订货单位!' },
  96 + ],
  97 + workOrder: [
  98 + { required: true, message: '请输入工作令!' },
  99 + ],
  100 + productName: [
  101 + { required: true, message: '请输入产品名称!' },
  102 + ],
  103 + productType: [
  104 + { required: true, message: '请输入产品类型!' },
  105 + ],
  106 + quantity: [
  107 + { required: true, message: '请输入数量!' },
  108 + ],
  109 + // orderDate: [
  110 + // { required: true, message: '请输入订单日期!' },
  111 + // ],
  112 + deliveryDate: [
  113 + { required: true, message: '请输入交货日期!' },
  114 + ],
  115 + // pics: [
  116 + // { required: true, message: '请输入主料图片!' },
  117 + // ],
  118 + },
  119 + url: {
  120 + add: "/order_form/tblOrderForm/add",
  121 + edit: "/order_form/tblOrderForm/edit",
  122 + }
  123 +
  124 + }
  125 + },
  126 + created() {
  127 + this.model.status = '未下单'
  128 + //备份model原始值
  129 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  130 + },
  131 + methods: {
  132 + add() {
  133 + this.edit(this.modelDefault);
  134 + },
  135 + edit(record) {
  136 + this.model = Object.assign({}, record);
  137 + this.visible = true;
  138 + },
  139 + close() {
  140 + this.$emit('close');
  141 + this.visible = false;
  142 + this.$refs.form.clearValidate();
  143 + },
  144 + handleOk() {
  145 + const that = this;
  146 + // 触发表单验证
  147 + this.$refs.form.validate(valid => {
  148 + if (valid) {
  149 + that.confirmLoading = true;
  150 + let httpurl = '';
  151 + let method = '';
  152 + if (!this.model.id) {
  153 + httpurl += this.url.add;
  154 + method = 'post';
  155 + } else {
  156 + httpurl += this.url.edit;
  157 + method = 'put';
  158 + }
  159 + httpAction(httpurl, this.model, method).then((res) => {
  160 + if (res.success) {
  161 + that.$message.success(res.message);
  162 + that.$emit('ok');
  163 + } else {
  164 + that.$message.warning(res.message);
  165 + }
  166 + }).finally(() => {
  167 + that.confirmLoading = false;
  168 + that.close();
  169 + })
  170 + } else {
  171 + return false
  172 + }
  173 + })
  174 + },
  175 + handleCancel() {
  176 + this.close()
  177 + },
  178 + validateBidNo(rule, value, callback) {
  179 + var params = {
  180 + tableName: 'tbl_order_form',
  181 + fieldName: 'order_id',
  182 + fieldVal: value,
  183 + dataId: this.model.id,
  184 + }
  185 + duplicateCheck(params).then((res) => {
  186 + if (res.success) {
  187 + callback()
  188 + } else {
  189 + callback('编号已存在!')
  190 + }
  191 + })
  192 + },
  193 + disabledEndDate(val) {
  194 + return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
  195 + },
  196 +
  197 + }
  198 +}
  199 +</script>
@@ -5,21 +5,43 @@ @@ -5,21 +5,43 @@
5 <a-form-model ref="form" :model="model" :rules="validatorRules"> 5 <a-form-model ref="form" :model="model" :rules="validatorRules">
6 <a-row> 6 <a-row>
7 <a-col :span="24"> 7 <a-col :span="24">
8 - <a-form-model-item label="主料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">  
9 - <a-input v-model="model.orderId" placeholder="请输入主料号"></a-input> 8 + <a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
  9 + <a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
10 </a-form-model-item> 10 </a-form-model-item>
11 </a-col> 11 </a-col>
12 <a-col :span="24"> 12 <a-col :span="24">
13 - <a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">  
14 - <a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input> 13 + <a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
  14 + <a-input v-model="model.workOrder" placeholder="请输入工作令"></a-input>
  15 + </a-form-model-item>
  16 + </a-col>
  17 + <a-col :span="24">
  18 + <a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  19 + <a-input v-model="model.productName" placeholder="请输入产品名称"></a-input>
15 </a-form-model-item> 20 </a-form-model-item>
16 </a-col> 21 </a-col>
17 <a-col :span="24"> 22 <a-col :span="24">
  23 + <a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
  24 + <a-select size="small" v-model="model.productType" placeholder="请选择产品类型" allowClear>
  25 + <a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
  26 + </a-select>
  27 + </a-form-model-item>
  28 + </a-col>
  29 + <a-col :span="24">
  30 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
  31 + <a-input v-model="model.quantity" placeholder="请输入数量"></a-input>
  32 + </a-form-model-item>
  33 + </a-col>
  34 + <a-col :span="24">
  35 + <a-form-model-item label="总工时" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
  36 + <a-input v-model="model.totalWorkingHours" placeholder="请输入总工时"></a-input>
  37 + </a-form-model-item>
  38 + </a-col>
  39 + <!-- <a-col :span="24">
18 <a-form-model-item label="订单日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDate"> 40 <a-form-model-item label="订单日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDate">
19 <j-date placeholder="请选择订单日期" v-model="model.orderDate" style="width: 100%" 41 <j-date placeholder="请选择订单日期" v-model="model.orderDate" style="width: 100%"
20 :disabled-date="disabledEndDate" /> 42 :disabled-date="disabledEndDate" />
21 </a-form-model-item> 43 </a-form-model-item>
22 - </a-col> 44 + </a-col> -->
23 <a-col :span="24"> 45 <a-col :span="24">
24 <a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate"> 46 <a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
25 <j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%" 47 <j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
@@ -31,6 +53,16 @@ @@ -31,6 +53,16 @@
31 <j-image-upload isMultiple v-model="model.pics"></j-image-upload> 53 <j-image-upload isMultiple v-model="model.pics"></j-image-upload>
32 </a-form-model-item> 54 </a-form-model-item>
33 </a-col> 55 </a-col>
  56 + <a-col :span="24">
  57 + <a-form-model-item label="主料文件上传" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
  58 + <j-upload isMultiple v-model="model.files"></j-upload>
  59 + </a-form-model-item>
  60 + </a-col>
  61 + <!-- <a-col :span="24">
  62 + <a-form-model-item label="文件上传" prop="files">
  63 + <j-upload v-model="model.files"></j-upload>
  64 + </a-form-model-item>
  65 + </a-col> -->
34 </a-row> 66 </a-row>
35 </a-form-model> 67 </a-form-model>
36 </a-spin> 68 </a-spin>
@@ -42,6 +74,7 @@ @@ -42,6 +74,7 @@
42 import { httpAction } from '@/api/manage' 74 import { httpAction } from '@/api/manage'
43 import { validateDuplicateValue } from '@/utils/util' 75 import { validateDuplicateValue } from '@/utils/util'
44 import { duplicateCheck } from '@/api/api' 76 import { duplicateCheck } from '@/api/api'
  77 +import {listProductType} from '@/api/ProductTpye'
45 import moment from 'moment' 78 import moment from 'moment'
46 79
47 export default { 80 export default {
@@ -51,6 +84,7 @@ export default { @@ -51,6 +84,7 @@ export default {
51 data() { 84 data() {
52 return { 85 return {
53 title: "操作", 86 title: "操作",
  87 + options:[],
54 width: 800, 88 width: 800,
55 visible: false, 89 visible: false,
56 model: { 90 model: {
@@ -66,22 +100,34 @@ export default { @@ -66,22 +100,34 @@ export default {
66 100
67 confirmLoading: false, 101 confirmLoading: false,
68 validatorRules: { 102 validatorRules: {
69 - orderId: [  
70 - { required: true, message: '请输入主料号!' },  
71 - { validator: this.validateBidNo }  
72 - ], 103 + // orderId: [
  104 + // { required: true, message: '请输入主料号!' },
  105 + // { validator: this.validateBidNo }
  106 + // ],
73 orderCompany: [ 107 orderCompany: [
74 { required: true, message: '请输入订货单位!' }, 108 { required: true, message: '请输入订货单位!' },
75 ], 109 ],
76 - orderDate: [  
77 - { required: true, message: '请输入订单日期!' }, 110 + workOrder: [
  111 + { required: true, message: '请输入工作令!' },
78 ], 112 ],
  113 + productName: [
  114 + { required: true, message: '请输入产品名称!' },
  115 + ],
  116 + productType: [
  117 + { required: true, message: '请输入产品类型!' },
  118 + ],
  119 + quantity: [
  120 + { required: true, message: '请输入数量!' },
  121 + ],
  122 + // orderDate: [
  123 + // { required: true, message: '请输入订单日期!' },
  124 + // ],
79 deliveryDate: [ 125 deliveryDate: [
80 { required: true, message: '请输入交货日期!' }, 126 { required: true, message: '请输入交货日期!' },
81 ], 127 ],
82 - pics: [  
83 - { required: true, message: '请输入主料图片!' },  
84 - ], 128 + // pics: [
  129 + // { required: true, message: '请输入主料图片!' },
  130 + // ],
85 }, 131 },
86 url: { 132 url: {
87 add: "/order_form/tblOrderForm/add", 133 add: "/order_form/tblOrderForm/add",
@@ -91,7 +137,7 @@ export default { @@ -91,7 +137,7 @@ export default {
91 } 137 }
92 }, 138 },
93 created() { 139 created() {
94 - this.model.status = '未下单' 140 + // this.model.status = '未下单'
95 //备份model原始值 141 //备份model原始值
96 this.modelDefault = JSON.parse(JSON.stringify(this.model)); 142 this.modelDefault = JSON.parse(JSON.stringify(this.model));
97 }, 143 },
@@ -102,7 +148,17 @@ export default { @@ -102,7 +148,17 @@ export default {
102 edit(record) { 148 edit(record) {
103 this.model = Object.assign({}, record); 149 this.model = Object.assign({}, record);
104 this.visible = true; 150 this.visible = true;
  151 + this.loadTree()
105 }, 152 },
  153 + loadTree(){
  154 + var that = this;
  155 + listProductType().then((res)=>{
  156 + if(res.success){
  157 + // that.treeData = [];
  158 + that.options = res.result
  159 + }
  160 + });
  161 + },
106 close() { 162 close() {
107 this.$emit('close'); 163 this.$emit('close');
108 this.visible = false; 164 this.visible = false;
@@ -113,6 +169,8 @@ export default { @@ -113,6 +169,8 @@ export default {
113 // 触发表单验证 169 // 触发表单验证
114 this.$refs.form.validate(valid => { 170 this.$refs.form.validate(valid => {
115 if (valid) { 171 if (valid) {
  172 + console.log(this.model)
  173 + // return
116 that.confirmLoading = true; 174 that.confirmLoading = true;
117 let httpurl = ''; 175 let httpurl = '';
118 let method = ''; 176 let method = '';
  1 +<template>
  2 + <j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
  3 + switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
  4 + <a-spin :spinning="confirmLoading">
  5 + <div style="display: flex">
  6 + <div style="display:inline-block;width:45%;margin: auto;">
  7 + <table>
  8 + <tr>
  9 + <th scop="col">订单号:</th>
  10 + <th scop="col">{{model.orderId}}</th>
  11 + </tr>
  12 + <tr>
  13 + <th scop="col">订货单位:</th>
  14 + <th scop="col">{{model.orderCompany}}</th>
  15 + </tr>
  16 + <tr>
  17 + <th scop="col">工作令:</th>
  18 + <th scop="col">{{model.workOrder}}</th>
  19 + </tr>
  20 + <tr>
  21 + <th scop="col">产品名称:</th>
  22 + <th scop="col">{{model.productName}}</th>
  23 + </tr>
  24 + <tr>
  25 + <th scop="col">产品类型:</th>
  26 + <th scop="col">{{model.productType}}</th>
  27 + </tr>
  28 + <tr>
  29 + <th scop="col">任务下达时间:</th>
  30 + <th scop="col">{{model.orderDate}}</th>
  31 + </tr>
  32 + <tr>
  33 + <th scop="col">派工时间:</th>
  34 + <th scop="col">{{model.dispatchDate}}</th>
  35 + </tr>
  36 + <tr>
  37 + <th scop="col">交货时间:</th>
  38 + <th scop="col">{{model.deliveryDate}}</th>
  39 + </tr>
  40 + <tr>
  41 + <th scop="col">数量(套):</th>
  42 + <th scop="col">{{model.quantity}}</th>
  43 + </tr>
  44 + <tr>
  45 + <th scop="col">总工时:</th>
  46 + <th scop="col">{{model.totalWorkingHours}}</th>
  47 + </tr>
  48 + <tr>
  49 + <th scop="col">已派发工时:</th>
  50 + <th scop="col">{{model.dispatchedWorkingHours}}</th>
  51 + </tr>
  52 + <tr v-if="model.files">
  53 + <th scop="col">主料图文件:</th>
  54 + <th scop="col">{{model.files}}</th>
  55 + </tr>
  56 + </table>
  57 + </div>
  58 + <div style="display:inline-block;width:45%;">
  59 + <div class="show">
  60 + <img :src="getImgView(show)" :preview="num" alt="" height="100px">
  61 + </div>
  62 + <div class="imgBox">
  63 + <div :class="[num == index?'borderShow':'']" v-for="(item,index) of picList" :key="index" @click="onImg(index)">
  64 + <img :src="getImgView(item)" height="25px" alt="" style="margin-left: 20px;">
  65 + </div>
  66 + </div>
  67 + </div>
  68 + </div>
  69 + </a-spin>
  70 + </j-modal>
  71 +</template>
  72 +
  73 +<script>
  74 +
  75 +import { httpAction } from '@/api/manage'
  76 +import { validateDuplicateValue } from '@/utils/util'
  77 +import { duplicateCheck } from '@/api/api'
  78 +import {listProductType} from '@/api/ProductTpye'
  79 +import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  80 +import moment from 'moment'
  81 +let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
  82 +export default {
  83 + name: "ViewOrdersModal",
  84 + mixins: [JeecgListMixin],
  85 + components: {
  86 + },
  87 + data() {
  88 + return {
  89 + title: "生产订单详情",
  90 + baseURL:apiBaseUrl,
  91 + options:[],
  92 + width: 800,
  93 + visible: false,
  94 + model: {
  95 + },
  96 + labelCol: {
  97 + xs: { span: 24 },
  98 + sm: { span: 5 },
  99 + },
  100 + wrapperCol: {
  101 + xs: { span: 24 },
  102 + sm: { span: 16 },
  103 + },
  104 +
  105 + confirmLoading: false,
  106 + picList:"",
  107 + show:"",
  108 + num: 0,
  109 + url: {
  110 + list: "/order_form/tblOrderForm/list",
  111 + }
  112 +
  113 + }
  114 + },
  115 + created() {
  116 + // this.model.status = '未下单'
  117 + //备份model原始值
  118 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  119 + console.log(apiBaseUrl)
  120 + },
  121 + methods: {
  122 + add() {
  123 + this.edit(this.modelDefault);
  124 + },
  125 + edit(record) {
  126 + this.model = Object.assign({}, record);
  127 + var picList = this.model.pics.split(',')
  128 + this.picList = picList
  129 + this.show = this.picList[0];
  130 + console.log('this.picList',this.picList)
  131 + this.visible = true;
  132 + this.loadTree()
  133 + },
  134 + loadTree(){
  135 + var that = this;
  136 + listProductType().then((res)=>{
  137 + if(res.success){
  138 + // that.treeData = [];
  139 + that.options = res.result
  140 + }
  141 + });
  142 + },
  143 + onImg(e){
  144 + this.show = this.picList[e];
  145 + this.num = e
  146 + },
  147 + close() {
  148 + this.$emit('close');
  149 + this.visible = false;
  150 + // this.$refs.form.clearValidate();
  151 + },
  152 + handleOk() {
  153 + this.close();
  154 + },
  155 + handleCancel() {
  156 + this.close()
  157 + },
  158 + validateBidNo(rule, value, callback) {
  159 + var params = {
  160 + tableName: 'tbl_order_form',
  161 + fieldName: 'order_id',
  162 + fieldVal: value,
  163 + dataId: this.model.id,
  164 + }
  165 + duplicateCheck(params).then((res) => {
  166 + if (res.success) {
  167 + callback()
  168 + } else {
  169 + callback('编号已存在!')
  170 + }
  171 + })
  172 + },
  173 + disabledEndDate(val) {
  174 + return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
  175 + },
  176 +
  177 + }
  178 +}
  179 +</script>
  180 +<style scoped>
  181 + .imgBox{
  182 + display: flex;
  183 +}
  184 +
  185 +.imgBox img{
  186 + width: 50px;
  187 + height: 50px;
  188 + margin: 10px;
  189 +}
  190 +
  191 +.imgBox div{
  192 + margin: 5px;
  193 +}
  194 +
  195 +.borderShow{
  196 +border: 2px solid rgb(141, 134, 134);
  197 +}
  198 +
  199 +.show img{
  200 + margin-bottom: 10px;
  201 + height: 200px;
  202 + width: 200px;
  203 +}
  204 +</style>
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="订货单位">
  9 + <j-input placeholder="请输入订货单位" v-model="queryParam.orderCompany"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <a-form-item label="工作令">
  14 + <j-input placeholder="请输入工作令" v-model="queryParam.workOrder"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <a-form-item label="产品类型">
  19 + <a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
  20 + <a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
  21 + </a-select>
  22 + </a-form-item>
  23 + </a-col>
  24 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  25 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  26 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  27 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  28 + <a @click="handleToggleSearch" style="margin-left: 8px">
  29 + {{ toggleSearchStatus ? '收起' : '展开' }}
  30 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  31 + </a>
  32 + </span>
  33 + </a-col>
  34 + </a-row>
  35 + </a-form>
  36 + </div>
  37 + <!-- 查询区域-END -->
  38 +
  39 + <!-- 操作按钮区域 -->
  40 + <div class="table-operator">
  41 + <a-button @click="handleUpload()" type="primary" icon="plus">上传设计图及材料表</a-button>
  42 + <!-- <a-button type="primary" icon="download" @click="handleExportXls('订单表')">导出</a-button>
  43 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  44 + <a-button type="primary" icon="import">导入</a-button>
  45 + </a-upload> -->
  46 + <!-- 高级查询区域 -->
  47 + <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
  48 + </div>
  49 +
  50 + <!-- table区域-begin -->
  51 + <div>
  52 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  53 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  54 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  55 + </div>
  56 +
  57 + <a-table
  58 + ref="table"
  59 + size="middle"
  60 + bordered
  61 + rowKey="id"
  62 + class="j-table-force-nowrap"
  63 + :scroll="{x:true}"
  64 + :columns="columns"
  65 + :dataSource="dataSource"
  66 + :pagination="ipagination"
  67 + :loading="loading"
  68 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  69 + :customRow="clickThenSelect"
  70 + @change="handleMyTableChange">
  71 +
  72 + <template slot="htmlSlot" slot-scope="text">
  73 + <div v-html="text"></div>
  74 + </template>
  75 + <template slot="imgSlot" slot-scope="text,record">
  76 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  77 + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  78 + </template>
  79 + <template slot="fileSlot" slot-scope="text">
  80 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  81 + <a-button
  82 + v-else
  83 + :ghost="true"
  84 + type="primary"
  85 + icon="download"
  86 + size="small"
  87 + @click="downloadFile(text)">
  88 + 下载
  89 + </a-button>
  90 + </template>
  91 +
  92 + <span slot="action" slot-scope="text, record">
  93 + <div v-if="record.productDesignStatus === '0'">
  94 + <a @click="handleViewOrders(record)" >查看</a>
  95 + </div>
  96 + <div v-else-if="record.productDesignStatus === '1'">
  97 + <a @click="handleViewOrders(record)" >查看</a>
  98 + <a-divider type="vertical"/>
  99 + <a @click="handleUploadOrders(record.id,record)" >编辑</a>
  100 + </div>
  101 + <div>
  102 + </div>
  103 + </span>
  104 + </a-table>
  105 + </div>
  106 + <ProductDesignModal ref="ProductDesignModal" @ok="modalFormOk"></ProductDesignModal>
  107 + <ViewOrdersModal ref="ViewOrdersModal" @ok="modalFormOk"></ViewOrdersModal>
  108 + </a-card>
  109 + </template>
  110 +
  111 + <script>
  112 +
  113 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  114 + import ProductDesignModal from './modules/ProductDesignModal'
  115 + import ViewOrdersModal from '../order_form/modules/ViewOrdersModal.vue'
  116 + import '@/assets/less/TableExpand.less'
  117 + import {listProductType} from '@/api/ProductTpye'
  118 +
  119 + export default {
  120 + name: "ProductDesignList",
  121 + mixins:[JeecgListMixin],
  122 + components: {
  123 + ProductDesignModal,ViewOrdersModal
  124 + },
  125 + data () {
  126 + return {
  127 + description: '订单表管理页面',
  128 + options:[],
  129 + // 表头
  130 + columns: [
  131 + {
  132 + title:'序号',
  133 + align:"center",
  134 + customRender: (text, record, index) => {
  135 + return `${(this.ipagination.current - 1) * this.ipagination.pageSize + index + 1}`
  136 + },
  137 + },
  138 + {
  139 + title:'订单编号',
  140 + align:"center",
  141 + dataIndex: 'orderId'
  142 + },
  143 + {
  144 + title:'订货单位',
  145 + align:"center",
  146 + dataIndex: 'orderCompany'
  147 + },
  148 + {
  149 + title:'工作令',
  150 + align:"center",
  151 + dataIndex: 'workOrder'
  152 + },
  153 + {
  154 + title:'产品名称',
  155 + align:"center",
  156 + dataIndex: 'productName',
  157 + // customRender:function (text) {
  158 + // return !text?"":(text.length>10?text.substr(0,10):text)
  159 + // }
  160 + },
  161 + {
  162 + title:'产品类型',
  163 + align:"center",
  164 + dataIndex: 'productType',
  165 + customRender: function (text) {
  166 + if (text === 'XC') {
  167 + return '线槽'
  168 + } else if (text === 'JD') {
  169 + return '接地'
  170 + } else if (text === 'QZ') {
  171 + return '卡子'
  172 + } else if (text === 'GX') {
  173 + return '柜、箱、盒'
  174 + } else if (text === 'SJ') {
  175 + return '司机室'
  176 + } else if (text === 'FS') {
  177 + return '附属钢'
  178 + } else {
  179 + return text
  180 + }
  181 + },
  182 + },
  183 + {
  184 + title:'任务下达时间',
  185 + align:"center",
  186 + dataIndex: 'orderDate'
  187 + },
  188 + {
  189 + title:'派工时间',
  190 + align:"center",
  191 + dataIndex: 'dispatchDate',
  192 + customRender:function (text) {
  193 + return !text?"":(text.length>10?text.substr(0,10):text)
  194 + }
  195 + },
  196 + {
  197 + title:'交货时间',
  198 + align:"center",
  199 + dataIndex: 'deliveryDate',
  200 + customRender:function (text) {
  201 + return !text?"":(text.length>10?text.substr(0,10):text)
  202 + }
  203 + },
  204 + {
  205 + title:'数量',
  206 + align:"center",
  207 + dataIndex: 'quantity'
  208 + },
  209 + {
  210 + title: '操作',
  211 + dataIndex: 'action',
  212 + align:"center",
  213 + fixed:"right",
  214 + width:147,
  215 + scopedSlots: { customRender: 'action' },
  216 + }
  217 + ],
  218 + url: {
  219 + list: "/order_form/tblOrderForm/productDesignList",
  220 + delete: "/order_form/tblOrderForm/delete",
  221 + deleteBatch: "/order_form/tblOrderForm/deleteBatch",
  222 + exportXlsUrl: "/order_form/tblOrderForm/exportXls",
  223 + importExcelUrl: "order_form/tblOrderForm/importExcel",
  224 + },
  225 + dictOptions:{
  226 + },
  227 + /* 分页参数 */
  228 + ipagination:{
  229 + current: 1,
  230 + pageSize: 5,
  231 + pageSizeOptions: ['5', '10', '50'],
  232 + showTotal: (total, range) => {
  233 + return range[0] + "-" + range[1] + " 共" + total + "条"
  234 + },
  235 + showQuickJumper: true,
  236 + showSizeChanger: true,
  237 + total: 0
  238 + },
  239 + selectedMainId:'',
  240 + superFieldList:[],
  241 + tblWorkOrderMainId: '',
  242 + orderId:'',
  243 + }
  244 + },
  245 + created() {
  246 + this.getSuperFieldList();
  247 + this.loadTree()
  248 + },
  249 + computed: {
  250 + importExcelUrl: function(){
  251 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  252 + }
  253 + },
  254 + methods: {
  255 + // 自定义查询
  256 + searchQuery() {
  257 + this.loadData(1);
  258 + this.tblWorkOrderMainId = '';
  259 + this.orderId = '';
  260 + // 点击查询清空列表选中行
  261 + // https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
  262 + this.selectedRowKeys = []
  263 + this.selectionRows = []
  264 + },
  265 +
  266 + // 自定义分页切换动作
  267 + handleMyTableChange(pagination, filters, sorter) {
  268 + //分页、排序、筛选变化时触发
  269 + //TODO 筛选
  270 + if (Object.keys(sorter).length > 0) {
  271 + this.isorter.column = sorter.field;
  272 + this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
  273 + }
  274 + this.ipagination = pagination;
  275 + this.loadData();
  276 + this.tblWorkOrderMainId = '';
  277 + this.orderId = '';
  278 + },
  279 + loadTree(){
  280 + var that = this;
  281 + listProductType().then((res)=>{
  282 + if(res.success){
  283 + // that.treeData = [];
  284 + that.options = res.result
  285 + }
  286 + });
  287 + },
  288 + handleViewOrders(record){
  289 + this.$refs.ViewOrdersModal.edit(record);
  290 + this.$refs.ViewOrdersModal.disableSubmit = false;
  291 + },
  292 + handleUpload(){
  293 + if(this.selectedRowKeys.length == 0){
  294 + this.$message.error("请先选中一条数据!")
  295 + return
  296 + }
  297 + this.$refs.ProductDesignModal.edit(this.selectedRowKeys[0],null);
  298 + this.$refs.ProductDesignModal.disableSubmit = false;
  299 + },
  300 + handleUploadOrders(id,record){
  301 + this.$refs.ProductDesignModal.edit(id,record);
  302 + this.$refs.ProductDesignModal.disableSubmit = false;
  303 + },
  304 + initDictConfig(){
  305 + },
  306 + clickThenSelect(record) {
  307 + return {
  308 + on: {
  309 + click: () => {
  310 + this.onSelectChange(record.id.split(","), [record]);
  311 + }
  312 + }
  313 + }
  314 + },
  315 + onClearSelected() {
  316 + this.selectedRowKeys = [];
  317 + this.selectionRows = [];
  318 + this.selectedMainId='';
  319 + this.orderId = '';
  320 + this.tblWorkOrderMainId = '';
  321 + },
  322 + onSelectChange(selectedRowKeys, selectionRows) {
  323 +
  324 + this.selectedMainId=selectedRowKeys[0]
  325 + this.selectedRowKeys = selectedRowKeys;
  326 + this.selectionRows = selectionRows;
  327 + this.tblWorkOrderMainId = selectionRows[0]['id']
  328 + this.orderId = selectionRows[0]['orderId'];
  329 + },
  330 + getSuperFieldList(){
  331 + let fieldList=[];
  332 + fieldList.push({type:'string',value:'orderId',text:'主料号',dictCode:''})
  333 + fieldList.push({type:'string',value:'orderCompany',text:'订货单位',dictCode:''})
  334 + fieldList.push({type:'date',value:'orderDate',text:'订单日期'})
  335 + fieldList.push({type:'date',value:'deliveryDate',text:'交货日期'})
  336 + fieldList.push({type:'string',value:'status',text:'状态',dictCode:''})
  337 + fieldList.push({type:'date',value:'finishDate',text:'实际完成时间'})
  338 + fieldList.push({type:'string',value:'verifyDate',text:'出货检验',dictCode:''})
  339 + fieldList.push({type:'date',value:'deliveryDate1',text:'出货日期'})
  340 + fieldList.push({type:'string',value:'pics',text:'主料图片',dictCode:''})
  341 + this.superFieldList = fieldList
  342 + }
  343 + }
  344 + }
  345 + </script>
  346 + <style scoped>
  347 + @import '~@assets/less/common.less'
  348 +
  349 + </style>
  1 +<template>
  2 + <j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
  3 + switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
  4 + <a-spin :spinning="confirmLoading">
  5 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  6 + <a-row>
  7 + <a-col :span="24">
  8 + <a-form-model-item label="外购件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  9 + <a-input v-model="model.productName" placeholder="请输入外购件名称"></a-input>
  10 + </a-form-model-item>
  11 + </a-col>
  12 + <a-col :span="24">
  13 + <a-form-model-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">
  14 + <a-input v-model="model.specifications" placeholder="请输入规格型号"></a-input>
  15 + </a-form-model-item>
  16 + </a-col>
  17 + <a-col :span="24">
  18 + <a-form-model-item label="外形尺寸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="appearanceSize">
  19 + <a-input v-model="model.appearanceSize" placeholder="请输入外形尺寸"></a-input>
  20 + </a-form-model-item>
  21 + </a-col>
  22 + <a-col :span="24">
  23 + <a-form-model-item label="品牌及技术条件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
  24 + <a-input v-model="model.brand" placeholder="请输入品牌及技术条件"></a-input>
  25 + </a-form-model-item>
  26 + </a-col>
  27 + <a-col :span="24">
  28 + <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
  29 + <a-input v-model="model.danwei" placeholder="请输入单位"></a-input>
  30 + </a-form-model-item>
  31 + </a-col>
  32 + <a-col :span="24">
  33 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
  34 + <a-input v-model="model.num" placeholder="请输入数量"></a-input>
  35 + </a-form-model-item>
  36 + </a-col>
  37 + <a-col :span="24">
  38 + <a-form-model-item label="要求到货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
  39 + <j-date placeholder="请选择要求到货时间" v-model="model.deliveryTime" style="width: 100%"
  40 + :disabled-date="disabledEndDate" />
  41 + </a-form-model-item>
  42 + </a-col>
  43 +
  44 + <a-col :span="24">
  45 + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
  46 + <a-input v-model="model.notes" placeholder="请输入备注"></a-input>
  47 + </a-form-model-item>
  48 + </a-col>
  49 + </a-row>
  50 + </a-form-model>
  51 + </a-spin>
  52 + </j-modal>
  53 +</template>
  54 +
  55 +<script>
  56 +
  57 +import { httpAction } from '@/api/manage'
  58 +import { validateDuplicateValue } from '@/utils/util'
  59 +import { duplicateCheck } from '@/api/api'
  60 +import {listProductType} from '@/api/ProductTpye'
  61 +import moment from 'moment'
  62 +
  63 +export default {
  64 + name: "BiddingSqFormModal",
  65 + components: {
  66 + },
  67 + data() {
  68 + return {
  69 + title: "新增材料及外购件表",
  70 + options:[],
  71 + width: 800,
  72 + visible: false,
  73 + model: {
  74 + },
  75 + labelCol: {
  76 + xs: { span: 24 },
  77 + sm: { span: 5 },
  78 + },
  79 + wrapperCol: {
  80 + xs: { span: 24 },
  81 + sm: { span: 16 },
  82 + },
  83 +
  84 + confirmLoading: false,
  85 + validatorRules: {
  86 + productName: [
  87 + { required: true, message: '请输入外购件名称!' },
  88 + ],
  89 + specifications: [
  90 + { required: true, message: '请输入规格型号!' },
  91 + ],
  92 + appearanceSize: [
  93 + { required: true, message: '请输入外形尺寸!' },
  94 + ],
  95 + danwei: [
  96 + { required: true, message: '请输入单位!' },
  97 + ],
  98 + num: [
  99 + { required: true, message: '请输入数量!' },
  100 + ],
  101 + deliveryTime: [
  102 + { required: true, message: '请输入要求到货时间!' },
  103 + ],
  104 + // pics: [
  105 + // { required: true, message: '请输入主料图片!' },
  106 + // ],
  107 + },
  108 + url: {
  109 + add: "/order_form/tblOrderForm/add",
  110 + edit: "/order_form/tblOrderForm/edit",
  111 + }
  112 +
  113 + }
  114 + },
  115 + created() {
  116 + // this.model.status = '未下单'
  117 + //备份model原始值
  118 + // this.modelDefault = JSON.parse(JSON.stringify(this.model));
  119 + },
  120 + methods: {
  121 + add() {
  122 + this.edit();
  123 + },
  124 + edit(id) {
  125 + this.model.orderId = id
  126 + console.log('this.model:===',this.model)
  127 + // this.model = Object.assign({}, record);
  128 + this.visible = true;
  129 + // this.loadTree()
  130 + },
  131 + loadTree(){
  132 + var that = this;
  133 + listProductType().then((res)=>{
  134 + if(res.success){
  135 + // that.treeData = [];
  136 + that.options = res.result
  137 + }
  138 + });
  139 + },
  140 + close() {
  141 + this.$emit('close');
  142 + this.visible = false;
  143 + this.$refs.form.clearValidate();
  144 + },
  145 + handleOk() {
  146 + const that = this;
  147 +
  148 + // 触发表单验证
  149 + this.$refs.form.validate(valid => {
  150 + if (valid) {
  151 + console.log(this.model)
  152 + this.$emit('childByValue', this.model)
  153 + that.close();
  154 + this.model = {}
  155 + // // return
  156 + // that.confirmLoading = true;
  157 + // let httpurl = '';
  158 + // let method = '';
  159 + // if (!this.model.id) {
  160 + // httpurl += this.url.add;
  161 + // method = 'post';
  162 + // } else {
  163 + // httpurl += this.url.edit;
  164 + // method = 'put';
  165 + // }
  166 + // httpAction(httpurl, this.model, method).then((res) => {
  167 + // if (res.success) {
  168 + // that.$message.success(res.message);
  169 + // that.$emit('ok');
  170 + // } else {
  171 + // that.$message.warning(res.message);
  172 + // }
  173 + // }).finally(() => {
  174 + // that.confirmLoading = false;
  175 + // that.close();
  176 + // })
  177 + } else {
  178 + return false
  179 + }
  180 + })
  181 + },
  182 + handleCancel() {
  183 + this.close()
  184 + },
  185 + validateBidNo(rule, value, callback) {
  186 + var params = {
  187 + tableName: 'tbl_order_form',
  188 + fieldName: 'order_id',
  189 + fieldVal: value,
  190 + dataId: this.model.id,
  191 + }
  192 + duplicateCheck(params).then((res) => {
  193 + if (res.success) {
  194 + callback()
  195 + } else {
  196 + callback('编号已存在!')
  197 + }
  198 + })
  199 + },
  200 + disabledEndDate(val) {
  201 + return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
  202 + },
  203 +
  204 + }
  205 +}
  206 +</script>
  1 +<template>
  2 + <j-modal :title="title+titlea" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
  3 + switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭" >
  4 + <a-spin :spinning="confirmLoading">
  5 + <a-form-model ref="form" :model="model">
  6 + <a-row>
  7 + <a-col :span="24">
  8 + <a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
  9 + {{model.workOrder}}
  10 + </a-form-model-item>
  11 + </a-col>
  12 + <a-col :span="24">
  13 + <a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  14 + {{model.productName}}
  15 + </a-form-model-item>
  16 + </a-col>
  17 + <!-- <a-col :span="24">
  18 + <a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
  19 + {{model.productType}}
  20 + </a-form-model-item>
  21 + </a-col> -->
  22 + <a-col :span="24">
  23 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
  24 + {{model.quantity}}
  25 + </a-form-model-item>
  26 + </a-col>
  27 + <a-col :span="24">
  28 + <a-form-model-item label="生产图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
  29 + <j-image-upload isMultiple v-model="model.designPic"></j-image-upload>
  30 + </a-form-model-item>
  31 + </a-col>
  32 + <a-col :span="24">
  33 + <a-form-model-item label="生产图文件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
  34 + <j-upload file-type="file" isMultiple v-model="model.designFile"></j-upload>
  35 + </a-form-model-item>
  36 + </a-col>
  37 + </a-row>
  38 + </a-form-model>
  39 + </a-spin>
  40 + <div class="table-operator">材料及外购件表:
  41 + <a-button @click="handleBidding" type="primary" icon="plus">新增</a-button>
  42 + </div>
  43 + <a-table
  44 + ref="table"
  45 + size="middle"
  46 + bordered
  47 + rowKey="id"
  48 + class="j-table-force-nowrap"
  49 + :scroll="{x:true}"
  50 + :columns="columns"
  51 + :dataSource="dataSource"
  52 + >
  53 + <span slot="action" slot-scope="text, record,index">
  54 + <div v-if="record.productName">
  55 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(index)">
  56 + <a>删除</a>
  57 + </a-popconfirm>
  58 + </div>
  59 + </span>
  60 + </a-table>
  61 + <div>
  62 + <BiddingSqFormModal ref="BiddingSqFormModal" @childByValue="childByValue"></BiddingSqFormModal>
  63 + </div>
  64 + </j-modal>
  65 +</template>
  66 +
  67 +<script>
  68 +
  69 +import { httpAction } from '@/api/manage'
  70 +import { validateDuplicateValue } from '@/utils/util'
  71 +import { duplicateCheck } from '@/api/api'
  72 +import {listProductType} from '@/api/ProductTpye'
  73 +import {getOneOrder} from '@/api/ProductTpye'
  74 +import BiddingSqFormModal from './BiddingSqFormModal'
  75 +import {queryDesignByOrderId} from '@/api/TblSalaryBase'
  76 +import moment from 'moment'
  77 +
  78 +export default {
  79 + name: "ProductDesignModal",
  80 + components: {
  81 + BiddingSqFormModal
  82 + },
  83 + data() {
  84 + return {
  85 + title: "产品设计",
  86 + titlea:"",
  87 + options:[],
  88 + width: 1000,
  89 + visible: false,
  90 + model: {
  91 + },
  92 + labelCol: {
  93 + xs: { span: 24 },
  94 + sm: { span: 5 },
  95 + },
  96 + wrapperCol: {
  97 + xs: { span: 24 },
  98 + sm: { span: 16 },
  99 + },
  100 + confirmLoading: false,
  101 + url: {
  102 + add: "/product_design/tblProductDesign/add",
  103 + edit: "/product_design/tblProductDesign/edit",
  104 + list:"/trad/tblBiddingShenq/list",
  105 + },
  106 + id:'',
  107 + dataSource: [],
  108 + columns: [
  109 + {
  110 + title:'序号',
  111 + align:"center",
  112 + customRender: (text, record, index) => {
  113 + return `${index+1}`
  114 + },
  115 + },
  116 + {
  117 + title: '外购件名称',
  118 + dataIndex: 'productName',
  119 + key: 'productName',
  120 + },
  121 + {
  122 + title: '规格型号',
  123 + dataIndex: 'specifications',
  124 + key: 'specifications',
  125 + },
  126 + {
  127 + title: '外形尺寸',
  128 + dataIndex: 'appearanceSize',
  129 + key: 'appearanceSize',
  130 + },
  131 + {
  132 + title: '品牌及技术条件',
  133 + dataIndex: 'brandTechnicalConditions',
  134 + key: 'brandTechnicalConditions',
  135 + },
  136 + {
  137 + title: '单位',
  138 + dataIndex: 'danwei',
  139 + key: 'danwei',
  140 + },
  141 + {
  142 + title: '数量',
  143 + dataIndex: 'num',
  144 + key: 'num',
  145 + },
  146 + {
  147 + title: '要求到货时间',
  148 + dataIndex: 'deliveryTime',
  149 + key: 'deliveryTime',
  150 + },
  151 + {
  152 + title: '备注',
  153 + dataIndex: 'notes',
  154 + key: 'notes',
  155 + },
  156 + {
  157 + title: '操作',
  158 + dataIndex: 'action',
  159 + align:"center",
  160 + fixed:"right",
  161 + width:147,
  162 + scopedSlots: { customRender: 'action' },
  163 + }
  164 + ],
  165 +
  166 + }
  167 + },
  168 + created() {
  169 + // this.model.status = '未下单'
  170 + //备份model原始值
  171 + // this.modelDefault = JSON.parse(JSON.stringify(this.model));
  172 + },
  173 + methods: {
  174 + add() {
  175 + this.edit();
  176 + },
  177 + edit(id,record) {
  178 + // console.log('id',id)
  179 + this.id = id
  180 + this.visible = true;
  181 + if(record){
  182 + this.titlea = '编辑'
  183 + console.log('============1========')
  184 + this.model = Object.assign({}, record);
  185 + console.log('============1========',this.model)
  186 + this.loadDesign();
  187 + this.loadBiddingSq()
  188 + }else{
  189 + this.titlea = "新增"
  190 + this.loadOrder()
  191 + }
  192 +
  193 + },
  194 + loadOrder(){
  195 + var that = this;
  196 + getOneOrder(that.id).then((res)=>{
  197 + console.log('============4========')
  198 + console.log(res)
  199 + if(res.success){
  200 + this.model = res.result
  201 + }
  202 + });
  203 + },
  204 + loadDesign(){
  205 + queryDesignByOrderId(this.model.orderId).then((res)=>{
  206 + console.log('============2========')
  207 + // console.log('loadDesign',res)
  208 + if(res.success){
  209 + this.model.id = res.result.id
  210 + this.model.designPic = res.result.designPic
  211 + this.model.designFile = res.result.designFile
  212 + // console.log(this.model)
  213 + }
  214 + });
  215 + },
  216 + loadBiddingSq(){
  217 + // console.log('this.model',this.model)
  218 + const tempModel = {
  219 + orderId:this.model.orderId
  220 + }
  221 + console.log(tempModel)
  222 + httpAction(this.url.list, tempModel, "get").then((res) => {
  223 + if (res.success) {
  224 + console.log('============3========')
  225 + // console.log('loadBiddingSq',res)
  226 + this.dataSource = res.result.records
  227 + console.log(this.model)
  228 + } else {
  229 + // that.$message.warning(res.message);
  230 + }
  231 + })
  232 + },
  233 + childByValue (childValue) {
  234 + // childValue就是子组件传过来的值
  235 + this.dataSource.push(childValue)
  236 + // this.dataSource = this.dataSource.filter((item) => {
  237 + // console.log(['item.orderId',item.orderId])
  238 + // return item.orderId !== undefined
  239 + // })
  240 + // console.log('this.dataSource==',this.dataSource)
  241 + },
  242 + handleDelete(index){
  243 + this.dataSource.splice(index, 1);
  244 + },
  245 + handleBidding(){
  246 + this.$refs.BiddingSqFormModal.edit(this.model.orderId);
  247 + this.$refs.BiddingSqFormModal.disableSubmit = false;
  248 + },
  249 + close() {
  250 + this.$emit('close');
  251 + this.visible = false;
  252 + this.$refs.form.clearValidate();
  253 + },
  254 + handleOk() {
  255 + const that = this;
  256 + // 触发表单验证
  257 + this.$refs.form.validate(valid => {
  258 + if (valid) {
  259 + this.model.biddingSqList = this.dataSource
  260 + console.log(this.model)
  261 + // return
  262 + that.confirmLoading = true;
  263 + let httpurl = '';
  264 + let method = '';
  265 + if (this.model.productDesignStatus == 0) {
  266 + httpurl += this.url.add;
  267 + method = 'post';
  268 + } else {
  269 + httpurl += this.url.edit;
  270 + method = 'put';
  271 + }
  272 + httpAction(httpurl, this.model, method).then((res) => {
  273 + if (res.success) {
  274 + that.$message.success(res.message);
  275 + that.$emit('ok');
  276 + } else {
  277 + that.$message.warning(res.message);
  278 + }
  279 + }).finally(() => {
  280 + that.confirmLoading = false;
  281 + that.close();
  282 + })
  283 + } else {
  284 + return false
  285 + }
  286 + })
  287 + },
  288 + handleCancel() {
  289 + this.close()
  290 + },
  291 + validateBidNo(rule, value, callback) {
  292 + var params = {
  293 + tableName: 'tbl_order_form',
  294 + fieldName: 'order_id',
  295 + fieldVal: value,
  296 + dataId: this.model.id,
  297 + }
  298 + duplicateCheck(params).then((res) => {
  299 + if (res.success) {
  300 + callback()
  301 + } else {
  302 + callback('编号已存在!')
  303 + }
  304 + })
  305 + },
  306 + disabledEndDate(val) {
  307 + return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
  308 + },
  309 +
  310 + }
  311 +}
  312 +</script>