作者 雷海东

@@ -11,12 +11,12 @@ @@ -11,12 +11,12 @@
11 </a-col> 11 </a-col>
12 <a-col :span="12"> 12 <a-col :span="12">
13 <a-form-item label="申请日期"> 13 <a-form-item label="申请日期">
14 - <j-date v-model="queryParam.createTime" placeholder="请选择申请日期" /> 14 + <j-date v-model="queryParam.sqTime" placeholder="请选择申请日期" />
15 </a-form-item> 15 </a-form-item>
16 </a-col> 16 </a-col>
17 <a-col :span="12"> 17 <a-col :span="12">
18 - <a-form-item label="到货日期">  
19 - <j-date v-model="queryParam.deliveryTime" placeholder="请选择到货日期" /> 18 + <a-form-item label="使用日期">
  19 + <j-date v-model="queryParam.deliveryTime" placeholder="请选择使用日期" />
20 </a-form-item> 20 </a-form-item>
21 </a-col> 21 </a-col>
22 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 22 <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -163,7 +163,27 @@ @@ -163,7 +163,27 @@
163 dataIndex: 'danwei' 163 dataIndex: 'danwei'
164 }, 164 },
165 { 165 {
166 - title:'到货日期', 166 + title:'物料类别',
  167 + align:"center",
  168 + dataIndex: 'wuType'
  169 + },
  170 + {
  171 + title:'工作令',
  172 + align:"center",
  173 + dataIndex: 'workOrder'
  174 + },
  175 + {
  176 + title:'用途',
  177 + align:"center",
  178 + dataIndex: 'purpose'
  179 + },
  180 + {
  181 + title:'当前库存',
  182 + align:"center",
  183 + dataIndex: 'ku'
  184 + },
  185 + {
  186 + title:'使用日期',
167 align:"center", 187 align:"center",
168 dataIndex: 'deliveryTime', 188 dataIndex: 'deliveryTime',
169 customRender:function (text) { 189 customRender:function (text) {
@@ -203,7 +223,7 @@ @@ -203,7 +223,7 @@
203 { 223 {
204 title:'申请日期', 224 title:'申请日期',
205 align:"center", 225 align:"center",
206 - dataIndex: 'createTime', 226 + dataIndex: 'sqTime',
207 customRender:function (text) { 227 customRender:function (text) {
208 return !text?"":(text.length>10?text.substr(0,10):text) 228 return !text?"":(text.length>10?text.substr(0,10):text)
209 } 229 }
  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.productName"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="购买日期">
  14 + <j-date v-model="queryParam.buyTime" placeholder="请选择购买日期" />
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :span="12">
  18 + <a-form-item label="到货日期">
  19 + <j-date v-model="queryParam.deliveryTime" placeholder="请选择到货日期" />
  20 + </a-form-item>
  21 + </a-col>
  22 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  24 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  25 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  26 + </span>
  27 + </a-col>
  28 + </a-row>
  29 + </a-form>
  30 + </div>
  31 + <!-- 查询区域-END -->
  32 +
  33 + <!-- 操作按钮区域 -->
  34 + <div class="table-operator">
  35 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  36 + <a-button type="primary" icon="download" @click="handleExportXls('tbl_bidding_shiji')">导出</a-button>
  37 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  38 + <a-button type="primary" icon="import">导入</a-button>
  39 + </a-upload>
  40 + <!-- 高级查询区域 -->
  41 + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  42 + <a-dropdown v-if="selectedRowKeys.length > 0">
  43 + <a-menu slot="overlay">
  44 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  45 + </a-menu>
  46 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  47 + </a-dropdown>
  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 + :scroll="{x:true}"
  61 + bordered
  62 + rowKey="id"
  63 + :columns="columns"
  64 + :dataSource="dataSource"
  65 + :pagination="ipagination"
  66 + :loading="loading"
  67 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  68 + class="j-table-force-nowrap"
  69 + @change="handleTableChange">
  70 +
  71 + <template slot="htmlSlot" slot-scope="text">
  72 + <div v-html="text"></div>
  73 + </template>
  74 + <template slot="imgSlot" slot-scope="text,record">
  75 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  76 + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  77 + </template>
  78 + <template slot="fileSlot" slot-scope="text">
  79 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  80 + <a-button
  81 + v-else
  82 + :ghost="true"
  83 + type="primary"
  84 + icon="download"
  85 + size="small"
  86 + @click="downloadFile(text)">
  87 + 下载
  88 + </a-button>
  89 + </template>
  90 +
  91 + <span slot="action" slot-scope="text, record">
  92 + <a @click="handleEdit(record)">编辑</a>
  93 +
  94 + <a-divider type="vertical" />
  95 + <a-dropdown>
  96 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97 + <a-menu slot="overlay">
  98 + <a-menu-item>
  99 + <a @click="handleDetail(record)">详情</a>
  100 + </a-menu-item>
  101 + <a-menu-item>
  102 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103 + <a>删除</a>
  104 + </a-popconfirm>
  105 + </a-menu-item>
  106 + </a-menu>
  107 + </a-dropdown>
  108 + </span>
  109 +
  110 + </a-table>
  111 + </div>
  112 +
  113 + <tbl-bidding-shiji-modal ref="modalForm" @ok="modalFormOk"></tbl-bidding-shiji-modal>
  114 + </a-card>
  115 +</template>
  116 +
  117 +<script>
  118 +
  119 + import '@/assets/less/TableExpand.less'
  120 + import { mixinDevice } from '@/utils/mixin'
  121 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  122 + import TblBiddingShijiModal from './modules/TblBiddingShijiModal'
  123 +
  124 + export default {
  125 + name: 'TblBiddingShijiList',
  126 + mixins:[JeecgListMixin, mixinDevice],
  127 + components: {
  128 + TblBiddingShijiModal
  129 + },
  130 + data () {
  131 + return {
  132 + description: 'tbl_bidding_shiji管理页面',
  133 + // 表头
  134 + columns: [
  135 + {
  136 + title: '序号',
  137 + dataIndex: '',
  138 + key:'rowIndex',
  139 + width:60,
  140 + align:"center",
  141 + customRender:function (t,r,index) {
  142 + return parseInt(index)+1;
  143 + }
  144 + },
  145 + {
  146 + title:'品名',
  147 + align:"center",
  148 + dataIndex: 'productName'
  149 + },
  150 + {
  151 + title:'规格',
  152 + align:"center",
  153 + dataIndex: 'specifications'
  154 + },
  155 + {
  156 + title:'数量',
  157 + align:"center",
  158 + dataIndex: 'num'
  159 + },
  160 + {
  161 + title:'单位',
  162 + align:"center",
  163 + dataIndex: 'danwei'
  164 + },
  165 + {
  166 + title:'物料类别',
  167 + align:"center",
  168 + dataIndex: 'wuType'
  169 + },
  170 + {
  171 + title:'单价',
  172 + align:"center",
  173 + dataIndex: 'danPrice'
  174 + },
  175 + {
  176 + title:'总价',
  177 + align:"center",
  178 + dataIndex: 'zongPrice'
  179 + },
  180 + {
  181 + title:'用途',
  182 + align:"center",
  183 + dataIndex: 'purpose'
  184 + },
  185 + {
  186 + title:'厂商',
  187 + align:"center",
  188 + dataIndex: 'chang'
  189 + },
  190 + {
  191 + title:'购买日期',
  192 + align:"center",
  193 + dataIndex: 'buyTime',
  194 + customRender:function (text) {
  195 + return !text?"":(text.length>10?text.substr(0,10):text)
  196 + }
  197 + },
  198 + {
  199 + title:'到货日期',
  200 + align:"center",
  201 + dataIndex: 'deliveryTime',
  202 + customRender:function (text) {
  203 + return !text?"":(text.length>10?text.substr(0,10):text)
  204 + }
  205 + },
  206 + {
  207 + title:'品牌',
  208 + align:"center",
  209 + dataIndex: 'brand'
  210 + },
  211 + {
  212 + title:'备注',
  213 + align:"center",
  214 + dataIndex: 'notes'
  215 + },
  216 + {
  217 + title:'发票类别',
  218 + align:"center",
  219 + dataIndex: 'fpType'
  220 + },
  221 + {
  222 + title:'发票到否',
  223 + align:"center",
  224 + dataIndex: 'fpIsyn'
  225 + },
  226 + {
  227 + title:'发票收到信息',
  228 + align:"center",
  229 + dataIndex: 'fpTime',
  230 + customRender:function (text) {
  231 + return !text?"":(text.length>10?text.substr(0,10):text)
  232 + }
  233 + },
  234 + {
  235 + title:'物品图片',
  236 + align:"center",
  237 + dataIndex: 'picture',
  238 + scopedSlots: {customRender: 'imgSlot'}
  239 + },
  240 + {
  241 + title: '操作',
  242 + dataIndex: 'action',
  243 + align:"center",
  244 + fixed:"right",
  245 + width:147,
  246 + scopedSlots: { customRender: 'action' }
  247 + }
  248 + ],
  249 + url: {
  250 + list: "/bidding_info/tblBiddingShiji/list",
  251 + delete: "/bidding_info/tblBiddingShiji/delete",
  252 + deleteBatch: "/bidding_info/tblBiddingShiji/deleteBatch",
  253 + exportXlsUrl: "/bidding_info/tblBiddingShiji/exportXls",
  254 + importExcelUrl: "bidding_info/tblBiddingShiji/importExcel",
  255 +
  256 + },
  257 + dictOptions:{},
  258 + superFieldList:[],
  259 + }
  260 + },
  261 + created() {
  262 + this.getSuperFieldList();
  263 + },
  264 + computed: {
  265 + importExcelUrl: function(){
  266 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  267 + },
  268 + },
  269 + methods: {
  270 + initDictConfig(){
  271 + },
  272 + getSuperFieldList(){
  273 + let fieldList=[];
  274 + fieldList.push({type:'string',value:'productName',text:'品名'})
  275 + fieldList.push({type:'string',value:'specifications',text:'规格'})
  276 + fieldList.push({type:'int',value:'num',text:'数量'})
  277 + fieldList.push({type:'string',value:'danwei',text:'单位'})
  278 + fieldList.push({type:'string',value:'wuType',text:'物料类别'})
  279 + fieldList.push({type:'number',value:'danPrice',text:'单价'})
  280 + fieldList.push({type:'number',value:'zongPrice',text:'总价'})
  281 + fieldList.push({type:'string',value:'purpose',text:'用途'})
  282 + fieldList.push({type:'string',value:'chang',text:'厂商'})
  283 + fieldList.push({type:'date',value:'buyTime',text:'购买日期'})
  284 + fieldList.push({type:'date',value:'deliveryTime',text:'到货日期'})
  285 + fieldList.push({type:'string',value:'brand',text:'品牌'})
  286 + fieldList.push({type:'string',value:'notes',text:'备注'})
  287 + fieldList.push({type:'string',value:'fpType',text:'发票类别'})
  288 + fieldList.push({type:'string',value:'fpIsyn',text:'发票到否'})
  289 + fieldList.push({type:'date',value:'fpTime',text:'发票收到信息'})
  290 + fieldList.push({type:'string',value:'picture',text:'物品图片'})
  291 + this.superFieldList = fieldList
  292 + }
  293 + }
  294 + }
  295 +</script>
  296 +<style scoped>
  297 + @import '~@assets/less/common.less';
  298 +</style>
@@ -24,8 +24,33 @@ @@ -24,8 +24,33 @@
24 </a-form-model-item> 24 </a-form-model-item>
25 </a-col> 25 </a-col>
26 <a-col :span="24"> 26 <a-col :span="24">
27 - <a-form-model-item label="到货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">  
28 - <j-date v-model="model.deliveryTime" placeholder="请输入到货日期" /> 27 + <a-form-model-item label="物料类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wuType">
  28 + <a-input v-model="model.wuType" placeholder="请输入物料类别"></a-input>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + <a-col :span="24">
  32 + <a-form-model-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrder">
  33 + <a-input v-model="model.workOrder" placeholder="请输入工作令"></a-input>
  34 + </a-form-model-item>
  35 + </a-col>
  36 + <a-col :span="24">
  37 + <a-form-model-item label="用途" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purpose">
  38 + <a-input v-model="model.purpose" placeholder="请输入用途"></a-input>
  39 + </a-form-model-item>
  40 + </a-col>
  41 + <a-col :span="24">
  42 + <a-form-model-item label="当前库存" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ku">
  43 + <a-input v-model="model.ku" placeholder="请输入当前库存"></a-input>
  44 + </a-form-model-item>
  45 + </a-col>
  46 + <a-col :span="24">
  47 + <a-form-model-item label="申请日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sqTime">
  48 + <j-date v-model="model.sqTime" placeholder="请输入申请日期" />
  49 + </a-form-model-item>
  50 + </a-col>
  51 + <a-col :span="24">
  52 + <a-form-model-item label="使用日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
  53 + <j-date v-model="model.deliveryTime" placeholder="请输入使用日期" />
29 </a-form-model-item> 54 </a-form-model-item>
30 </a-col> 55 </a-col>
31 <a-col :span="24"> 56 <a-col :span="24">
@@ -106,7 +131,21 @@ export default { @@ -106,7 +131,21 @@ export default {
106 sm: { span: 16 }, 131 sm: { span: 16 },
107 }, 132 },
108 confirmLoading: false, 133 confirmLoading: false,
109 - validatorRules: {}, 134 + validatorRules: {
  135 + productName: [{ required: true, message: '请输入品名!' }],
  136 + specifications: [{ required: true, message: '请输入规格!' }],
  137 + num: [{ required: true, message: '请输入数量!' }],
  138 + danwei: [{ required: true, message: '请输入单位!' }],
  139 + wuType: [{ required: true, message: '请输入物料类别!' }],
  140 + workOrder: [{ required: true, message: '请输入工作令!' }],
  141 + purpose: [{ required: true, message: '请输入用途!' }],
  142 + ku: [{ required: true, message: '请输入当前库存!' }],
  143 + sqTime: [{ required: true, message: '请输入申请日期!' }],
  144 + deliveryTime: [{ required: true, message: '请输入使用日期!' }],
  145 + brand: [{ required: true, message: '请输入品牌!' }],
  146 + notes: [{ required: true, message: '请输入备注!' }],
  147 + applicant: [{ required: true, message: '请输入申请人!' }],
  148 + },
110 url: { 149 url: {
111 add: '/trad/tblBiddingShenq/add', 150 add: '/trad/tblBiddingShenq/add',
112 edit: '/trad/tblBiddingShenq/edit', 151 edit: '/trad/tblBiddingShenq/edit',
  1 +<template>
  2 + <a-spin :spinning="confirmLoading">
  3 + <j-form-container :disabled="formDisabled">
  4 + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5 + <a-row>
  6 + <a-col :span="24">
  7 + <a-form-model-item label="品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  8 + <a-input v-model="model.productName" placeholder="请输入品名"></a-input>
  9 + </a-form-model-item>
  10 + </a-col>
  11 + <a-col :span="24">
  12 + <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">
  13 + <a-input v-model="model.specifications" placeholder="请输入规格"></a-input>
  14 + </a-form-model-item>
  15 + </a-col>
  16 + <a-col :span="24">
  17 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
  18 + <a-input-number v-model="model.num" placeholder="请输入数量" style="width: 100%" />
  19 + </a-form-model-item>
  20 + </a-col>
  21 + <a-col :span="24">
  22 + <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
  23 + <a-input v-model="model.danwei" placeholder="请输入单位"></a-input>
  24 + </a-form-model-item>
  25 + </a-col>
  26 + <a-col :span="24">
  27 + <a-form-model-item label="物料类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wuType">
  28 + <a-input v-model="model.wuType" placeholder="请输入物料类别"></a-input>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + <a-col :span="24">
  32 + <a-form-model-item label="单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danPrice">
  33 + <a-input-number v-model="model.danPrice" placeholder="请输入单价" style="width: 100%" />
  34 + </a-form-model-item>
  35 + </a-col>
  36 + <a-col :span="24">
  37 + <a-form-model-item label="总价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zongPrice">
  38 + <a-input-number v-model="model.zongPrice" placeholder="请输入总价" style="width: 100%" />
  39 + </a-form-model-item>
  40 + </a-col>
  41 + <a-col :span="24">
  42 + <a-form-model-item label="用途" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purpose">
  43 + <a-input v-model="model.purpose" placeholder="请输入用途"></a-input>
  44 + </a-form-model-item>
  45 + </a-col>
  46 + <a-col :span="24">
  47 + <a-form-model-item label="厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chang">
  48 + <a-input v-model="model.chang" placeholder="请输入厂商"></a-input>
  49 + </a-form-model-item>
  50 + </a-col>
  51 + <a-col :span="24">
  52 + <a-form-model-item label="购买日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buyTime">
  53 + <j-date placeholder="请选择购买日期" v-model="model.buyTime" style="width: 100%" />
  54 + </a-form-model-item>
  55 + </a-col>
  56 + <a-col :span="24">
  57 + <a-form-model-item label="到货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
  58 + <j-date placeholder="请选择到货日期" v-model="model.deliveryTime" style="width: 100%" />
  59 + </a-form-model-item>
  60 + </a-col>
  61 + <a-col :span="24">
  62 + <a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
  63 + <a-input v-model="model.brand" placeholder="请输入品牌"></a-input>
  64 + </a-form-model-item>
  65 + </a-col>
  66 + <a-col :span="24">
  67 + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
  68 + <a-input v-model="model.notes" placeholder="请输入备注"></a-input>
  69 + </a-form-model-item>
  70 + </a-col>
  71 + <a-col :span="24">
  72 + <a-form-model-item label="发票类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fpType">
  73 + <a-input v-model="model.fpType" placeholder="请输入发票类别"></a-input>
  74 + </a-form-model-item>
  75 + </a-col>
  76 + <a-col :span="24">
  77 + <a-form-model-item label="发票到否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fpIsyn">
  78 + <a-input v-model="model.fpIsyn" placeholder="请输入发票到否"></a-input>
  79 + </a-form-model-item>
  80 + </a-col>
  81 + <a-col :span="24">
  82 + <a-form-model-item label="发票收到日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fpTime">
  83 + <j-date placeholder="请选择发票收到日期" v-model="model.fpTime" style="width: 100%" />
  84 + </a-form-model-item>
  85 + </a-col>
  86 + <a-col :span="24">
  87 + <a-col :span="24">
  88 + <a-form-model-item label="物料图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="picture">
  89 + <j-image-upload isMultiple v-model="model.picture"></j-image-upload>
  90 + </a-form-model-item>
  91 + </a-col>
  92 + </a-col>
  93 + </a-row>
  94 + </a-form-model>
  95 + </j-form-container>
  96 + </a-spin>
  97 +</template>
  98 +
  99 +<script>
  100 +import { httpAction, getAction } from '@/api/manage'
  101 +import { validateDuplicateValue } from '@/utils/util'
  102 +
  103 +export default {
  104 + name: 'TblBiddingShijiForm',
  105 + components: {},
  106 + props: {
  107 + //表单禁用
  108 + disabled: {
  109 + type: Boolean,
  110 + default: false,
  111 + required: false,
  112 + },
  113 + },
  114 + data() {
  115 + return {
  116 + model: {},
  117 + labelCol: {
  118 + xs: { span: 24 },
  119 + sm: { span: 5 },
  120 + },
  121 + wrapperCol: {
  122 + xs: { span: 24 },
  123 + sm: { span: 16 },
  124 + },
  125 + confirmLoading: false,
  126 + validatorRules: {
  127 + productName: [{ required: true, message: '请输入品名!' }],
  128 + specifications: [{ required: true, message: '请输入规格!' }],
  129 + num: [{ required: true, message: '请输入数量!' }],
  130 + danwei: [{ required: true, message: '请输入单位!' }],
  131 + danPrice: [{ required: true, message: '请输入单价!' }],
  132 + zongPrice: [{ required: true, message: '请输入总价!' }],
  133 + purpose: [{ required: true, message: '请输入用途!' }],
  134 + chang: [{ required: true, message: '请输入厂商!' }],
  135 + buyTime: [{ required: true, message: '请输入购买日期!' }],
  136 + deliveryTime: [{ required: true, message: '请输入到货日期!' }],
  137 + fpTime: [{ required: true, message: '请输入发票收到日期!' }],
  138 + brand: [{ required: true, message: '请输入品牌!' }],
  139 + fpIsyn: [{ required: true, message: '请输入到否!' }],
  140 + fpType: [{ required: true, message: '请输入类别!' }],
  141 + notes: [{ required: true, message: '请输入备注!' }],
  142 +
  143 + },
  144 + url: {
  145 + add: '/bidding_info/tblBiddingShiji/add',
  146 + edit: '/bidding_info/tblBiddingShiji/edit',
  147 + queryById: '/bidding_info/tblBiddingShiji/queryById',
  148 + },
  149 + }
  150 + },
  151 + computed: {
  152 + formDisabled() {
  153 + return this.disabled
  154 + },
  155 + },
  156 + created() {
  157 + //备份model原始值
  158 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
  159 + },
  160 + methods: {
  161 + add() {
  162 + this.edit(this.modelDefault)
  163 + },
  164 + edit(record) {
  165 + this.model = Object.assign({}, record)
  166 + this.visible = true
  167 + },
  168 + submitForm() {
  169 + const that = this
  170 + // 触发表单验证
  171 + this.$refs.form.validate((valid) => {
  172 + if (valid) {
  173 + that.confirmLoading = true
  174 + let httpurl = ''
  175 + let method = ''
  176 + if (!this.model.id) {
  177 + httpurl += this.url.add
  178 + method = 'post'
  179 + } else {
  180 + httpurl += this.url.edit
  181 + method = 'put'
  182 + }
  183 + httpAction(httpurl, this.model, method)
  184 + .then((res) => {
  185 + if (res.success) {
  186 + that.$message.success(res.message)
  187 + that.$emit('ok')
  188 + } else {
  189 + that.$message.warning(res.message)
  190 + }
  191 + })
  192 + .finally(() => {
  193 + that.confirmLoading = false
  194 + })
  195 + }
  196 + })
  197 + },
  198 + },
  199 +}
  200 +</script>
  1 +<template>
  2 + <a-drawer
  3 + :title="title"
  4 + :width="width"
  5 + placement="right"
  6 + :closable="false"
  7 + @close="close"
  8 + destroyOnClose
  9 + :visible="visible">
  10 + <tbl-bidding-shiji-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tbl-bidding-shiji-form>
  11 + <div class="drawer-footer">
  12 + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  13 + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  14 + </div>
  15 + </a-drawer>
  16 +</template>
  17 +
  18 +<script>
  19 +
  20 + import TblBiddingShijiForm from './TblBiddingShijiForm'
  21 +
  22 + export default {
  23 + name: 'TblBiddingShijiModal',
  24 + components: {
  25 + TblBiddingShijiForm
  26 + },
  27 + data () {
  28 + return {
  29 + title:"操作",
  30 + width:800,
  31 + visible: false,
  32 + disableSubmit: false
  33 + }
  34 + },
  35 + methods: {
  36 + add () {
  37 + this.visible=true
  38 + this.$nextTick(()=>{
  39 + this.$refs.realForm.add();
  40 + })
  41 + },
  42 + edit (record) {
  43 + this.visible=true
  44 + this.$nextTick(()=>{
  45 + this.$refs.realForm.edit(record);
  46 + });
  47 + },
  48 + close () {
  49 + this.$emit('close');
  50 + this.visible = false;
  51 + },
  52 + submitCallback(){
  53 + this.$emit('ok');
  54 + this.visible = false;
  55 + },
  56 + handleOk () {
  57 + this.$refs.realForm.submitForm();
  58 + },
  59 + handleCancel () {
  60 + this.close()
  61 + }
  62 + }
  63 + }
  64 +</script>
  65 +
  66 +<style lang="less" scoped>
  67 +/** Button按钮间距 */
  68 + .ant-btn {
  69 + margin-left: 30px;
  70 + margin-bottom: 30px;
  71 + float: right;
  72 + }
  73 + .drawer-footer{
  74 + position: absolute;
  75 + bottom: -8px;
  76 + width: 100%;
  77 + border-top: 1px solid #e8e8e8;
  78 + padding: 10px 16px;
  79 + text-align: right;
  80 + left: 0;
  81 + background: #fff;
  82 + border-radius: 0 0 2px 2px;
  83 + }
  84 +</style>
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + switchFullscreen
  7 + @ok="handleOk"
  8 + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <tbl-bidding-shiji-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tbl-bidding-shiji-form>
  12 + </j-modal>
  13 +</template>
  14 +
  15 +<script>
  16 +
  17 + import TblBiddingShijiForm from './TblBiddingShijiForm'
  18 + export default {
  19 + name: 'TblBiddingShijiModal',
  20 + components: {
  21 + TblBiddingShijiForm
  22 + },
  23 + data () {
  24 + return {
  25 + title:'',
  26 + width:800,
  27 + visible: false,
  28 + disableSubmit: false
  29 + }
  30 + },
  31 + methods: {
  32 + add () {
  33 + this.visible=true
  34 + this.$nextTick(()=>{
  35 + this.$refs.realForm.add();
  36 + })
  37 + },
  38 + edit (record) {
  39 + this.visible=true
  40 + this.$nextTick(()=>{
  41 + this.$refs.realForm.edit(record);
  42 + })
  43 + },
  44 + close () {
  45 + this.$emit('close');
  46 + this.visible = false;
  47 + },
  48 + handleOk () {
  49 + this.$refs.realForm.submitForm();
  50 + },
  51 + submitCallback(){
  52 + this.$emit('ok');
  53 + this.visible = false;
  54 + },
  55 + handleCancel () {
  56 + this.close()
  57 + }
  58 + }
  59 + }
  60 +</script>
@@ -181,6 +181,16 @@ @@ -181,6 +181,16 @@
181 dataIndex: 'num' 181 dataIndex: 'num'
182 }, 182 },
183 { 183 {
  184 + title:'含税运单价',
  185 + align:"center",
  186 + dataIndex: 'baseShuiprice'
  187 + },
  188 + {
  189 + title:'中标单价',
  190 + align:"center",
  191 + dataIndex: 'baseZhong'
  192 + },
  193 + {
184 title:'计量单位', 194 title:'计量单位',
185 align:"center", 195 align:"center",
186 dataIndex: 'danwei' 196 dataIndex: 'danwei'
@@ -4,6 +4,16 @@ @@ -4,6 +4,16 @@
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
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">
  8 + <a-form-item label="招标号">
  9 + <j-input placeholder="请输入招标号" v-model="queryParam.tenderNumber"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="客户料号">
  14 + <j-input placeholder="请输入客户料号" v-model="queryParam.partNumber"></j-input>
  15 + </a-form-item>
  16 + </a-col>
7 <a-col :span="12"> 17 <a-col :span="12">
8 <a-form-item label="交货日期"> 18 <a-form-item label="交货日期">
9 <j-date v-model="queryParam.deliveryTime" placeholder="请选择交货日期" /> 19 <j-date v-model="queryParam.deliveryTime" placeholder="请选择交货日期" />
@@ -4,6 +4,22 @@ @@ -4,6 +4,22 @@
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
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">
  8 + <a-form-item label="招标号">
  9 + <j-input placeholder="请输入招标号" v-model="queryParam.tenderNumber"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="客户料号">
  14 + <j-input placeholder="请输入客户料号" v-model="queryParam.partNumber"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  19 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21 + </span>
  22 + </a-col>
7 </a-row> 23 </a-row>
8 </a-form> 24 </a-form>
9 </div> 25 </div>
@@ -4,6 +4,22 @@ @@ -4,6 +4,22 @@
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
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">
  8 + <a-form-item label="招标号">
  9 + <j-input placeholder="请输入招标号" v-model="queryParam.tenderNumber"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="客户料号">
  14 + <j-input placeholder="请输入客户料号" v-model="queryParam.partNumber"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  19 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21 + </span>
  22 + </a-col>
7 </a-row> 23 </a-row>
8 </a-form> 24 </a-form>
9 </div> 25 </div>
@@ -127,36 +143,13 @@ @@ -127,36 +143,13 @@
127 dataIndex: 'tenderNumber', 143 dataIndex: 'tenderNumber',
128 144
129 }, 145 },
130 - {  
131 - title:'客户',  
132 - align:"center",  
133 - dataIndex: 'customer'  
134 - },  
135 - {  
136 - title:'客户采购',  
137 - align:"center",  
138 - dataIndex: 'procurement'  
139 - }, 146 +
140 { 147 {
141 title:'客户料号', 148 title:'客户料号',
142 align:"center", 149 align:"center",
143 dataIndex: 'partNumber' 150 dataIndex: 'partNumber'
144 }, 151 },
145 - {  
146 - title:'物料描述',  
147 - align:"center",  
148 - dataIndex: 'description'  
149 - },  
150 - {  
151 - title:'品名',  
152 - align:"center",  
153 - dataIndex: 'productname'  
154 - },  
155 - {  
156 - title:'规格',  
157 - align:"center",  
158 - dataIndex: 'specifications'  
159 - }, 152 +
160 { 153 {
161 title:'厂商', 154 title:'厂商',
162 align:"center", 155 align:"center",
@@ -4,6 +4,22 @@ @@ -4,6 +4,22 @@
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
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">
  8 + <a-form-item label="招标号">
  9 + <j-input placeholder="请输入招标号" v-model="queryParam.tenderNumber"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="客户料号">
  14 + <j-input placeholder="请输入客户料号" v-model="queryParam.partNumber"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  19 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21 + </span>
  22 + </a-col>
7 </a-row> 23 </a-row>
8 </a-form> 24 </a-form>
9 </div> 25 </div>
@@ -4,6 +4,22 @@ @@ -4,6 +4,22 @@
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
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">
  8 + <a-form-item label="招标号">
  9 + <j-input placeholder="请输入招标号" v-model="queryParam.tenderNumber"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="客户料号">
  14 + <j-input placeholder="请输入客户料号" v-model="queryParam.partNumber"></j-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  19 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21 + </span>
  22 + </a-col>
7 </a-row> 23 </a-row>
8 </a-form> 24 </a-form>
9 </div> 25 </div>
@@ -181,6 +181,16 @@ @@ -181,6 +181,16 @@
181 dataIndex: 'num' 181 dataIndex: 'num'
182 }, 182 },
183 { 183 {
  184 + title:'含税运单价',
  185 + align:"center",
  186 + dataIndex: 'baseShuiprice'
  187 + },
  188 + {
  189 + title:'中标单价',
  190 + align:"center",
  191 + dataIndex: 'baseZhong'
  192 + },
  193 + {
184 title:'计量单位', 194 title:'计量单位',
185 align:"center", 195 align:"center",
186 dataIndex: 'danwei' 196 dataIndex: 'danwei'
@@ -44,6 +44,16 @@ @@ -44,6 +44,16 @@
44 </a-form-model-item> 44 </a-form-model-item>
45 </a-col> 45 </a-col>
46 <a-col :span="24"> 46 <a-col :span="24">
  47 + <a-form-model-item label="含税运单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="baseShuiprice">
  48 + <a-input-number v-model="model.baseShuiprice" placeholder="请输入含税运单价" style="width: 100%" />
  49 + </a-form-model-item>
  50 + </a-col>
  51 + <a-col :span="24">
  52 + <a-form-model-item label="中标单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="baseZhong">
  53 + <a-input-number v-model="model.baseZhong" placeholder="请输入中标单价" style="width: 100%" />
  54 + </a-form-model-item>
  55 + </a-col>
  56 + <a-col :span="24">
47 <a-form-model-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei"> 57 <a-form-model-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
48 <a-input v-model="model.danwei" placeholder="请输入计量单位"></a-input> 58 <a-input v-model="model.danwei" placeholder="请输入计量单位"></a-input>
49 </a-form-model-item> 59 </a-form-model-item>
@@ -137,16 +147,17 @@ export default { @@ -137,16 +147,17 @@ export default {
137 }, 147 },
138 confirmLoading: false, 148 confirmLoading: false,
139 validatorRules: { 149 validatorRules: {
140 - // tenderNumber: [{ required: true, message: '请输入姓名!' }],  
141 - // customer: [{ required: true, message: '请输入身份证号!' }],  
142 - // procurement: [{ required: true, message: '请输入银行卡号!' }],  
143 - // partNumber: [{ required: true, message: '请输入基本工资!' }],  
144 - // description: [{ required: true, message: '请输入工作职位!' }],  
145 - // productname: [{ required: true, message: '请输入餐费单价!' }],  
146 - // specifications: [{ required: true, message: '请输入社保公司!' }],  
147 - // num: [{ required: true, message: '请输入社保个人!' }],  
148 - // danwei: [{ required: true, message: '请输入工时单价!' }],  
149 - // company: [{ required: true, message: '请输入比例!' }], 150 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  151 + customer: [{ required: true, message: '请输入客户!' }],
  152 + procurement: [{ required: true, message: '请输入客户采购!' }],
  153 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  154 + description: [{ required: true, message: '请输入物料描述!' }],
  155 + productname: [{ required: true, message: '请输入品名!' }],
  156 + specifications: [{ required: true, message: '请输入规格!' }],
  157 + num: [{ required: true, message: '请输入申请数量!' }],
  158 + danwei: [{ required: true, message: '请输入计量单位!' }],
  159 + company: [{ required: true, message: '请输入客户需求单位!' }],
  160 + baseZhong: [{ required: true, message: '请输入中标单价!' }],
150 161
151 }, 162 },
152 url: { 163 url: {
@@ -5,17 +5,29 @@ @@ -5,17 +5,29 @@
5 <a-row> 5 <a-row>
6 <a-col :span="24"> 6 <a-col :span="24">
7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber"> 7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
8 - <a-input v-model="model.tenderNumber" placeholder="请输入招标号"></a-input> 8 + <a-input
  9 + v-model="model.tenderNumber"
  10 + placeholder="请输入招标号"
  11 + @blur="autoInput"
  12 + @keyup.enter.native="autoInput"
  13 + :disabled="isBianhaoDisabled2"
  14 + ></a-input>
9 </a-form-model-item> 15 </a-form-model-item>
10 </a-col> 16 </a-col>
11 <a-col :span="24"> 17 <a-col :span="24">
12 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber"> 18 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
13 - <a-input v-model="model.partNumber" placeholder="请输入客户料号"></a-input> 19 + <a-input
  20 + v-model="model.partNumber"
  21 + placeholder="请输入客户料号"
  22 + @blur="autoInput"
  23 + @keyup.enter.native="autoInput"
  24 + :disabled="isBianhaoDisabled2"
  25 + ></a-input>
14 </a-form-model-item> 26 </a-form-model-item>
15 </a-col> 27 </a-col>
16 <a-col :span="24"> 28 <a-col :span="24">
17 <a-form-model-item label="合同编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianhao"> 29 <a-form-model-item label="合同编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianhao">
18 - <a-input v-model="model.bianhao" placeholder="请输入合同编号" ></a-input> 30 + <a-input v-model="model.bianhao" placeholder="请输入合同编号" :disabled="isBianhaoDisabled"></a-input>
19 </a-form-model-item> 31 </a-form-model-item>
20 </a-col> 32 </a-col>
21 <a-col :span="24"> 33 <a-col :span="24">
@@ -30,26 +42,26 @@ @@ -30,26 +42,26 @@
30 </template> 42 </template>
31 43
32 <script> 44 <script>
  45 +import { httpAction, getAction } from '@/api/manage'
  46 +import { validateDuplicateValue } from '@/utils/util'
33 47
34 - import { httpAction, getAction } from '@/api/manage'  
35 - import { validateDuplicateValue } from '@/utils/util'  
36 -  
37 - export default { 48 +export default {
38 name: 'TblTradContractForm', 49 name: 'TblTradContractForm',
39 - components: {  
40 - }, 50 + components: {},
41 props: { 51 props: {
42 //表单禁用 52 //表单禁用
43 disabled: { 53 disabled: {
44 type: Boolean, 54 type: Boolean,
45 default: false, 55 default: false,
46 - required: false  
47 - } 56 + required: false,
48 }, 57 },
49 - data () {  
50 - return {  
51 - model:{  
52 }, 58 },
  59 + data() {
  60 + return {
  61 + isBianhaoDisabled: true, // 添加一个额外的变量来控制合同编号输入框的禁用状态
  62 + isBianhaoDisabled2: false,
  63 + readOnly: true,
  64 + model: {},
53 labelCol: { 65 labelCol: {
54 xs: { span: 24 }, 66 xs: { span: 24 },
55 sm: { span: 5 }, 67 sm: { span: 5 },
@@ -60,60 +72,105 @@ @@ -60,60 +72,105 @@
60 }, 72 },
61 confirmLoading: false, 73 confirmLoading: false,
62 validatorRules: { 74 validatorRules: {
  75 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  76 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  77 + bianhao: [{ required: true, message: '请输入合同编号!' }],
63 }, 78 },
64 url: { 79 url: {
65 - add: "/trad/tblTradContract/add",  
66 - edit: "/trad/tblTradContract/edit",  
67 - queryById: "/trad/tblTradContract/queryById"  
68 - } 80 + add: '/trad/tblTradContract/add',
  81 + edit: '/trad/tblTradContract/edit',
  82 + queryById: '/trad/tblTradContract/queryById',
  83 + queryBy: 'trad/tblTradContract/queryBy',
  84 + queryhetongBy: 'trad/tblTradContract/queryhetongBy',
  85 + },
69 } 86 }
70 }, 87 },
71 computed: { 88 computed: {
72 - formDisabled(){ 89 + formDisabled() {
73 return this.disabled 90 return this.disabled
74 }, 91 },
75 }, 92 },
76 - created () { 93 + created() {
77 //备份model原始值 94 //备份model原始值
78 - this.modelDefault = JSON.parse(JSON.stringify(this.model)); 95 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
79 }, 96 },
80 methods: { 97 methods: {
81 - add () {  
82 - this.edit(this.modelDefault); 98 + async autoInput() {
  99 + this.confirmLoading = true
  100 + const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  101 + const param2 = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  102 + let res2 = await getAction(this.url.queryhetongBy, param2)
  103 + let res = await getAction(this.url.queryBy, param)
  104 +
  105 + console.log(res)
  106 + console.log(res2)
  107 + if (res2.result) {
  108 + this.$message.error('这个招标已存在合同信息')
  109 + this.confirmLoading = false
  110 + // this.readOnly = true
  111 + // 设置组件为禁用状态
  112 + this.isBianhaoDisabled=true
  113 + return
  114 + }
  115 + if (!res.result) {
  116 + this.$message.error('没有这个招标信息,请重新输入')
  117 + this.confirmLoading = false
  118 + // this.readOnly = true
  119 + this.isBianhaoDisabled=true
  120 + console.log('禁否:', this.isBianhaoDisabled)
  121 + return
  122 + }
  123 + // this.readOnly = false
  124 + this.isBianhaoDisabled=false
  125 + console.log('禁否:', this.isBianhaoDisabled)
  126 + this.confirmLoading = false
  127 + return
83 }, 128 },
84 - edit (record) {  
85 - this.model = Object.assign({}, record);  
86 - this.visible = true; 129 +
  130 + add() {
  131 + this.edit(this.modelDefault)
  132 + this.isBianhaoDisabled=true
  133 + this.isBianhaoDisabled2=false
87 }, 134 },
88 - submitForm () {  
89 - const that = this; 135 + edit(record) {
  136 + this.model = Object.assign({}, record)
  137 + this.visible = true
  138 + this.isBianhaoDisabled=false
  139 + this.isBianhaoDisabled2=true
  140 + },
  141 + submitForm() {
  142 + const that = this
90 // 触发表单验证 143 // 触发表单验证
91 - this.$refs.form.validate(valid => {  
92 - if (valid) {  
93 - that.confirmLoading = true;  
94 - let httpurl = '';  
95 - let method = '';  
96 - if(!this.model.id){  
97 - httpurl+=this.url.add;  
98 - method = 'post';  
99 - }else{  
100 - httpurl+=this.url.edit;  
101 - method = 'put'; 144 + this.$refs.form.validate((valid) => {
  145 + if (valid && !this.isBianhaoDisabled) {
  146 + that.confirmLoading = true
  147 + let httpurl = ''
  148 + let method = ''
  149 + if (!this.model.id) {
  150 + httpurl += this.url.add
  151 + method = 'post'
  152 + } else {
  153 + httpurl += this.url.edit
  154 + method = 'put'
102 } 155 }
103 - httpAction(httpurl,this.model,method).then((res)=>{  
104 - if(res.success){  
105 - that.$message.success(res.message);  
106 - that.$emit('ok');  
107 - }else{  
108 - that.$message.warning(res.message); 156 +
  157 + httpAction(httpurl, this.model, method)
  158 + .then((res) => {
  159 + if (res.success) {
  160 + that.$message.success(res.message)
  161 + that.$emit('ok')
  162 + } else {
  163 + that.$message.warning(res.message)
109 } 164 }
110 - }).finally(() => {  
111 - that.confirmLoading = false;  
112 }) 165 })
  166 + .finally(() => {
  167 + that.confirmLoading = false
  168 + })
  169 + }else{
  170 + that.$message.error("招标信息错误")
113 } 171 }
114 -  
115 }) 172 })
116 }, 173 },
117 - }  
118 - } 174 + },
  175 +}
119 </script> 176 </script>
@@ -5,12 +5,24 @@ @@ -5,12 +5,24 @@
5 <a-row> 5 <a-row>
6 <a-col :span="24"> 6 <a-col :span="24">
7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber"> 7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
8 - <a-input v-model="model.tenderNumber" placeholder="请输入招标号"></a-input> 8 + <a-input
  9 + v-model="model.tenderNumber"
  10 + placeholder="请输入招标号"
  11 + @blur="autoInput"
  12 + @keyup.enter.native="autoInput"
  13 + :disabled="isBianhaoDisabled2"
  14 + ></a-input>
9 </a-form-model-item> 15 </a-form-model-item>
10 </a-col> 16 </a-col>
11 <a-col :span="24"> 17 <a-col :span="24">
12 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber"> 18 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
13 - <a-input v-model="model.partNumber" placeholder="请输入客户料号"></a-input> 19 + <a-input
  20 + v-model="model.partNumber"
  21 + placeholder="请输入客户料号"
  22 + @blur="autoInput"
  23 + @keyup.enter.native="autoInput"
  24 + :disabled="isBianhaoDisabled2"
  25 + ></a-input>
14 </a-form-model-item> 26 </a-form-model-item>
15 </a-col> 27 </a-col>
16 <a-col :span="24"> 28 <a-col :span="24">
@@ -20,7 +32,7 @@ @@ -20,7 +32,7 @@
20 </a-col> 32 </a-col>
21 <a-col :span="24"> 33 <a-col :span="24">
22 <a-form-model-item label="发票号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceNum"> 34 <a-form-model-item label="发票号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceNum">
23 - <a-input v-model="model.invoiceNum" placeholder="请输入发票号" ></a-input> 35 + <a-input v-model="model.invoiceNum" placeholder="请输入发票号" :disabled="isBianhaoDisabled"></a-input>
24 </a-form-model-item> 36 </a-form-model-item>
25 </a-col> 37 </a-col>
26 <a-col :span="24"> 38 <a-col :span="24">
@@ -55,26 +67,25 @@ @@ -55,26 +67,25 @@
55 </template> 67 </template>
56 68
57 <script> 69 <script>
  70 +import { httpAction, getAction } from '@/api/manage'
  71 +import { validateDuplicateValue } from '@/utils/util'
58 72
59 - import { httpAction, getAction } from '@/api/manage'  
60 - import { validateDuplicateValue } from '@/utils/util'  
61 -  
62 - export default { 73 +export default {
63 name: 'TblTradFphkForm', 74 name: 'TblTradFphkForm',
64 - components: {  
65 - }, 75 + components: {},
66 props: { 76 props: {
67 //表单禁用 77 //表单禁用
68 disabled: { 78 disabled: {
69 type: Boolean, 79 type: Boolean,
70 default: false, 80 default: false,
71 - required: false  
72 - } 81 + required: false,
73 }, 82 },
74 - data () {  
75 - return {  
76 - model:{  
77 }, 83 },
  84 + data() {
  85 + return {
  86 + isBianhaoDisabled: true,
  87 + isBianhaoDisabled2: false,
  88 + model: {},
78 labelCol: { 89 labelCol: {
79 xs: { span: 24 }, 90 xs: { span: 24 },
80 sm: { span: 5 }, 91 sm: { span: 5 },
@@ -85,60 +96,100 @@ @@ -85,60 +96,100 @@
85 }, 96 },
86 confirmLoading: false, 97 confirmLoading: false,
87 validatorRules: { 98 validatorRules: {
  99 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  100 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  101 + invoicingTime: [{ required: true, message: '请输入开票时间!' }],
  102 + invoiceNum: [{ required: true, message: '请输入发票号!' }],
  103 + hkPrice: [{ required: true, message: '请输入回款金额!' }],
  104 + zbhkPrice: [{ required: true, message: '请输入质保金回款金额!' }],
88 }, 105 },
89 url: { 106 url: {
90 - add: "/trad/tblTradFphk/add",  
91 - edit: "/trad/tblTradFphk/edit",  
92 - queryById: "/trad/tblTradFphk/queryById"  
93 - } 107 + add: '/trad/tblTradFphk/add',
  108 + edit: '/trad/tblTradFphk/edit',
  109 + queryById: '/trad/tblTradFphk/queryById',
  110 + queryBy: '/trad/tblTradFphk/queryBy',
  111 + queryfphkBy: '/trad/tblTradFphk/queryfphkBy',
  112 + },
94 } 113 }
95 }, 114 },
96 computed: { 115 computed: {
97 - formDisabled(){ 116 + formDisabled() {
98 return this.disabled 117 return this.disabled
99 }, 118 },
100 }, 119 },
101 - created () { 120 + created() {
102 //备份model原始值 121 //备份model原始值
103 - this.modelDefault = JSON.parse(JSON.stringify(this.model)); 122 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
104 }, 123 },
105 methods: { 124 methods: {
106 - add () {  
107 - this.edit(this.modelDefault); 125 + async autoInput() {
  126 + this.confirmLoading = true
  127 + const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  128 + const param2 = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  129 + let res2 = await getAction(this.url.queryfphkBy, param2)
  130 + let res = await getAction(this.url.queryBy, param)
  131 +
  132 + console.log(res)
  133 + console.log(res2)
  134 + if (res2.result) {
  135 + this.$message.error('这个招标已存在合同信息')
  136 +
  137 + this.confirmLoading = false
  138 + this.isBianhaoDisabled = true
  139 + return
  140 + }
  141 + if (!res.result) {
  142 + this.$message.error('没有这个招标信息,请重新输入')
  143 + this.confirmLoading = false
  144 + this.isBianhaoDisabled = true
  145 + return
  146 + }
  147 + this.isBianhaoDisabled = false
  148 + this.confirmLoading = false
  149 + },
  150 + add() {
  151 + this.edit(this.modelDefault)
  152 + this.isBianhaoDisabled=true
  153 + this.isBianhaoDisabled2=false
108 }, 154 },
109 - edit (record) {  
110 - this.model = Object.assign({}, record);  
111 - this.visible = true; 155 + edit(record) {
  156 + this.model = Object.assign({}, record)
  157 + this.visible = true
  158 + this.isBianhaoDisabled2=true
  159 + this.isBianhaoDisabled=false
112 }, 160 },
113 - submitForm () {  
114 - const that = this; 161 + submitForm() {
  162 + const that = this
115 // 触发表单验证 163 // 触发表单验证
116 - this.$refs.form.validate(valid => {  
117 - if (valid) {  
118 - that.confirmLoading = true;  
119 - let httpurl = '';  
120 - let method = '';  
121 - if(!this.model.id){  
122 - httpurl+=this.url.add;  
123 - method = 'post';  
124 - }else{  
125 - httpurl+=this.url.edit;  
126 - method = 'put'; 164 + this.$refs.form.validate((valid) => {
  165 + if (valid && !this.isBianhaoDisabled) {
  166 + that.confirmLoading = true
  167 + let httpurl = ''
  168 + let method = ''
  169 + if (!this.model.id) {
  170 + httpurl += this.url.add
  171 + method = 'post'
  172 + } else {
  173 + httpurl += this.url.edit
  174 + method = 'put'
127 } 175 }
128 - httpAction(httpurl,this.model,method).then((res)=>{  
129 - if(res.success){  
130 - that.$message.success(res.message);  
131 - that.$emit('ok');  
132 - }else{  
133 - that.$message.warning(res.message); 176 + httpAction(httpurl, this.model, method)
  177 + .then((res) => {
  178 + if (res.success) {
  179 + that.$message.success(res.message)
  180 + that.$emit('ok')
  181 + } else {
  182 + that.$message.warning(res.message)
134 } 183 }
135 - }).finally(() => {  
136 - that.confirmLoading = false;  
137 }) 184 })
  185 + .finally(() => {
  186 + that.confirmLoading = false
  187 + })
  188 + }else{
  189 + that.$message.error("招标信息错误")
138 } 190 }
139 -  
140 }) 191 })
141 }, 192 },
142 - }  
143 - } 193 + },
  194 +}
144 </script> 195 </script>
@@ -5,42 +5,30 @@ @@ -5,42 +5,30 @@
5 <a-row> 5 <a-row>
6 <a-col :span="24"> 6 <a-col :span="24">
7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber"> 7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
8 - <a-input v-model="model.tenderNumber" placeholder="请输入招标号" ></a-input>  
9 - </a-form-model-item>  
10 - </a-col>  
11 - <a-col :span="24">  
12 - <a-form-model-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="customer">  
13 - <a-input v-model="model.customer" placeholder="请输入客户" ></a-input>  
14 - </a-form-model-item>  
15 - </a-col>  
16 - <a-col :span="24">  
17 - <a-form-model-item label="客户采购" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="procurement">  
18 - <a-input v-model="model.procurement" placeholder="请输入客户采购" ></a-input> 8 + <a-input
  9 + v-model="model.tenderNumber"
  10 + placeholder="请输入招标号"
  11 + @blur="autoInput"
  12 + @keyup.enter.native="autoInput"
  13 + :disabled="isBianhaoDisabled2"
  14 + ></a-input>
19 </a-form-model-item> 15 </a-form-model-item>
20 </a-col> 16 </a-col>
  17 +
21 <a-col :span="24"> 18 <a-col :span="24">
22 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber"> 19 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
23 - <a-input v-model="model.partNumber" placeholder="请输入客户料号" ></a-input>  
24 - </a-form-model-item>  
25 - </a-col>  
26 - <a-col :span="24">  
27 - <a-form-model-item label="物料描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">  
28 - <a-input v-model="model.description" placeholder="请输入物料描述" ></a-input>  
29 - </a-form-model-item>  
30 - </a-col>  
31 - <a-col :span="24">  
32 - <a-form-model-item label="品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productname">  
33 - <a-input v-model="model.productname" placeholder="请输入品名" ></a-input>  
34 - </a-form-model-item>  
35 - </a-col>  
36 - <a-col :span="24">  
37 - <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">  
38 - <a-input v-model="model.specifications" placeholder="请输入规格" ></a-input> 20 + <a-input
  21 + v-model="model.partNumber"
  22 + placeholder="请输入客户料号"
  23 + @blur="autoInput"
  24 + @keyup.enter.native="autoInput"
  25 + :disabled="isBianhaoDisabled2"
  26 + ></a-input>
39 </a-form-model-item> 27 </a-form-model-item>
40 </a-col> 28 </a-col>
41 <a-col :span="24"> 29 <a-col :span="24">
42 <a-form-model-item label="厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chang"> 30 <a-form-model-item label="厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chang">
43 - <a-input v-model="model.chang" placeholder="请输入厂商" ></a-input> 31 + <a-input v-model="model.chang" placeholder="请输入厂商" :disabled="isBianhaoDisabled"></a-input>
44 </a-form-model-item> 32 </a-form-model-item>
45 </a-col> 33 </a-col>
46 <a-col :span="24"> 34 <a-col :span="24">
@@ -55,17 +43,17 @@ @@ -55,17 +43,17 @@
55 </a-col> 43 </a-col>
56 <a-col :span="24"> 44 <a-col :span="24">
57 <a-form-model-item label="货期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime"> 45 <a-form-model-item label="货期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
58 - <a-input v-model="model.deliveryTime" placeholder="请输入货期" ></a-input> 46 + <a-input v-model="model.deliveryTime" placeholder="请输入货期"></a-input>
59 </a-form-model-item> 47 </a-form-model-item>
60 </a-col> 48 </a-col>
61 <a-col :span="24"> 49 <a-col :span="24">
62 <a-form-model-item label="对接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contactPerson"> 50 <a-form-model-item label="对接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contactPerson">
63 - <a-input v-model="model.contactPerson" placeholder="请输入对接人" ></a-input> 51 + <a-input v-model="model.contactPerson" placeholder="请输入对接人"></a-input>
64 </a-form-model-item> 52 </a-form-model-item>
65 </a-col> 53 </a-col>
66 <a-col :span="24"> 54 <a-col :span="24">
67 <a-form-model-item label="询价人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inquirer"> 55 <a-form-model-item label="询价人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inquirer">
68 - <a-input v-model="model.inquirer" placeholder="请输入询价人" ></a-input> 56 + <a-input v-model="model.inquirer" placeholder="请输入询价人"></a-input>
69 </a-form-model-item> 57 </a-form-model-item>
70 </a-col> 58 </a-col>
71 </a-row> 59 </a-row>
@@ -75,26 +63,25 @@ @@ -75,26 +63,25 @@
75 </template> 63 </template>
76 64
77 <script> 65 <script>
  66 +import { httpAction, getAction } from '@/api/manage'
  67 +import { validateDuplicateValue } from '@/utils/util'
78 68
79 - import { httpAction, getAction } from '@/api/manage'  
80 - import { validateDuplicateValue } from '@/utils/util'  
81 -  
82 - export default { 69 +export default {
83 name: 'TblTradInquiryForm', 70 name: 'TblTradInquiryForm',
84 - components: {  
85 - }, 71 + components: {},
86 props: { 72 props: {
87 //表单禁用 73 //表单禁用
88 disabled: { 74 disabled: {
89 type: Boolean, 75 type: Boolean,
90 default: false, 76 default: false,
91 - required: false  
92 - } 77 + required: false,
93 }, 78 },
94 - data () {  
95 - return {  
96 - model:{  
97 }, 79 },
  80 + data() {
  81 + return {
  82 + isBianhaoDisabled: true,
  83 + isBianhaoDisabled2: false,
  84 + model: {},
98 labelCol: { 85 labelCol: {
99 xs: { span: 24 }, 86 xs: { span: 24 },
100 sm: { span: 5 }, 87 sm: { span: 5 },
@@ -105,60 +92,88 @@ @@ -105,60 +92,88 @@
105 }, 92 },
106 confirmLoading: false, 93 confirmLoading: false,
107 validatorRules: { 94 validatorRules: {
  95 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  96 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  97 + chang: [{ required: true, message: '请输入厂商!' }],
  98 + price: [{ required: true, message: '请输入价格!' }],
108 }, 99 },
109 url: { 100 url: {
110 - add: "/trad/tblTradInquiry/add",  
111 - edit: "/trad/tblTradInquiry/edit",  
112 - queryById: "/trad/tblTradInquiry/queryById"  
113 - } 101 + add: '/trad/tblTradInquiry/add',
  102 + edit: '/trad/tblTradInquiry/edit',
  103 + queryById: '/trad/tblTradInquiry/queryById',
  104 + queryBy: '/trad/tblTradInquiry/queryBy',
  105 + },
114 } 106 }
115 }, 107 },
116 computed: { 108 computed: {
117 - formDisabled(){ 109 + formDisabled() {
118 return this.disabled 110 return this.disabled
119 }, 111 },
120 }, 112 },
121 - created () { 113 + created() {
122 //备份model原始值 114 //备份model原始值
123 - this.modelDefault = JSON.parse(JSON.stringify(this.model)); 115 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
124 }, 116 },
125 methods: { 117 methods: {
126 - add () {  
127 - this.edit(this.modelDefault); 118 + async autoInput() {
  119 + this.confirmLoading = true
  120 + const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  121 + let res = await getAction(this.url.queryBy, param)
  122 +
  123 + console.log(res)
  124 + if (!res.result) {
  125 + this.$message.error('没有这个招标信息,请重新输入')
  126 +
  127 + this.confirmLoading = false
  128 + this.isBianhaoDisabled = true
  129 + return
  130 + }
  131 + this.isBianhaoDisabled = false
  132 + this.confirmLoading = false
  133 + },
  134 + add() {
  135 + this.edit(this.modelDefault)
  136 + this.isBianhaoDisabled = true
  137 + this.isBianhaoDisabled2 = false
128 }, 138 },
129 - edit (record) {  
130 - this.model = Object.assign({}, record);  
131 - this.visible = true; 139 + edit(record) {
  140 + this.model = Object.assign({}, record)
  141 + this.visible = true
  142 + this.isBianhaoDisabled2 = true
  143 + this.isBianhaoDisabled = false
132 }, 144 },
133 - submitForm () {  
134 - const that = this; 145 + submitForm() {
  146 + const that = this
135 // 触发表单验证 147 // 触发表单验证
136 - this.$refs.form.validate(valid => {  
137 - if (valid) {  
138 - that.confirmLoading = true;  
139 - let httpurl = '';  
140 - let method = '';  
141 - if(!this.model.id){  
142 - httpurl+=this.url.add;  
143 - method = 'post';  
144 - }else{  
145 - httpurl+=this.url.edit;  
146 - method = 'put'; 148 + this.$refs.form.validate((valid) => {
  149 + if (valid && !this.isBianhaoDisabled) {
  150 + that.confirmLoading = true
  151 + let httpurl = ''
  152 + let method = ''
  153 + if (!this.model.id) {
  154 + httpurl += this.url.add
  155 + method = 'post'
  156 + } else {
  157 + httpurl += this.url.edit
  158 + method = 'put'
147 } 159 }
148 - httpAction(httpurl,this.model,method).then((res)=>{  
149 - if(res.success){  
150 - that.$message.success(res.message);  
151 - that.$emit('ok');  
152 - }else{  
153 - that.$message.warning(res.message); 160 + httpAction(httpurl, this.model, method)
  161 + .then((res) => {
  162 + if (res.success) {
  163 + that.$message.success(res.message)
  164 + that.$emit('ok')
  165 + } else {
  166 + that.$message.warning(res.message)
154 } 167 }
155 - }).finally(() => {  
156 - that.confirmLoading = false;  
157 }) 168 })
  169 + .finally(() => {
  170 + that.confirmLoading = false
  171 + })
  172 + }else{
  173 + that.$message.error("招标信息错误")
158 } 174 }
159 -  
160 }) 175 })
161 }, 176 },
162 - }  
163 - } 177 + },
  178 +}
164 </script> 179 </script>
@@ -5,17 +5,29 @@ @@ -5,17 +5,29 @@
5 <a-row> 5 <a-row>
6 <a-col :span="24"> 6 <a-col :span="24">
7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber"> 7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
8 - <a-input v-model="model.tenderNumber" placeholder="请输入招标号"></a-input> 8 + <a-input
  9 + v-model="model.tenderNumber"
  10 + placeholder="请输入招标号"
  11 + @blur="autoInput"
  12 + @keyup.enter.native="autoInput"
  13 + :disabled="isBianhaoDisabled2"
  14 + ></a-input>
9 </a-form-model-item> 15 </a-form-model-item>
10 </a-col> 16 </a-col>
11 <a-col :span="24"> 17 <a-col :span="24">
12 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber"> 18 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
13 - <a-input v-model="model.partNumber" placeholder="请输入客户料号"></a-input> 19 + <a-input
  20 + v-model="model.partNumber"
  21 + placeholder="请输入客户料号"
  22 + @blur="autoInput"
  23 + @keyup.enter.native="autoInput"
  24 + :disabled="isBianhaoDisabled2"
  25 + ></a-input>
14 </a-form-model-item> 26 </a-form-model-item>
15 </a-col> 27 </a-col>
16 <a-col :span="24"> 28 <a-col :span="24">
17 <a-form-model-item label="采购厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgManufacturer"> 29 <a-form-model-item label="采购厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgManufacturer">
18 - <a-input v-model="model.cgManufacturer" placeholder="请输入采购厂商" ></a-input> 30 + <a-input v-model="model.cgManufacturer" placeholder="请输入采购厂商" :disabled="isBianhaoDisabled"></a-input>
19 </a-form-model-item> 31 </a-form-model-item>
20 </a-col> 32 </a-col>
21 <a-col :span="24"> 33 <a-col :span="24">
@@ -40,7 +52,7 @@ @@ -40,7 +52,7 @@
40 </a-col> 52 </a-col>
41 <a-col :span="24"> 53 <a-col :span="24">
42 <a-form-model-item label="采购单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgPrice"> 54 <a-form-model-item label="采购单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgPrice">
43 - <a-input-number v-model="model.cgPrice" placeholder="请输入采购单价" style="width: 100%" /> 55 + <a-input-number v-model="model.cgPrice" placeholder="请输入采购单价" style="width: 100%"/>
44 </a-form-model-item> 56 </a-form-model-item>
45 </a-col> 57 </a-col>
46 <a-col :span="24"> 58 <a-col :span="24">
@@ -80,12 +92,12 @@ @@ -80,12 +92,12 @@
80 </a-col> 92 </a-col>
81 <a-col :span="24"> 93 <a-col :span="24">
82 <a-form-model-item label="交接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jiaojieren"> 94 <a-form-model-item label="交接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jiaojieren">
83 - <a-input v-model="model.jiaojieren" placeholder="请输入交接人" ></a-input> 95 + <a-input v-model="model.jiaojieren" placeholder="请输入交接人"></a-input>
84 </a-form-model-item> 96 </a-form-model-item>
85 </a-col> 97 </a-col>
86 <a-col :span="24"> 98 <a-col :span="24">
87 <a-form-model-item label="送货单扫描件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="scannedCopies"> 99 <a-form-model-item label="送货单扫描件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="scannedCopies">
88 - <a-input v-model="model.scannedCopies" placeholder="请输入送货单扫描件" ></a-input> 100 + <a-input v-model="model.scannedCopies" placeholder="请输入送货单扫描件"></a-input>
89 </a-form-model-item> 101 </a-form-model-item>
90 </a-col> 102 </a-col>
91 <a-col :span="24"> 103 <a-col :span="24">
@@ -100,26 +112,25 @@ @@ -100,26 +112,25 @@
100 </template> 112 </template>
101 113
102 <script> 114 <script>
  115 +import { httpAction, getAction } from '@/api/manage'
  116 +import { validateDuplicateValue } from '@/utils/util'
103 117
104 - import { httpAction, getAction } from '@/api/manage'  
105 - import { validateDuplicateValue } from '@/utils/util'  
106 -  
107 - export default { 118 +export default {
108 name: 'TblTradTenderForm', 119 name: 'TblTradTenderForm',
109 - components: {  
110 - }, 120 + components: {},
111 props: { 121 props: {
112 //表单禁用 122 //表单禁用
113 disabled: { 123 disabled: {
114 type: Boolean, 124 type: Boolean,
115 default: false, 125 default: false,
116 - required: false  
117 - } 126 + required: false,
118 }, 127 },
119 - data () {  
120 - return {  
121 - model:{  
122 }, 128 },
  129 + data() {
  130 + return {
  131 + isBianhaoDisabled: true,
  132 + isBianhaoDisabled2:false,
  133 + model: {},
123 labelCol: { 134 labelCol: {
124 xs: { span: 24 }, 135 xs: { span: 24 },
125 sm: { span: 5 }, 136 sm: { span: 5 },
@@ -130,60 +141,103 @@ @@ -130,60 +141,103 @@
130 }, 141 },
131 confirmLoading: false, 142 confirmLoading: false,
132 validatorRules: { 143 validatorRules: {
  144 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  145 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  146 + cgManufacturer: [{ required: true, message: '请输入采购厂商!' }],
  147 + cgProductname: [{ required: true, message: '请输入采购品名!' }],
  148 + cgNum: [{ required: true, message: '请输入采购数量!' }],
  149 + cgPrice: [{ required: true, message: '请输入采购单价!' }],
  150 + invoiceNum: [{ required: true, message: '请输入发票号!' }],
  151 + invoiceType: [{ required: true, message: '请输入发票类型!' }],
133 }, 152 },
134 url: { 153 url: {
135 - add: "/trad/tblTradTender/add",  
136 - edit: "/trad/tblTradTender/edit",  
137 - queryById: "/trad/tblTradTender/queryById"  
138 - } 154 + add: '/trad/tblTradTender/add',
  155 + edit: '/trad/tblTradTender/edit',
  156 + queryById: '/trad/tblTradTender/queryById',
  157 + queryBy: '/trad/tblTradTender/queryBy',
  158 + querytenderBy: '/trad/tblTradTender/querytenderBy',
  159 + },
139 } 160 }
140 }, 161 },
141 computed: { 162 computed: {
142 - formDisabled(){ 163 + formDisabled() {
143 return this.disabled 164 return this.disabled
144 }, 165 },
145 }, 166 },
146 - created () { 167 + created() {
147 //备份model原始值 168 //备份model原始值
148 - this.modelDefault = JSON.parse(JSON.stringify(this.model)); 169 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
149 }, 170 },
150 methods: { 171 methods: {
151 - add () {  
152 - this.edit(this.modelDefault); 172 + async autoInput() {
  173 + this.confirmLoading = true
  174 + const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  175 + const param2 = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  176 + let res2 = await getAction(this.url.querytenderBy, param2)
  177 + let res = await getAction(this.url.queryBy, param)
  178 +
  179 + console.log(res)
  180 + console.log(res2)
  181 + if (res2.result) {
  182 + this.$message.error('这个招标已存在合同信息')
  183 +
  184 + this.confirmLoading = false
  185 + this.isBianhaoDisabled = true
  186 + return
  187 + }
  188 + if (!res.result) {
  189 + this.$message.error('没有这个招标信息,请重新输入')
  190 +
  191 + this.confirmLoading = false
  192 + this.isBianhaoDisabled = true
  193 + return
  194 + }
  195 + this.isBianhaoDisabled=false
  196 + this.confirmLoading = false
  197 + },
  198 + add() {
  199 + this.edit(this.modelDefault)
  200 + this.isBianhaoDisabled=true
  201 + this.isBianhaoDisabled2=false
153 }, 202 },
154 - edit (record) {  
155 - this.model = Object.assign({}, record);  
156 - this.visible = true; 203 + edit(record) {
  204 + this.model = Object.assign({}, record)
  205 + this.visible = true
  206 + this.isBianhaoDisabled2=true
  207 + this.isBianhaoDisabled=false
157 }, 208 },
158 - submitForm () {  
159 - const that = this; 209 + submitForm() {
  210 + const that = this
160 // 触发表单验证 211 // 触发表单验证
161 - this.$refs.form.validate(valid => {  
162 - if (valid) {  
163 - that.confirmLoading = true;  
164 - let httpurl = '';  
165 - let method = '';  
166 - if(!this.model.id){  
167 - httpurl+=this.url.add;  
168 - method = 'post';  
169 - }else{  
170 - httpurl+=this.url.edit;  
171 - method = 'put'; 212 + this.$refs.form.validate((valid) => {
  213 + if (valid && !this.isBianhaoDisabled) {
  214 + that.confirmLoading = true
  215 + let httpurl = ''
  216 + let method = ''
  217 + if (!this.model.id) {
  218 + httpurl += this.url.add
  219 + method = 'post'
  220 + } else {
  221 + httpurl += this.url.edit
  222 + method = 'put'
172 } 223 }
173 - httpAction(httpurl,this.model,method).then((res)=>{  
174 - if(res.success){  
175 - that.$message.success(res.message);  
176 - that.$emit('ok');  
177 - }else{  
178 - that.$message.warning(res.message); 224 + httpAction(httpurl, this.model, method)
  225 + .then((res) => {
  226 + if (res.success) {
  227 + that.$message.success(res.message)
  228 + that.$emit('ok')
  229 + } else {
  230 + that.$message.warning(res.message)
179 } 231 }
180 - }).finally(() => {  
181 - that.confirmLoading = false;  
182 }) 232 })
  233 + .finally(() => {
  234 + that.confirmLoading = false
  235 + })
  236 + }else{
  237 + that.$message.error("招标信息错误")
183 } 238 }
184 -  
185 }) 239 })
186 }, 240 },
187 - }  
188 - } 241 + },
  242 +}
189 </script> 243 </script>
@@ -5,17 +5,34 @@ @@ -5,17 +5,34 @@
5 <a-row> 5 <a-row>
6 <a-col :span="24"> 6 <a-col :span="24">
7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber"> 7 <a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
8 - <a-input v-model="model.tenderNumber" placeholder="请输入招标号"></a-input> 8 + <a-input
  9 + v-model="model.tenderNumber"
  10 + placeholder="请输入招标号"
  11 + @blur="autoInput"
  12 + @keyup.enter.native="autoInput"
  13 + :disabled="isBianhaoDisabled2"
  14 + ></a-input>
9 </a-form-model-item> 15 </a-form-model-item>
10 </a-col> 16 </a-col>
11 <a-col :span="24"> 17 <a-col :span="24">
12 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber"> 18 <a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
13 - <a-input v-model="model.partNumber" placeholder="请输入客户料号"></a-input> 19 + <a-input
  20 + v-model="model.partNumber"
  21 + placeholder="请输入客户料号"
  22 + @blur="autoInput"
  23 + @keyup.enter.native="autoInput"
  24 + :disabled="isBianhaoDisabled2"
  25 + ></a-input>
14 </a-form-model-item> 26 </a-form-model-item>
15 </a-col> 27 </a-col>
16 <a-col :span="24"> 28 <a-col :span="24">
17 <a-form-model-item label="投标价格(不含税)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bidPrice"> 29 <a-form-model-item label="投标价格(不含税)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bidPrice">
18 - <a-input-number v-model="model.bidPrice" placeholder="请输入投标价格(不含税)" style="width: 100%" /> 30 + <a-input-number
  31 + v-model="model.bidPrice"
  32 + placeholder="请输入投标价格(不含税)"
  33 + style="width: 100%"
  34 + :disabled="isBianhaoDisabled"
  35 + />
19 </a-form-model-item> 36 </a-form-model-item>
20 </a-col> 37 </a-col>
21 <a-col :span="24"> 38 <a-col :span="24">
@@ -40,26 +57,25 @@ @@ -40,26 +57,25 @@
40 </template> 57 </template>
41 58
42 <script> 59 <script>
  60 +import { httpAction, getAction } from '@/api/manage'
  61 +import { validateDuplicateValue } from '@/utils/util'
43 62
44 - import { httpAction, getAction } from '@/api/manage'  
45 - import { validateDuplicateValue } from '@/utils/util'  
46 -  
47 - export default { 63 +export default {
48 name: 'TblTradTouForm', 64 name: 'TblTradTouForm',
49 - components: {  
50 - }, 65 + components: {},
51 props: { 66 props: {
52 //表单禁用 67 //表单禁用
53 disabled: { 68 disabled: {
54 type: Boolean, 69 type: Boolean,
55 default: false, 70 default: false,
56 - required: false  
57 - } 71 + required: false,
58 }, 72 },
59 - data () {  
60 - return {  
61 - model:{  
62 }, 73 },
  74 + data() {
  75 + return {
  76 + isBianhaoDisabled: true,
  77 + isBianhaoDisabled2: false,
  78 + model: {},
63 labelCol: { 79 labelCol: {
64 xs: { span: 24 }, 80 xs: { span: 24 },
65 sm: { span: 5 }, 81 sm: { span: 5 },
@@ -70,60 +86,98 @@ @@ -70,60 +86,98 @@
70 }, 86 },
71 confirmLoading: false, 87 confirmLoading: false,
72 validatorRules: { 88 validatorRules: {
  89 + tenderNumber: [{ required: true, message: '请输入招标号!' }],
  90 + partNumber: [{ required: true, message: '请输入客户料号!' }],
  91 + bidPrice: [{ required: true, message: '请输入投标价格!' }],
  92 + zhongPrice: [{ required: true, message: '请输入中标单价!' }],
  93 + zhongNum: [{ required: true, message: '请输入中标数量!' }],
73 }, 94 },
74 url: { 95 url: {
75 - add: "/trad/tblTradTou/add",  
76 - edit: "/trad/tblTradTou/edit",  
77 - queryById: "/trad/tblTradTou/queryById"  
78 - } 96 + add: '/trad/tblTradTou/add',
  97 + edit: '/trad/tblTradTou/edit',
  98 + queryById: '/trad/tblTradTou/queryById',
  99 + queryBy: '/trad/tblTradTou/queryBy',
  100 + querytouBy: '/trad/tblTradTou/querytouBy',
  101 + },
79 } 102 }
80 }, 103 },
81 computed: { 104 computed: {
82 - formDisabled(){ 105 + formDisabled() {
83 return this.disabled 106 return this.disabled
84 }, 107 },
85 }, 108 },
86 - created () { 109 + created() {
87 //备份model原始值 110 //备份model原始值
88 - this.modelDefault = JSON.parse(JSON.stringify(this.model)); 111 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
89 }, 112 },
90 methods: { 113 methods: {
91 - add () {  
92 - this.edit(this.modelDefault); 114 + async autoInput() {
  115 + this.confirmLoading = true
  116 + const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  117 + const param2 = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
  118 + let res2 = await getAction(this.url.querytouBy, param2)
  119 + let res = await getAction(this.url.queryBy, param)
  120 +
  121 + console.log(res)
  122 + console.log(res2)
  123 + if (res2.result) {
  124 + this.$message.error('这个招标已存在合同信息')
  125 + this.confirmLoading = false
  126 + this.isBianhaoDisabled = true
  127 + return
  128 + }
  129 + if (!res.result) {
  130 + this.$message.error('没有这个招标信息,请重新输入')
  131 + this.confirmLoading = false
  132 + this.isBianhaoDisabled = true
  133 + return
  134 + }
  135 + this.isBianhaoDisabled = false
  136 + this.confirmLoading = false
93 }, 137 },
94 - edit (record) {  
95 - this.model = Object.assign({}, record);  
96 - this.visible = true; 138 + add() {
  139 + this.edit(this.modelDefault)
  140 + this.isBianhaoDisabled = true
  141 + this.isBianhaoDisabled2 = false
97 }, 142 },
98 - submitForm () {  
99 - const that = this; 143 + edit(record) {
  144 + this.model = Object.assign({}, record)
  145 + this.visible = true
  146 + this.isBianhaoDisabled2 = true
  147 + this.isBianhaoDisabled = false
  148 + },
  149 + submitForm() {
  150 + const that = this
100 // 触发表单验证 151 // 触发表单验证
101 - this.$refs.form.validate(valid => {  
102 - if (valid) {  
103 - that.confirmLoading = true;  
104 - let httpurl = '';  
105 - let method = '';  
106 - if(!this.model.id){  
107 - httpurl+=this.url.add;  
108 - method = 'post';  
109 - }else{  
110 - httpurl+=this.url.edit;  
111 - method = 'put'; 152 + this.$refs.form.validate((valid) => {
  153 + if (valid && !this.isBianhaoDisabled) {
  154 + that.confirmLoading = true
  155 + let httpurl = ''
  156 + let method = ''
  157 + if (!this.model.id) {
  158 + httpurl += this.url.add
  159 + method = 'post'
  160 + } else {
  161 + httpurl += this.url.edit
  162 + method = 'put'
112 } 163 }
113 - httpAction(httpurl,this.model,method).then((res)=>{  
114 - if(res.success){  
115 - that.$message.success(res.message);  
116 - that.$emit('ok');  
117 - }else{  
118 - that.$message.warning(res.message); 164 + httpAction(httpurl, this.model, method)
  165 + .then((res) => {
  166 + if (res.success) {
  167 + that.$message.success(res.message)
  168 + that.$emit('ok')
  169 + } else {
  170 + that.$message.warning(res.message)
119 } 171 }
120 - }).finally(() => {  
121 - that.confirmLoading = false;  
122 }) 172 })
  173 + .finally(() => {
  174 + that.confirmLoading = false
  175 + })
  176 + }else{
  177 + that.$message.error("招标信息错误")
123 } 178 }
124 -  
125 }) 179 })
126 }, 180 },
127 - }  
128 - } 181 + },
  182 +}
129 </script> 183 </script>