作者 张晓杰

生产订单、产品设计

// import api from './index'
import { axios } from '@/utils/request'
export function listProductType(parameter) {
return axios({
url: '/order_form/tblProductType/listProductType',
method: 'get',
data: parameter
})
}
export function getOneOrder(id) {
return axios({
url: '/order_form/tblOrderForm/queryById/'+id,
method: 'get',
})
}
\ No newline at end of file
... ...
// import api from './index'
import { axios } from '@/utils/request'
export function listSalary(parameter) {
return axios({
url: '/salary/base/listSalary',
method: 'get',
data: parameter
})
}
export function queryDesignByOrderId(orderId) {
return axios({
url: '/product_design/tblProductDesign/queryByOrderId/'+orderId,
method: 'get'
})
}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
includedComponents() {
const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES)
console.log("includedRouters:" + includedRouters)
// console.log("includedRouters:" + includedRouters)
//如果是缓存路由,则加入到 cache_included_routes
if (this.$route.meta.keepAlive && this.$route.meta.componentName) {
... ...
... ... @@ -54,7 +54,7 @@ export const JeecgListMixin = {
},
created() {
if (!this.disableMixinCreated) {
console.log(' -- mixin created -- ')
// console.log(' -- mixin created -- ')
this.loadData();
//初始化字典配置 在自己页面定义
this.initDictConfig();
... ... @@ -73,6 +73,7 @@ export const JeecgListMixin = {
},
methods: {
loadData(arg) {
console.log('this.url:',this.url)
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
... ...
... ... @@ -34,7 +34,7 @@ export default class signMd5Utils {
let jsonObj = this.mergeObject(urlParams, requestParams);
//console.log("sign jsonObj: ",jsonObj)
let requestBody = this.sortAsc(jsonObj);
console.log("sign requestBody: ",requestBody)
// console.log("sign requestBody: ",requestBody)
return md5(JSON.stringify(requestBody) + signatureSecret).toUpperCase();
}
... ...
... ... @@ -5,15 +5,28 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="主料号">
<j-input placeholder="请输入主料号" v-model="queryParam.orderId"></j-input>
<a-form-item label="订货单位">
<j-input placeholder="请输入订货单位" v-model="queryParam.orderCompany"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工作令">
<j-input placeholder="请输入工作令" v-model="queryParam.workOrder"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="产品类型">
<!-- <j-input placeholder="请选择产品类型" v-model="queryParam.productType"></j-input> -->
<a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="订单日期">
<j-date placeholder="请选择订单日期" v-model="queryParam.orderDate"></j-date>
</a-form-item>
</a-col>
</a-col> -->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
... ... @@ -83,43 +96,27 @@
</template>
<span slot="action" slot-scope="text, record">
<div v-if="record.status === '未下单'">
<div v-if="record.assignDesignStatus === '0'">
<a @click="handleAssignDesign(record)" >派任务</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)" >编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</div>
<!-- 生产中 -->
<div v-else-if="record.status === '生产中'">
<a @click="handleVerify(record)" >检验</a>
</div>
<div v-else-if="record.status === '已完成'">
<a @click="delivery(record)" >出货</a>
</div>
<!-- 已出货 -->
<div v-else>
<a @click="pics2Upload(record)" >收货</a>
</div>
<!-- 已收货 -->
<div>
<a @click="handleViewOrders(record)" >查看</a>
</div>
</span>
</a-table>
</div>
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="订单子项" key="1" >
<TblWorkOrderList :mainId="tblWorkOrderMainId" :orderId="orderId" @orderOk="workOrderOk"/>
</a-tab-pane>
</a-tabs>
<tblOrderForm-modal ref="modalForm" @ok="modalFormOk"></tblOrderForm-modal>
<VerifyModal ref="verifyModal" @ok="()=>this.loadData()"></VerifyModal>
<PrintModal ref="printModal" @ok="()=>this.loadData()"></PrintModal>
<Pics2UploadModal ref="pics2Modal" @ok="()=>this.loadData()"></Pics2UploadModal>
<AssignDesignModal ref="AssignDesignModal" @ok="modalFormOk"></AssignDesignModal>
<ViewOrdersModal ref="ViewOrdersModal" @ok="modalFormOk"></ViewOrdersModal>
</a-card>
</template>
... ... @@ -127,28 +124,34 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblOrderFormModal from './modules/TblOrderFormModal'
import VerifyModal from './modules/VerifyModal'
import PrintModal from './modules/PrintModal'
import Pics2UploadModal from './modules/Pics2UploadModal'
import { getAction } from '@/api/manage'
import TblWorkOrderList from './TblWorkOrderList'
import AssignDesignModal from './modules/AssignDesignModal'
import ViewOrdersModal from './modules/ViewOrdersModal'
import {listProductType} from '@/api/ProductTpye'
import '@/assets/less/TableExpand.less'
export default {
name: "TblOrderFormList",
mixins:[JeecgListMixin],
components: {
TblWorkOrderList,
TblOrderFormModal,
VerifyModal,PrintModal,Pics2UploadModal
AssignDesignModal,ViewOrdersModal
},
data () {
return {
description: '订单表管理页面',
options:[],
// 表头
columns: [
{
title:'主料号',
title:'序号',
align:"center",
customRender: (text, record, index) => {
return `${(this.ipagination.current - 1) * this.ipagination.pageSize + index + 1}`
},
},
{
title:'订单编号',
align:"center",
dataIndex: 'orderId'
},
... ... @@ -158,54 +161,91 @@
dataIndex: 'orderCompany'
},
{
title:'订单日期',
title:'工作令',
align:"center",
dataIndex: 'orderDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'workOrder'
},
{
title:'交货日期',
title:'产品名称',
align:"center",
dataIndex: 'deliveryDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
dataIndex: 'productName',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'产品类型',
align:"center",
dataIndex: 'productType',
customRender: function (text) {
if (text === 'XC') {
return '线槽'
} else if (text === 'JD') {
return '接地'
} else if (text === 'QZ') {
return '卡子'
} else if (text === 'GX') {
return '柜、箱、盒'
} else if (text === 'SJ') {
return '司机室'
} else if (text === 'FS') {
return '附属钢'
} else {
return text
}
},
},
{
title:'状态',
title:'任务下达时间',
align:"center",
dataIndex: 'status'
dataIndex: 'orderDate'
},
{
title:'实际完成时间',
title:'派工时间',
align:"center",
dataIndex: 'finishDate',
dataIndex: 'dispatchDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'出货检验',
align:"center",
dataIndex: 'verifyResult'
},
{
title:'出货日期',
title:'交货时间',
align:"center",
dataIndex: 'deliveryDate1',
dataIndex: 'deliveryDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'主料图片',
title:'数量',
align:"center",
dataIndex: 'quantity'
},
{
title:'总工时',
align:"center",
dataIndex: 'pics',
scopedSlots: {customRender: 'imgSlot'}
dataIndex: 'totalWorkingHours'
},
{
title:'已派发工时',
align:"center",
dataIndex: 'dispatchedWorkingHours'
},
// {
// title:'出货日期',
// align:"center",
// dataIndex: 'deliveryDate1',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
// },
// {
// title:'主料图片',
// align:"center",
// dataIndex: 'pics',
// scopedSlots: {customRender: 'imgSlot'}
// },
{
title: '操作',
dataIndex: 'action',
align:"center",
... ... @@ -236,13 +276,14 @@
total: 0
},
selectedMainId:'',
superFieldList:[],
// superFieldList:[],
tblWorkOrderMainId: '',
orderId:'',
}
},
created() {
this.getSuperFieldList();
// this.getSuperFieldList();
this.loadTree()
},
computed: {
importExcelUrl: function(){
... ... @@ -282,21 +323,26 @@
this.tblWorkOrderMainId = '';
this.orderId = '';
},
// 点击检验的操作
handleVerify(record){
this.$refs.verifyModal.edit(record);
this.$refs.verifyModal.disableSubmit = false;
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
// 出货单点击操作
delivery(record){
this.$refs.printModal.open(record);
this.$refs.printModal.disableSubmit = false;
// 分派设计
handleAssignDesign(record){
this.$refs.AssignDesignModal.edit(record);
this.$refs.AssignDesignModal.disableSubmit = false;
},
// 收货点击操作
pics2Upload(record){
this.$refs.pics2Modal.edit(record);
this.$refs.pics2Modal.disableSubmit = false;
//查看订单详情
handleViewOrders(record){
this.$refs.ViewOrdersModal.edit(record);
this.$refs.ViewOrdersModal.disableSubmit = false;
},
initDictConfig(){
},
clickThenSelect(record) {
... ...
<template>
<j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-row>
<a-col :span="24">
<a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入产品名称" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
<a-select size="small" v-model="model.productType" placeholder="请选择设计人员" allowClear disabled>
<a-select-option v-for="(item,index) in productTypeOptions" :key="index" :value="item.productTypeId" >{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
<a-input v-model="model.quantity" placeholder="请输入数量" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
:disabled-date="disabledEndDate" disabled/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="派工时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择交货日期" v-model="model.assignDesignDate" style="width: 100%"
:disabled-date="disabledEndDate" />
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="设计人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
<a-select size="small" v-model="model.designer" placeholder="请选择设计人员" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.jobId">{{ item.userName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="派工日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择派工日期" v-model="model.dispatchDate" style="width: 100%"
:disabled-date="disabledEndDate"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import {listSalary} from '@/api/TblSalaryBase'
import {listProductType} from '@/api/ProductTpye'
import moment from 'moment'
export default {
name: "AssignDesignModal",
components: {
},
data() {
return {
title: "操作",
productTypeOptions:[],
options:[],
width: 800,
visible: false,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
// orderId: [
// { required: true, message: '请输入主料号!' },
// { validator: this.validateBidNo }
// ],
orderCompany: [
{ required: true, message: '请输入订货单位!' },
],
workOrder: [
{ required: true, message: '请输入工作令!' },
],
productName: [
{ required: true, message: '请输入产品名称!' },
],
productType: [
{ required: true, message: '请输入产品类型!' },
],
quantity: [
{ required: true, message: '请输入数量!' },
],
// orderDate: [
// { required: true, message: '请输入订单日期!' },
// ],
deliveryDate: [
{ required: true, message: '请输入交货日期!' },
],
// pics: [
// { required: true, message: '请输入主料图片!' },
// ],
},
url: {
edit: "/order_form/tblOrderForm/updateDesigner"
}
}
},
created() {
// this.model.status = '未下单'
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit(this.modelDefault);
},
edit(record) {
this.model = Object.assign({}, record);
this.model.assignDesignDate = new Date().toISOString()
this.visible = true;
this.loadProductType()
this.loadUser()
},
loadProductType(){
var that = this;
listProductType().then((res)=>{
if(res.success){
console.log(res)
that.productTypeOptions = res.result
console.log(that.productTypeOptions)
}
});
},
loadUser(){
var that = this;
listSalary().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk() {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
console.log(this.model)
// return
that.confirmLoading = true;
let httpurl = this.url.edit;
let method = 'put';
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
} else {
return false
}
})
},
handleCancel() {
this.close()
},
validateBidNo(rule, value, callback) {
var params = {
tableName: 'tbl_order_form',
fieldName: 'order_id',
fieldVal: value,
dataId: this.model.id,
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback('编号已存在!')
}
})
},
disabledEndDate(val) {
return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
},
}
}
</script>
\ No newline at end of file
... ...
<template>
<j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-row>
<!-- <a-col :span="24">
<a-form-model-item label="主料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
<a-input v-model="model.orderId" placeholder="请输入主料号"></a-input>
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
<a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
<a-input v-model="model.workOrder" placeholder="请输入工作令"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入产品名称"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
<a-input v-model="model.productType" placeholder="请选择产品类型"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
<a-input v-model="model.quantity" placeholder="请输入数量"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="订单日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDate">
<j-date placeholder="请选择订单日期" v-model="model.orderDate" style="width: 100%"
:disabled-date="disabledEndDate" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
:disabled-date="disabledEndDate" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="主料图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
<j-image-upload isMultiple v-model="model.pics"></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import moment from 'moment'
export default {
name: "TblOrderFormModal",
components: {
},
data() {
return {
title: "操作",
width: 800,
visible: false,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
// orderId: [
// { required: true, message: '请输入主料号!' },
// { validator: this.validateBidNo }
// ],
orderCompany: [
{ required: true, message: '请输入订货单位!' },
],
workOrder: [
{ required: true, message: '请输入工作令!' },
],
productName: [
{ required: true, message: '请输入产品名称!' },
],
productType: [
{ required: true, message: '请输入产品类型!' },
],
quantity: [
{ required: true, message: '请输入数量!' },
],
// orderDate: [
// { required: true, message: '请输入订单日期!' },
// ],
deliveryDate: [
{ required: true, message: '请输入交货日期!' },
],
// pics: [
// { required: true, message: '请输入主料图片!' },
// ],
},
url: {
add: "/order_form/tblOrderForm/add",
edit: "/order_form/tblOrderForm/edit",
}
}
},
created() {
this.model.status = '未下单'
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit(this.modelDefault);
},
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk() {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
} else {
return false
}
})
},
handleCancel() {
this.close()
},
validateBidNo(rule, value, callback) {
var params = {
tableName: 'tbl_order_form',
fieldName: 'order_id',
fieldVal: value,
dataId: this.model.id,
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback('编号已存在!')
}
})
},
disabledEndDate(val) {
return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
},
}
}
</script>
\ No newline at end of file
... ...
... ... @@ -5,21 +5,43 @@
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-row>
<a-col :span="24">
<a-form-model-item label="主料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
<a-input v-model="model.orderId" placeholder="请输入主料号"></a-input>
<a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
<a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
<a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
<a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
<a-input v-model="model.workOrder" placeholder="请输入工作令"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入产品名称"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
<a-select size="small" v-model="model.productType" placeholder="请选择产品类型" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
<a-input v-model="model.quantity" placeholder="请输入数量"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="总工时" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
<a-input v-model="model.totalWorkingHours" placeholder="请输入总工时"></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="订单日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDate">
<j-date placeholder="请选择订单日期" v-model="model.orderDate" style="width: 100%"
:disabled-date="disabledEndDate" />
</a-form-model-item>
</a-col>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="交货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择交货日期" v-model="model.deliveryDate" style="width: 100%"
... ... @@ -31,6 +53,16 @@
<j-image-upload isMultiple v-model="model.pics"></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="主料文件上传" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
<j-upload isMultiple v-model="model.files"></j-upload>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="文件上传" prop="files">
<j-upload v-model="model.files"></j-upload>
</a-form-model-item>
</a-col> -->
</a-row>
</a-form-model>
</a-spin>
... ... @@ -42,6 +74,7 @@
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import {listProductType} from '@/api/ProductTpye'
import moment from 'moment'
export default {
... ... @@ -51,6 +84,7 @@ export default {
data() {
return {
title: "操作",
options:[],
width: 800,
visible: false,
model: {
... ... @@ -66,22 +100,34 @@ export default {
confirmLoading: false,
validatorRules: {
orderId: [
{ required: true, message: '请输入主料号!' },
{ validator: this.validateBidNo }
],
// orderId: [
// { required: true, message: '请输入主料号!' },
// { validator: this.validateBidNo }
// ],
orderCompany: [
{ required: true, message: '请输入订货单位!' },
],
orderDate: [
{ required: true, message: '请输入订单日期!' },
workOrder: [
{ required: true, message: '请输入工作令!' },
],
productName: [
{ required: true, message: '请输入产品名称!' },
],
productType: [
{ required: true, message: '请输入产品类型!' },
],
quantity: [
{ required: true, message: '请输入数量!' },
],
// orderDate: [
// { required: true, message: '请输入订单日期!' },
// ],
deliveryDate: [
{ required: true, message: '请输入交货日期!' },
],
pics: [
{ required: true, message: '请输入主料图片!' },
],
// pics: [
// { required: true, message: '请输入主料图片!' },
// ],
},
url: {
add: "/order_form/tblOrderForm/add",
... ... @@ -91,7 +137,7 @@ export default {
}
},
created() {
this.model.status = '未下单'
// this.model.status = '未下单'
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
... ... @@ -102,7 +148,17 @@ export default {
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
this.loadTree()
},
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
close() {
this.$emit('close');
this.visible = false;
... ... @@ -113,6 +169,8 @@ export default {
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
console.log(this.model)
// return
that.confirmLoading = true;
let httpurl = '';
let method = '';
... ...
<template>
<j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<div style="display: flex">
<div style="display:inline-block;width:45%;margin: auto;">
<table>
<tr>
<th scop="col">订单号:</th>
<th scop="col">{{model.orderId}}</th>
</tr>
<tr>
<th scop="col">订货单位:</th>
<th scop="col">{{model.orderCompany}}</th>
</tr>
<tr>
<th scop="col">工作令:</th>
<th scop="col">{{model.workOrder}}</th>
</tr>
<tr>
<th scop="col">产品名称:</th>
<th scop="col">{{model.productName}}</th>
</tr>
<tr>
<th scop="col">产品类型:</th>
<th scop="col">{{model.productType}}</th>
</tr>
<tr>
<th scop="col">任务下达时间:</th>
<th scop="col">{{model.orderDate}}</th>
</tr>
<tr>
<th scop="col">派工时间:</th>
<th scop="col">{{model.dispatchDate}}</th>
</tr>
<tr>
<th scop="col">交货时间:</th>
<th scop="col">{{model.deliveryDate}}</th>
</tr>
<tr>
<th scop="col">数量(套):</th>
<th scop="col">{{model.quantity}}</th>
</tr>
<tr>
<th scop="col">总工时:</th>
<th scop="col">{{model.totalWorkingHours}}</th>
</tr>
<tr>
<th scop="col">已派发工时:</th>
<th scop="col">{{model.dispatchedWorkingHours}}</th>
</tr>
<tr v-if="model.files">
<th scop="col">主料图文件:</th>
<th scop="col">{{model.files}}</th>
</tr>
</table>
</div>
<div style="display:inline-block;width:45%;">
<div class="show">
<img :src="getImgView(show)" :preview="num" alt="" height="100px">
</div>
<div class="imgBox">
<div :class="[num == index?'borderShow':'']" v-for="(item,index) of picList" :key="index" @click="onImg(index)">
<img :src="getImgView(item)" height="25px" alt="" style="margin-left: 20px;">
</div>
</div>
</div>
</div>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import {listProductType} from '@/api/ProductTpye'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import moment from 'moment'
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
export default {
name: "ViewOrdersModal",
mixins: [JeecgListMixin],
components: {
},
data() {
return {
title: "生产订单详情",
baseURL:apiBaseUrl,
options:[],
width: 800,
visible: false,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
picList:"",
show:"",
num: 0,
url: {
list: "/order_form/tblOrderForm/list",
}
}
},
created() {
// this.model.status = '未下单'
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
console.log(apiBaseUrl)
},
methods: {
add() {
this.edit(this.modelDefault);
},
edit(record) {
this.model = Object.assign({}, record);
var picList = this.model.pics.split(',')
this.picList = picList
this.show = this.picList[0];
console.log('this.picList',this.picList)
this.visible = true;
this.loadTree()
},
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
onImg(e){
this.show = this.picList[e];
this.num = e
},
close() {
this.$emit('close');
this.visible = false;
// this.$refs.form.clearValidate();
},
handleOk() {
this.close();
},
handleCancel() {
this.close()
},
validateBidNo(rule, value, callback) {
var params = {
tableName: 'tbl_order_form',
fieldName: 'order_id',
fieldVal: value,
dataId: this.model.id,
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback('编号已存在!')
}
})
},
disabledEndDate(val) {
return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
},
}
}
</script>
<style scoped>
.imgBox{
display: flex;
}
.imgBox img{
width: 50px;
height: 50px;
margin: 10px;
}
.imgBox div{
margin: 5px;
}
.borderShow{
border: 2px solid rgb(141, 134, 134);
}
.show img{
margin-bottom: 10px;
height: 200px;
width: 200px;
}
</style>
\ No newline at end of file
... ...
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="订货单位">
<j-input placeholder="请输入订货单位" v-model="queryParam.orderCompany"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工作令">
<j-input placeholder="请输入工作令" v-model="queryParam.workOrder"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="产品类型">
<a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleUpload()" type="primary" icon="plus">上传设计图及材料表</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('订单表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
:customRow="clickThenSelect"
@change="handleMyTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<div v-if="record.productDesignStatus === '0'">
<a @click="handleViewOrders(record)" >查看</a>
</div>
<div v-else-if="record.productDesignStatus === '1'">
<a @click="handleViewOrders(record)" >查看</a>
<a-divider type="vertical"/>
<a @click="handleUploadOrders(record.id,record)" >编辑</a>
</div>
<div>
</div>
</span>
</a-table>
</div>
<ProductDesignModal ref="ProductDesignModal" @ok="modalFormOk"></ProductDesignModal>
<ViewOrdersModal ref="ViewOrdersModal" @ok="modalFormOk"></ViewOrdersModal>
</a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductDesignModal from './modules/ProductDesignModal'
import ViewOrdersModal from '../order_form/modules/ViewOrdersModal.vue'
import '@/assets/less/TableExpand.less'
import {listProductType} from '@/api/ProductTpye'
export default {
name: "ProductDesignList",
mixins:[JeecgListMixin],
components: {
ProductDesignModal,ViewOrdersModal
},
data () {
return {
description: '订单表管理页面',
options:[],
// 表头
columns: [
{
title:'序号',
align:"center",
customRender: (text, record, index) => {
return `${(this.ipagination.current - 1) * this.ipagination.pageSize + index + 1}`
},
},
{
title:'订单编号',
align:"center",
dataIndex: 'orderId'
},
{
title:'订货单位',
align:"center",
dataIndex: 'orderCompany'
},
{
title:'工作令',
align:"center",
dataIndex: 'workOrder'
},
{
title:'产品名称',
align:"center",
dataIndex: 'productName',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'产品类型',
align:"center",
dataIndex: 'productType',
customRender: function (text) {
if (text === 'XC') {
return '线槽'
} else if (text === 'JD') {
return '接地'
} else if (text === 'QZ') {
return '卡子'
} else if (text === 'GX') {
return '柜、箱、盒'
} else if (text === 'SJ') {
return '司机室'
} else if (text === 'FS') {
return '附属钢'
} else {
return text
}
},
},
{
title:'任务下达时间',
align:"center",
dataIndex: 'orderDate'
},
{
title:'派工时间',
align:"center",
dataIndex: 'dispatchDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'交货时间',
align:"center",
dataIndex: 'deliveryDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'数量',
align:"center",
dataIndex: 'quantity'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/order_form/tblOrderForm/productDesignList",
delete: "/order_form/tblOrderForm/delete",
deleteBatch: "/order_form/tblOrderForm/deleteBatch",
exportXlsUrl: "/order_form/tblOrderForm/exportXls",
importExcelUrl: "order_form/tblOrderForm/importExcel",
},
dictOptions:{
},
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '50'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedMainId:'',
superFieldList:[],
tblWorkOrderMainId: '',
orderId:'',
}
},
created() {
this.getSuperFieldList();
this.loadTree()
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}
},
methods: {
// 自定义查询
searchQuery() {
this.loadData(1);
this.tblWorkOrderMainId = '';
this.orderId = '';
// 点击查询清空列表选中行
// https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
this.selectedRowKeys = []
this.selectionRows = []
},
// 自定义分页切换动作
handleMyTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
this.tblWorkOrderMainId = '';
this.orderId = '';
},
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
handleViewOrders(record){
this.$refs.ViewOrdersModal.edit(record);
this.$refs.ViewOrdersModal.disableSubmit = false;
},
handleUpload(){
if(this.selectedRowKeys.length == 0){
this.$message.error("请先选中一条数据!")
return
}
this.$refs.ProductDesignModal.edit(this.selectedRowKeys[0],null);
this.$refs.ProductDesignModal.disableSubmit = false;
},
handleUploadOrders(id,record){
this.$refs.ProductDesignModal.edit(id,record);
this.$refs.ProductDesignModal.disableSubmit = false;
},
initDictConfig(){
},
clickThenSelect(record) {
return {
on: {
click: () => {
this.onSelectChange(record.id.split(","), [record]);
}
}
}
},
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
this.selectedMainId='';
this.orderId = '';
this.tblWorkOrderMainId = '';
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedMainId=selectedRowKeys[0]
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
this.tblWorkOrderMainId = selectionRows[0]['id']
this.orderId = selectionRows[0]['orderId'];
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'orderId',text:'主料号',dictCode:''})
fieldList.push({type:'string',value:'orderCompany',text:'订货单位',dictCode:''})
fieldList.push({type:'date',value:'orderDate',text:'订单日期'})
fieldList.push({type:'date',value:'deliveryDate',text:'交货日期'})
fieldList.push({type:'string',value:'status',text:'状态',dictCode:''})
fieldList.push({type:'date',value:'finishDate',text:'实际完成时间'})
fieldList.push({type:'string',value:'verifyDate',text:'出货检验',dictCode:''})
fieldList.push({type:'date',value:'deliveryDate1',text:'出货日期'})
fieldList.push({type:'string',value:'pics',text:'主料图片',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>
\ No newline at end of file
... ...
<template>
<j-modal :title="title" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-row>
<a-col :span="24">
<a-form-model-item label="外购件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入外购件名称"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">
<a-input v-model="model.specifications" placeholder="请输入规格型号"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="外形尺寸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="appearanceSize">
<a-input v-model="model.appearanceSize" placeholder="请输入外形尺寸"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="品牌及技术条件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
<a-input v-model="model.brand" placeholder="请输入品牌及技术条件"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
<a-input v-model="model.danwei" placeholder="请输入单位"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
<a-input v-model="model.num" placeholder="请输入数量"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="要求到货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
<j-date placeholder="请选择要求到货时间" v-model="model.deliveryTime" style="width: 100%"
:disabled-date="disabledEndDate" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
<a-input v-model="model.notes" placeholder="请输入备注"></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import {listProductType} from '@/api/ProductTpye'
import moment from 'moment'
export default {
name: "BiddingSqFormModal",
components: {
},
data() {
return {
title: "新增材料及外购件表",
options:[],
width: 800,
visible: false,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
productName: [
{ required: true, message: '请输入外购件名称!' },
],
specifications: [
{ required: true, message: '请输入规格型号!' },
],
appearanceSize: [
{ required: true, message: '请输入外形尺寸!' },
],
danwei: [
{ required: true, message: '请输入单位!' },
],
num: [
{ required: true, message: '请输入数量!' },
],
deliveryTime: [
{ required: true, message: '请输入要求到货时间!' },
],
// pics: [
// { required: true, message: '请输入主料图片!' },
// ],
},
url: {
add: "/order_form/tblOrderForm/add",
edit: "/order_form/tblOrderForm/edit",
}
}
},
created() {
// this.model.status = '未下单'
//备份model原始值
// this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit();
},
edit(id) {
this.model.orderId = id
console.log('this.model:===',this.model)
// this.model = Object.assign({}, record);
this.visible = true;
// this.loadTree()
},
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk() {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
console.log(this.model)
this.$emit('childByValue', this.model)
that.close();
this.model = {}
// // return
// that.confirmLoading = true;
// let httpurl = '';
// let method = '';
// if (!this.model.id) {
// httpurl += this.url.add;
// method = 'post';
// } else {
// httpurl += this.url.edit;
// method = 'put';
// }
// httpAction(httpurl, this.model, method).then((res) => {
// if (res.success) {
// that.$message.success(res.message);
// that.$emit('ok');
// } else {
// that.$message.warning(res.message);
// }
// }).finally(() => {
// that.confirmLoading = false;
// that.close();
// })
} else {
return false
}
})
},
handleCancel() {
this.close()
},
validateBidNo(rule, value, callback) {
var params = {
tableName: 'tbl_order_form',
fieldName: 'order_id',
fieldVal: value,
dataId: this.model.id,
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback('编号已存在!')
}
})
},
disabledEndDate(val) {
return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
},
}
}
</script>
\ No newline at end of file
... ...
<template>
<j-modal :title="title+titlea" :width="width" :visible="visible" :confirmLoading="confirmLoading" :maskClosable="false"
switchFullscreen @ok="handleOk" @cancel="handleCancel" cancelText="关闭" >
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model">
<a-row>
<a-col :span="24">
<a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
{{model.workOrder}}
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
{{model.productName}}
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productType">
{{model.productType}}
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
{{model.quantity}}
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
<j-image-upload isMultiple v-model="model.designPic"></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产图文件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pics">
<j-upload file-type="file" isMultiple v-model="model.designFile"></j-upload>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="table-operator">材料及外购件表:
<a-button @click="handleBidding" type="primary" icon="plus">新增</a-button>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
>
<span slot="action" slot-scope="text, record,index">
<div v-if="record.productName">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(index)">
<a>删除</a>
</a-popconfirm>
</div>
</span>
</a-table>
<div>
<BiddingSqFormModal ref="BiddingSqFormModal" @childByValue="childByValue"></BiddingSqFormModal>
</div>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { duplicateCheck } from '@/api/api'
import {listProductType} from '@/api/ProductTpye'
import {getOneOrder} from '@/api/ProductTpye'
import BiddingSqFormModal from './BiddingSqFormModal'
import {queryDesignByOrderId} from '@/api/TblSalaryBase'
import moment from 'moment'
export default {
name: "ProductDesignModal",
components: {
BiddingSqFormModal
},
data() {
return {
title: "产品设计",
titlea:"",
options:[],
width: 1000,
visible: false,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
url: {
add: "/product_design/tblProductDesign/add",
edit: "/product_design/tblProductDesign/edit",
list:"/trad/tblBiddingShenq/list",
},
id:'',
dataSource: [],
columns: [
{
title:'序号',
align:"center",
customRender: (text, record, index) => {
return `${index+1}`
},
},
{
title: '外购件名称',
dataIndex: 'productName',
key: 'productName',
},
{
title: '规格型号',
dataIndex: 'specifications',
key: 'specifications',
},
{
title: '外形尺寸',
dataIndex: 'appearanceSize',
key: 'appearanceSize',
},
{
title: '品牌及技术条件',
dataIndex: 'brandTechnicalConditions',
key: 'brandTechnicalConditions',
},
{
title: '单位',
dataIndex: 'danwei',
key: 'danwei',
},
{
title: '数量',
dataIndex: 'num',
key: 'num',
},
{
title: '要求到货时间',
dataIndex: 'deliveryTime',
key: 'deliveryTime',
},
{
title: '备注',
dataIndex: 'notes',
key: 'notes',
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
}
},
created() {
// this.model.status = '未下单'
//备份model原始值
// this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit();
},
edit(id,record) {
// console.log('id',id)
this.id = id
this.visible = true;
if(record){
this.titlea = '编辑'
console.log('============1========')
this.model = Object.assign({}, record);
console.log('============1========',this.model)
this.loadDesign();
this.loadBiddingSq()
}else{
this.titlea = "新增"
this.loadOrder()
}
},
loadOrder(){
var that = this;
getOneOrder(that.id).then((res)=>{
console.log('============4========')
console.log(res)
if(res.success){
this.model = res.result
}
});
},
loadDesign(){
queryDesignByOrderId(this.model.orderId).then((res)=>{
console.log('============2========')
// console.log('loadDesign',res)
if(res.success){
this.model.id = res.result.id
this.model.designPic = res.result.designPic
this.model.designFile = res.result.designFile
// console.log(this.model)
}
});
},
loadBiddingSq(){
// console.log('this.model',this.model)
const tempModel = {
orderId:this.model.orderId
}
console.log(tempModel)
httpAction(this.url.list, tempModel, "get").then((res) => {
if (res.success) {
console.log('============3========')
// console.log('loadBiddingSq',res)
this.dataSource = res.result.records
console.log(this.model)
} else {
// that.$message.warning(res.message);
}
})
},
childByValue (childValue) {
// childValue就是子组件传过来的值
this.dataSource.push(childValue)
// this.dataSource = this.dataSource.filter((item) => {
// console.log(['item.orderId',item.orderId])
// return item.orderId !== undefined
// })
// console.log('this.dataSource==',this.dataSource)
},
handleDelete(index){
this.dataSource.splice(index, 1);
},
handleBidding(){
this.$refs.BiddingSqFormModal.edit(this.model.orderId);
this.$refs.BiddingSqFormModal.disableSubmit = false;
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk() {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
this.model.biddingSqList = this.dataSource
console.log(this.model)
// return
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (this.model.productDesignStatus == 0) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
} else {
return false
}
})
},
handleCancel() {
this.close()
},
validateBidNo(rule, value, callback) {
var params = {
tableName: 'tbl_order_form',
fieldName: 'order_id',
fieldVal: value,
dataId: this.model.id,
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback('编号已存在!')
}
})
},
disabledEndDate(val) {
return val <= moment(new Date(), 'YYYY-MM-DD HH:mm:ss').subtract(1, 'minute').endOf('minute')
},
}
}
</script>
\ No newline at end of file
... ...