plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1636 lines
58 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
  1. <template>
  2. <div class="mode-config">
  3. <div style="width: 1200px">
  4. <el-form label-position="top" :model="searchData">
  5. <el-row :gutter="10">
  6. <el-col :span="3">
  7. <el-form-item label="客户编码">
  8. <el-input v-model="searchData.customerNo" clearable/>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="3">
  12. <el-form-item label="客户名称">
  13. <el-input v-model="searchData.customerName" clearable/>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="3">
  17. <el-form-item label="采购专员">
  18. <el-input v-model="searchData.trackerName" clearable/>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="3">
  22. <el-form-item label="报价单号">
  23. <el-input v-model="searchData.quotationNo" clearable/>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="3">
  27. <el-form-item label="客户询价单号">
  28. <el-input v-model="searchData.customerInquiryNo" clearable/>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="3">
  32. <el-form-item label="内部询价单号">
  33. <el-input v-model="searchData.internalInquiryNo" clearable/>
  34. </el-form-item>
  35. </el-col>
  36. </el-row>
  37. <el-row :gutter="10">
  38. <el-col :span="3">
  39. <el-form-item label="项目编码">
  40. <el-input v-model="searchData.projectId" clearable/>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="3">
  44. <el-form-item label="项目名称">
  45. <el-input v-model="searchData.projectName" clearable/>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="3">
  49. <el-form-item label="报价专员">
  50. <el-input v-model="searchData.quoterName" clearable/>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="3">
  54. <el-form-item label="状态">
  55. <el-select v-model="searchData.quotationStatus">
  56. <el-option label="全部" value=""></el-option>
  57. <el-option label="草稿" value="草稿"></el-option>
  58. <el-option label="下达" value="下达"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="6">
  63. <el-row>
  64. <el-col :span="11">
  65. <el-form-item label="报价日期">
  66. <el-date-picker
  67. value-format="yyyy-MM-dd"
  68. v-model="searchData.startDate"
  69. style="width: 100%"
  70. type="date"
  71. placeholder=" ">
  72. </el-date-picker>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="2">
  76. <el-form-item label=" ">
  77. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="11">
  81. <el-form-item label=" ">
  82. <el-date-picker
  83. value-format="yyyy-MM-dd"
  84. style="width: 100%"
  85. v-model="searchData.endDate"
  86. type="date"
  87. placeholder=" ">
  88. </el-date-picker>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-col>
  93. <el-col :span="3">
  94. <el-form-item label=" ">
  95. <el-button plain type="primary" @click="initDataBtn"> </el-button>
  96. <el-button type="primary" @click="insertDiaLogFlag = true"> </el-button>
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. </el-form>
  101. </div>
  102. <el-table :data="tableData" v-loading="initQuotationHeaderLoading" :row-style="quotationHeaderRowStyle"
  103. element-loading-text="数据正在加载中"
  104. element-loading-spinner="el-icon-loading" @row-click="rowClickQuotation" border
  105. style="width: 100%;margin-top: 12px" :height="height">
  106. <el-table-column
  107. label="操作"
  108. align="center"
  109. fixed
  110. width="160">
  111. <template slot-scope="scope">
  112. <el-link style="cursor: pointer" v-if="scope.row.quotationStatus === '草稿'"
  113. @click="handleUpdateStatus(scope.row)">下达
  114. </el-link>
  115. <el-link style="cursor: pointer" v-if="scope.row.quotationStatus === '下达'" @click="handleUpdateStatus(scope.row,true)">取消下达</el-link>
  116. <el-link style="cursor: pointer" v-if="scope.row.quotationStatus !== '草稿'" @click="handleDetail(scope.row)">详情</el-link>
  117. <el-link style="cursor: pointer" v-if="scope.row.quotationStatus === '草稿'" @click="editQuotationHeader(scope.row)">编辑</el-link>
  118. <el-link style="cursor: pointer" v-if="scope.row.quotationStatus === '草稿'" @click="deleteQuotationHeader(scope.row)">删除</el-link>
  119. <el-link style="cursor: pointer" @click="quotationAgain(scope.row)">重新报价</el-link>
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. v-for="(item,index) in columnList" :key="index"
  124. :sortable="item.columnSortable"
  125. :prop="item.columnProp"
  126. :header-align="item.headerAlign"
  127. :show-overflow-tooltip="item.showOverflowTooltip"
  128. :align="item.align"
  129. :fixed="item.fixed===''?false:item.fixed"
  130. :min-width="item.columnWidth"
  131. :label="item.columnLabel">
  132. <template slot-scope="scope">
  133. <template v-if="item.columnProp === 'internalInquiryNo'">
  134. <a @click="handleRouter(scope.row[item.columnProp])" v-if="scope.row[item.columnProp]">{{ scope.row[item.columnProp] }}</a>
  135. </template>
  136. <template v-else>
  137. <span v-if="!item.columnHidden"> {{`${scope.row[item.columnProp]}${index === 0 ? ("-" + scope.row['versionCode']) : ''}`}}</span>
  138. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  139. </template>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. <!-- 分页插件 -->
  144. <el-pagination style="margin-top: 0px"
  145. @size-change="quotationHeaderSizeChange"
  146. @current-change="quotationHeaderCurrentChange"
  147. :current-page="no"
  148. :page-sizes="[20, 50, 100, 200, 500]"
  149. :page-size="size"
  150. :total="total"
  151. layout="total,sizes, prev, pager, next, jumper">
  152. </el-pagination>
  153. <!-- 标签页 -->
  154. <el-tabs v-model="activeTabName" @tab-click="handleClickTab"
  155. style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border: 2px;min-height: 420px;margin-top: 5px;">
  156. <el-tab-pane label="报价明细" name="quote_detail">
  157. <quote-detail :header="quotationHeader"></quote-detail>
  158. </el-tab-pane>
  159. <el-tab-pane label="项目信息" name="quotation_project_information">
  160. <quotation-project-information :quotation-header="quotationHeader"></quotation-project-information>
  161. </el-tab-pane>
  162. <el-tab-pane label="客户信息" name="quotation_customer_information">
  163. <customer-info :project="quotationHeader"></customer-info>
  164. </el-tab-pane>
  165. <el-tab-pane label="客户联系人" name="quotation_customer_contact">
  166. <quotation-customer-contact :quotation-header="quotationHeader"></quotation-customer-contact>
  167. </el-tab-pane>
  168. <el-tab-pane label="报价-附件信息" name="quote_oss">
  169. <oss-components label="报价单号"
  170. :columns="ossColumns"
  171. :order-ref1="quotationHeader.site?quotationHeader.site:''"
  172. :order-ref2="`${quotationHeader.quotationNo}-${quotationHeader.versionCode}`">
  173. </oss-components>
  174. </el-tab-pane>
  175. <el-tab-pane label="询价-基本信息" name="request">
  176. <price-check-properties ref="tabProperties"
  177. v-model:data-list="priceCheckPropertiesList"
  178. height="35vh"></price-check-properties>
  179. </el-tab-pane>
  180. <el-tab-pane label="询价-附件信息" name="oss">
  181. <oss-components label="询价单号"
  182. :columns="ossColumns"
  183. :order-ref1="quotationHeader.site"
  184. :order-ref2="quotationHeader.internalInquiryNo?quotationHeader.internalInquiryNo:''">
  185. </oss-components>
  186. </el-tab-pane>
  187. <!-- 审批信息 -->
  188. <el-tab-pane label="审批信息" name="approvalInformation">
  189. <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="300"></approval-information>
  190. </el-tab-pane>
  191. </el-tabs>
  192. <!-- 新增弹框 -->
  193. <el-dialog
  194. :title="insertData.quotationHeaderId?`编辑销售报价-${insertData.quotationNo}-${insertData.versionCode}`:`销售报价`"
  195. @close="closeInsertDialog" :close-on-click-modal="false" v-drag :visible.sync="insertDiaLogFlag" width="500px">
  196. <el-form :rules="rules" label-position="top" ref="insertQuotationForm" :model="insertData"
  197. label-width="120px">
  198. <el-row :gutter="10">
  199. <el-col :span="8">
  200. <el-form-item label="内部询价单号" prop="internalInquiryNo">
  201. <span slot="label" v-if="!detailDialogVisible" @click="clickInternalInquiryNoHandle"><a herf="#">内部询价单号</a></span>
  202. <el-input v-model="insertData.internalInquiryNo" :disabled="detailDialogVisible" @blur="blurInternalInquiryNoHandle" clearable/>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="16">
  206. <el-form-item label="客户询价单号" prop="customerInquiryNo">
  207. <el-input v-model="insertData.customerInquiryNo" :disabled="detailDialogVisible" clearable/>
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. <el-row :gutter="10">
  212. <el-col :span="8">
  213. <el-form-item prop="customerNo" label="客户编码">
  214. <span slot="label" v-if="insertData.internalInquiryNo ==='' && !detailDialogVisible" @click="getBaseList(102,1)">
  215. <a>客户编码</a>
  216. </span>
  217. <el-input v-model="insertData.customerNo" :disabled="insertData.internalInquiryNo !=='' || detailDialogVisible"
  218. clearable @change="clearCustomer" @blur="handleQueryCustomer"/>
  219. </el-form-item>
  220. </el-col>
  221. <el-col :span="16">
  222. <el-form-item prop="customerName" label="客户名称">
  223. <el-input v-model="insertData.customerName" disabled clearable/>
  224. </el-form-item>
  225. </el-col>
  226. </el-row>
  227. <el-row :gutter="10">
  228. <el-col :span="8">
  229. <el-form-item prop="projectId" label="项目编码">
  230. <span slot="label" v-if="insertData.customerNo !=='' && insertData.internalInquiryNo ==='' && !detailDialogVisible " @click="clickProject">
  231. <a>项目编码</a>
  232. </span>
  233. <el-input v-model="insertData.projectId" :disabled="insertData.customerNo ==='' || insertData.internalInquiryNo !=='' || detailDialogVisible" clearable @blur="handleQueryProjectByCustomer"/>
  234. </el-form-item>
  235. </el-col>
  236. <el-col :span="16">
  237. <el-form-item prop="projectName" label="项目名称">
  238. <el-input v-model="insertData.projectName" disabled clearable/>
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. <el-row :gutter="10">
  243. <el-col :span="8">
  244. <el-form-item label="终端客户编码">
  245. <el-input disabled v-model="insertData.finalCustomerId"></el-input>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="16">
  249. <el-form-item label="终端客户名称">
  250. <el-input disabled v-model="insertData.finalCustomerName"></el-input>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <el-row :gutter="10">
  255. <el-col :span="8">
  256. <el-form-item label="货币" prop="currency">
  257. <dict-data-select v-model="insertData.currency" :disabled="insertData.internalInquiryNo !=='' || detailDialogVisible" dict-type="plm_customer_information_customer_customer_currency"></dict-data-select>
  258. </el-form-item>
  259. </el-col>
  260. <el-col :span="8">
  261. <el-form-item label="报价日期" prop="quotationDate">
  262. <el-date-picker
  263. style="width: 100%"
  264. v-model="insertData.quotationDate"
  265. type="date"
  266. size="mini"
  267. :disabled="detailDialogVisible"
  268. format="yyyy-MM-dd"
  269. value-format="yyyy-MM-dd"
  270. placeholder="选择日期">
  271. </el-date-picker>
  272. </el-form-item>
  273. </el-col>
  274. </el-row>
  275. <el-row :gutter="10">
  276. <el-col :span="8">
  277. <el-form-item label="报价专员" prop="quoterName">
  278. <span slot="label" @click="getBaseList(2002)" v-if="!detailDialogVisible"><a>报价专员</a></span>
  279. <el-input v-model="insertData.quoterName" @clear="clearQuoter" readonly :disabled="detailDialogVisible" clearable>
  280. <span slot="suffix" v-show="insertData.quoterName" @click="clearInsertData('quoter')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
  281. </el-input>
  282. </el-form-item>
  283. </el-col>
  284. <el-col :span="8">
  285. <el-form-item label="采购专员" prop="trackerName">
  286. <span slot="label" v-if="!detailDialogVisible" @click="getBaseList(2000)">
  287. <a>采购专员</a>
  288. </span>
  289. <el-input v-model="insertData.trackerName" :disabled="detailDialogVisible" @clear="clearTracker" readonly clearable>
  290. <span slot="suffix" v-show="insertData.trackerName" @click="clearInsertData('tracker')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
  291. </el-input>
  292. </el-form-item>
  293. </el-col>
  294. </el-row>
  295. <el-row>
  296. <el-col :span="24">
  297. <el-form-item label="备注" style="width: 100%;min-height: 90px">
  298. <el-input type="textarea" style="width: 100%" :disabled="detailDialogVisible" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  299. v-model="insertData.remark"/>
  300. </el-form-item>
  301. </el-col>
  302. </el-row>
  303. </el-form>
  304. <span slot="footer" class="dialog-footer">
  305. <el-button type="primary" :loading="insertQuotationHeaderBtn" @click="saveQuotationHeader">确定</el-button>
  306. <el-button @click="insertDiaLogFlag = false">关闭</el-button>
  307. </span>
  308. </el-dialog>
  309. <!--询价单号选择弹框-->
  310. <el-dialog title="内部询价单号"
  311. @close="closeQuotationNoDialog"
  312. @open="openQuotationNoDialog"
  313. :close-on-click-modal="false"
  314. width="1200px"
  315. :visible.sync="quotationNoDialogFlag" v-drag>
  316. <el-form label-position="top"
  317. :model="quotationNoSearchData"
  318. size="mini">
  319. <el-row :gutter="10">
  320. <el-col :span="3">
  321. <el-form-item label="询价单号">
  322. <el-input v-model="quotationNoSearchData.quotationNo" clearable/>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="3">
  326. <el-form-item label="申请批次号">
  327. <el-input v-model="quotationNoSearchData.quotationBatchNo" clearable></el-input>
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="3">
  331. <el-form-item label="序号">
  332. <el-input v-model="quotationNoSearchData.quotationItemNo" clearable></el-input>
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="3">
  336. <el-form-item label="物料编码">
  337. <el-input v-model="quotationNoSearchData.testPartNo" clearable></el-input>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="3">
  341. <el-form-item label="物料名称">
  342. <el-input v-model="quotationNoSearchData.partName" clearable></el-input>
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="3">
  346. <el-form-item :label="'状态'">
  347. <el-select v-model="quotationNoSearchData.quotationStatus" style="width:100%">
  348. <el-option label="全部" value=""></el-option>
  349. <el-option label="草稿" value="草稿"></el-option>
  350. <el-option label="审批中" value="审批中"></el-option>
  351. <el-option label="已完成" value="已完成"></el-option>
  352. </el-select>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="2">
  356. <el-form-item label=" ">
  357. <el-button type="primary" style="padding: 3px 12px" @click="searchQuotationData">查询</el-button>
  358. </el-form-item>
  359. </el-col>
  360. </el-row>
  361. </el-form>
  362. <el-table :data="quotationNoData" height="300" stripe border @row-dblclick="dblclickQuotationNo">
  363. <el-table-column prop="quotationNo" header-align="center" min-width="120" label="询价单号"/>
  364. <el-table-column prop="quotationBatchNo" header-align="center" label="询价批次号"/>
  365. <el-table-column width="60" align="center" header-align="center" prop="quotationItemNo" label="询价序号"/>
  366. <el-table-column prop="projectName" header-align="center" label="项目名称"/>
  367. <el-table-column width="180" prop="testPartNo" header-align="center" label="物料编码"/>
  368. <el-table-column prop="partName" header-align="center" label="状态"/>
  369. <el-table-column prop="quotationStatus" header-align="center" label="物料名称"/>
  370. <el-table-column label="终端客户编码" header-align="center" prop="finalCustomerId"/>
  371. <el-table-column label="终端客户名称" header-align="center" prop="finalCustomerName"/>
  372. </el-table>
  373. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  374. <el-button type="primary" @click="quotationNoDialogFlag = false">关闭</el-button>
  375. </el-footer>
  376. </el-dialog>
  377. <!-- chooseList模态框 -->
  378. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  379. <el-dialog title="选择-项目" @close="closeProjectInfoDialog" @open="searchProjectInfoList"
  380. :visible.sync="chooseProjectListFlag" width="35%" :close-on-click-modal="false">
  381. <el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
  382. <el-row :gutter="10">
  383. <el-col :span="6">
  384. <el-form-item label="项目编码">
  385. <el-input v-model="searchProjectData.projectId"></el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="6">
  389. <el-form-item label="项目名称">
  390. <el-input v-model="searchProjectData.projectName"></el-input>
  391. </el-form-item>
  392. </el-col>
  393. <el-col :span="6">
  394. <el-form-item label=" ">
  395. <el-button type="primary" @click="searchProjectInfoList">查询</el-button>
  396. </el-form-item>
  397. </el-col>
  398. </el-row>
  399. <el-table :height="223"
  400. :data="projectList"
  401. border
  402. @row-click="projectClickRow">
  403. <el-table-column label="项目编码" prop="projectId"/>
  404. <el-table-column label="项目名称" prop="projectName"/>
  405. <el-table-column label="终端客户编码" prop="finalCustomerId"/>
  406. <el-table-column label="终端客户名称" prop="finalCustomerName"/>
  407. </el-table>
  408. </el-form>
  409. </el-dialog>
  410. </div>
  411. </template>
  412. <script>
  413. import quotationExamineAndApprove from "./sellForQuotation/quotationExamineAndApprove.vue";
  414. import quotationProjectInformation from "./sellForQuotation/quotationProjectInformation.vue";
  415. import quotationCustomerInformation from "./sellForQuotation/quotationCustomerInformation.vue";
  416. import quotationCustomerContact from "./sellForQuotation/quotationCustomerContact.vue";
  417. import Chooselist from '@/views/modules/common/Chooselist';
  418. import {
  419. getQuotationHeaderByPage,
  420. saveQuotationHeader,
  421. deleteByQuotationHeaderId,
  422. quotationAgain,
  423. } from '@/api/quotation/quotationHeader.js';
  424. import {
  425. searchQuotationByQuotationNo,
  426. } from '@/api/quotation/quotationInformation.js';
  427. import {
  428. getNodeAuthority, // 获取节点权限
  429. getApprovalList, // 查询审批信息
  430. } from '@/api/changeManagement/changeManagement.js'
  431. import QuoteDetail from "./sellForQuotation/quoteDetail.vue";
  432. import {searchProjectInfoList} from "../../../api/quotation/quotationInformation";
  433. import {getQuotationHeaderByPagePost, updateQuoteStatus} from "../../../api/quotation/quotationHeader";
  434. import {getQuotePage} from "../../../api/quotation/quote";
  435. import {queryCustomer} from "../../../api/customer/customerInformation";
  436. import {queryProjectByCustomer} from "../../../api/project/project";
  437. import ApprovalInformation from "../changeManagement/approvalInformation.vue";
  438. import OssComponents from "../oss/ossComponents.vue";
  439. import PriceCheckProperties from "./priceCheckProperties.vue";
  440. import {getPriceCheckPropertiesList} from "../../../api/quotation/priceCheckProperties";
  441. import CustomerInfo from "./sellForQuotation/customerInfo.vue";
  442. import DictDataSelect from "../sys/dict-data-select.vue";
  443. export default {
  444. components: {
  445. DictDataSelect,
  446. CustomerInfo,
  447. PriceCheckProperties,
  448. ApprovalInformation,
  449. OssComponents,
  450. QuoteDetail,
  451. Chooselist,
  452. quotationExamineAndApprove,
  453. quotationProjectInformation,
  454. quotationCustomerInformation,
  455. quotationCustomerContact,
  456. },
  457. props:{
  458. height:{
  459. type:[Number,String],
  460. default:'30vh'
  461. }
  462. },
  463. data() {
  464. return {
  465. initPage:false,
  466. // 搜索条件对象
  467. searchData: {
  468. site: this.$store.state.user.site,// 工厂编号
  469. customerNo: "", // 客户编码
  470. customer: "", // 客户名称
  471. tracker: "", // 采购专员
  472. quotationStatus: "", //状态
  473. projectId: "", // 项目编码
  474. projectName: "", // 项目名称
  475. quoterName: "", // 报价专员
  476. startDate: "", // 开始日期
  477. endDate: "", // 结束日期
  478. dateValue: [],// 开始时间结束时间数组
  479. },
  480. chooseProjectListFlag: false,
  481. searchProjectData: {
  482. site: this.$store.state.user.site,
  483. projectId: undefined,
  484. projectName: undefined,
  485. customerId: undefined,
  486. },
  487. projectList: [],
  488. tableData: [],// 查询的数据
  489. columnList: [
  490. {
  491. userId: this.$store.state.user.name,
  492. functionId: 102003,
  493. serialNumber: '102003Table1QuotationNo',
  494. tableId: '102003Table1',
  495. tableName: '报价信息表',
  496. columnProp: 'quotationNo',
  497. headerAlign: 'center',
  498. align: 'center',
  499. columnLabel: '报价单号',
  500. columnHidden: false,
  501. columnImage: false,
  502. columnSortable: false,
  503. sortLv: 0,
  504. status: true,
  505. fixed: '',
  506. columnWidth: 120
  507. },
  508. {
  509. userId: this.$store.state.user.name,
  510. functionId: 102003,
  511. serialNumber: '102003Table1QuotationDate',
  512. tableId: '102003Table1',
  513. tableName: '报价信息表',
  514. columnProp: 'quotationDate',
  515. headerAlign: 'center',
  516. align: 'center',
  517. columnLabel: '报价日期',
  518. columnHidden: false,
  519. columnImage: false,
  520. columnSortable: false,
  521. sortLv: 0,
  522. status: true,
  523. fixed: '',
  524. columnWidth: 100
  525. },
  526. {
  527. userId: this.$store.state.user.name,
  528. functionId: 102003,
  529. serialNumber: '102003Table1CustomerNo',
  530. tableId: '102003Table1',
  531. tableName: '报价信息表',
  532. columnProp: 'customerNo',
  533. headerAlign: 'center',
  534. align: 'center',
  535. columnLabel: '客户编码',
  536. columnHidden: false,
  537. columnImage: false,
  538. columnSortable: false,
  539. sortLv: 0,
  540. status: true,
  541. fixed: '',
  542. columnWidth: 120
  543. },
  544. {
  545. userId: this.$store.state.user.name,
  546. functionId: 102003,
  547. serialNumber: '102003Table1CustomerName',
  548. tableId: '102003Table1',
  549. tableName: '报价信息表',
  550. columnProp: 'customerName',
  551. headerAlign: 'center',
  552. align: 'left',
  553. columnLabel: '客户名称',
  554. columnHidden: false,
  555. columnImage: false,
  556. columnSortable: false,
  557. sortLv: 0,
  558. status: true,
  559. fixed: '',
  560. columnWidth: 120
  561. }, {
  562. userId: this.$store.state.user.name,
  563. functionId: 102003,
  564. serialNumber: '102003Table1ProjectId',
  565. tableId: '102003Table1',
  566. tableName: '报价信息表',
  567. columnProp: 'projectId',
  568. headerAlign: 'center',
  569. align: 'left',
  570. columnLabel: '项目编码',
  571. columnHidden: false,
  572. columnImage: false,
  573. columnSortable: false,
  574. sortLv: 0,
  575. status: true,
  576. fixed: '',
  577. columnWidth: 200
  578. }, {
  579. userId: this.$store.state.user.name,
  580. functionId: 102003,
  581. serialNumber: '102003Table1ProjectName',
  582. tableId: '102003Table1',
  583. tableName: '报价信息表',
  584. columnProp: 'projectName',
  585. headerAlign: 'center',
  586. align: 'left',
  587. columnLabel: '项目名称',
  588. columnHidden: false,
  589. columnImage: false,
  590. columnSortable: false,
  591. sortLv: 0,
  592. status: true,
  593. fixed: '',
  594. columnWidth: 200
  595. },
  596. {
  597. userId: this.$store.state.user.name,
  598. functionId: 102003,
  599. serialNumber: '102003Table1QuoterName',
  600. tableId: '102003Table1',
  601. tableName: '报价信息表',
  602. columnProp: 'quoterName',
  603. headerAlign: 'center',
  604. align: 'left',
  605. columnLabel: '报价专员',
  606. columnHidden: false,
  607. columnImage: false,
  608. columnSortable: false,
  609. sortLv: 0,
  610. status: true,
  611. fixed: '',
  612. columnWidth: 120
  613. },
  614. {
  615. userId: this.$store.state.user.name,
  616. functionId: 102003,
  617. serialNumber: '102003Table1TrackerName',
  618. tableId: '102003Table1',
  619. tableName: '报价信息表',
  620. columnProp: 'trackerName',
  621. headerAlign: 'center',
  622. align: 'left',
  623. columnLabel: '采购专员',
  624. columnHidden: false,
  625. columnImage: false,
  626. columnSortable: false,
  627. sortLv: 0,
  628. status: true,
  629. fixed: '',
  630. columnWidth: 120
  631. },
  632. {
  633. userId: this.$store.state.user.name,
  634. functionId: 102003,
  635. serialNumber: '102003Table1Currency',
  636. tableId: '102003Table1',
  637. tableName: '报价信息表',
  638. columnProp: 'currency',
  639. headerAlign: 'center',
  640. align: 'center',
  641. columnLabel: '货币',
  642. columnHidden: false,
  643. columnImage: false,
  644. columnSortable: false,
  645. sortLv: 0,
  646. status: true,
  647. fixed: '',
  648. columnWidth: 120
  649. },
  650. {
  651. userId: this.$store.state.user.name,
  652. functionId: 102003,
  653. serialNumber: '102003Table1QuotationStatus',
  654. tableId: '102003Table1',
  655. tableName: '报价信息表',
  656. columnProp: 'quotationStatus',
  657. headerAlign: 'center',
  658. align: 'center',
  659. columnLabel: '状态',
  660. columnHidden: false,
  661. columnImage: false,
  662. columnSortable: false,
  663. sortLv: 0,
  664. status: true,
  665. fixed: '',
  666. columnWidth: 120
  667. },
  668. {
  669. userId: this.$store.state.user.name,
  670. functionId: 102003,
  671. serialNumber: '102003Table1CustomerInquiryNo',
  672. tableId: '102003Table1',
  673. tableName: '报价信息表',
  674. columnProp: 'customerInquiryNo',
  675. headerAlign: 'center',
  676. align: 'center',
  677. columnLabel: '客户报价单号',
  678. columnHidden: false,
  679. columnImage: false,
  680. columnSortable: false,
  681. sortLv: 0,
  682. status: true,
  683. fixed: '',
  684. columnWidth: 120
  685. },
  686. {
  687. userId: this.$store.state.user.name,
  688. functionId: 102003,
  689. serialNumber: '102003Table1InternalInquiryNo',
  690. tableId: '102003Table1',
  691. tableName: '报价信息表',
  692. columnProp: 'internalInquiryNo',
  693. headerAlign: 'center',
  694. align: 'center',
  695. columnLabel: '内部询价单号',
  696. columnHidden: false,
  697. columnImage: false,
  698. columnSortable: false,
  699. sortLv: 0,
  700. status: true,
  701. fixed: '',
  702. columnWidth: 120
  703. },
  704. ],
  705. initQuotationHeaderLoading: false,//表格加载状态
  706. // 分页信息
  707. no: 1,//页码
  708. size: 20,//每页条数
  709. total: 0,//总页数
  710. // 标签页
  711. activeTabName: "quote_detail",
  712. //dialog 控制开关
  713. insertDiaLogFlag: false,
  714. quotationNoDialogFlag: false,
  715. // 新增对象
  716. insertData: {
  717. site: this.$store.state.user.site,
  718. quotationNo: "",//客户报价单号
  719. quotationDate: new Date(),//报价日期
  720. customerNo: "", // 客户编号
  721. customerName: "",//客户名称
  722. versionCode: "001",
  723. projectId: "",//项目编码
  724. projectName: "",//项目名称
  725. tracker: "",//采购专员
  726. quoter: "",//销售编号
  727. quoterName: "",//报价专员
  728. trackerName: "",//采购专员
  729. currency: "",//货币
  730. quotationStatus: "草稿",//状态
  731. remark: "",//备注
  732. customerInquiryNo: "",//客户询价单号
  733. internalInquiryNo: "",//内部询价单号
  734. internalInquiryBatchNo: "",//内部询价单号
  735. requireApproval: "",//需要审批
  736. approvalStatus: "",//审批状态
  737. createBy: this.$store.state.user.id,//当前登录账号
  738. createTime: new Date(),//当前时间
  739. },
  740. quotationHeaderColumns: [
  741. {label: "quotationNo", value: "客户报价单号"},
  742. {label: "quotationDate", value: "报价日期"},
  743. {label: "customerNo", value: "客户编码"},
  744. {label: "customerName", value: "客户名称"},
  745. {label: "versionCode", value: "版本号"},
  746. {label: "projectId", value: "项目编码"},
  747. {label: "projectName", value: "项目名称"},
  748. {label: "quoterName", value: "报价专员"},
  749. {label: "trackerName", value: "采购专员"},
  750. {label: "currency", value: "货币"},
  751. {label: "quotationStatus", value: "状态"},
  752. {label: "remark", value: "备注"},
  753. {label: "customerInquiryNo", value: "客户询价单号"},
  754. {label: "internalInquiryNo", value: "内部询价单号"},
  755. {label: "requireApproval", value: "需要审批"},
  756. {label: "approvalStatus", value: "审批状态"},
  757. {label: "createBy", value: "创建人"},
  758. {label: "createDate", value: "创建时间"},
  759. {label: "updateBy", value: "更新人"},
  760. {label: "updateDate", value: "更新时间"},
  761. ],
  762. // 规则
  763. rules: {
  764. customerNo: [
  765. {required: true, message: ' '},
  766. ],
  767. customerName: [
  768. {required: true, message: ' '},
  769. ],
  770. projectId: [
  771. {required: true, message: ' '}
  772. ],
  773. projectName: [
  774. {required: true, message: ' '}
  775. ],
  776. tracker: [
  777. {required: true, message: ' '}
  778. ],
  779. trackerName: [
  780. {required: true, message: ' '}
  781. ],
  782. currency: [
  783. {required: true, message: ' '}
  784. ],
  785. quoter: [
  786. {required: true, message: ' '}
  787. ],
  788. quoterName: [
  789. {required: true, message: ' '}
  790. ],
  791. quotationStatus: [
  792. {required: true, message: ' '}
  793. ],
  794. quotationDate: [
  795. {required: true, message: ' '}
  796. ],
  797. },
  798. // 参数 选择框
  799. tagNo1: "",
  800. tagNo: "",
  801. // 内部报价单搜索表单对象
  802. quotationNoSearchData: {
  803. quotationNo: "",//单号
  804. quotationBatchNo: "",//批次号
  805. quotationItemNo: '',//序号
  806. quotationStatus: "",//状态
  807. partName:'',//物料描述
  808. testPartNo:'',//物料编码
  809. site: this.$store.state.user.site,//工厂编号
  810. },
  811. //内部报价单搜索表格数据对象
  812. quotationNoData: [],
  813. // 行对象
  814. quotationHeader: {
  815. quotationNo: "",
  816. versionCode: "",
  817. site: "",
  818. },
  819. // 按钮防重复
  820. insertQuotationHeaderBtn: false,
  821. approvalList: [],
  822. ossColumns:[
  823. {
  824. userId: this.$store.state.user.name,
  825. functionId: 103001,
  826. serialNumber: '103001Table2FileName',
  827. tableId: '103001Table2',
  828. tableName: '文件信息表',
  829. columnProp: 'fileName',
  830. headerAlign: 'center',
  831. align: 'left',
  832. columnLabel: '文件名称',
  833. columnHidden: false,
  834. columnImage: false,
  835. columnSortable: false,
  836. sortLv: 0,
  837. status: true,
  838. fixed: '',
  839. columnWidth: 140
  840. },
  841. {
  842. userId: this.$store.state.user.name,
  843. functionId: 103001,
  844. serialNumber: '103001Table2FileRemark',
  845. tableId: '103001Table2',
  846. tableName: '文件信息表',
  847. columnProp: 'fileRemark',
  848. headerAlign: 'center',
  849. align: 'left',
  850. columnLabel: '备注',
  851. columnHidden: false,
  852. columnImage: false,
  853. columnSortable: false,
  854. sortLv: 0,
  855. status: true,
  856. fixed: '',
  857. columnWidth: 240
  858. },
  859. {
  860. userId: this.$store.state.user.name,
  861. functionId: 103001,
  862. serialNumber: '103001Table2CreateDate',
  863. tableId: '103001Table2',
  864. tableName: '文件信息表',
  865. columnProp: 'createDate',
  866. headerAlign: 'center',
  867. align: 'center',
  868. columnLabel: '上传时间',
  869. columnHidden: false,
  870. columnImage: false,
  871. columnSortable: false,
  872. sortLv: 0,
  873. status: true,
  874. fixed: '',
  875. columnWidth: 140
  876. },
  877. {
  878. userId: this.$store.state.user.name,
  879. functionId: 103001,
  880. serialNumber: '103001Table2CreatedBy',
  881. tableId: '103001Table2',
  882. tableName: '文件信息表',
  883. columnProp: 'createBy',
  884. headerAlign: 'center',
  885. align: 'center',
  886. columnLabel: '上传人',
  887. columnHidden: false,
  888. columnImage: false,
  889. columnSortable: false,
  890. sortLv: 0,
  891. status: true,
  892. fixed: '',
  893. columnWidth: 140
  894. }
  895. ],
  896. detailDialogVisible: false,
  897. priceCheckPropertiesList:[],
  898. }
  899. },
  900. methods: {
  901. // 查询审批信息
  902. getApprovalList () {
  903. let tempData = {
  904. site: this.$store.state.user.site,
  905. menuId: this.$route.meta.menuId,
  906. documentNo: this.quotationHeader.quotationNo
  907. }
  908. getApprovalList(tempData).then(({data}) => {
  909. if (data && data.code === 0) {
  910. this.approvalList = data.rows
  911. } else {
  912. this.approvalList = []
  913. }
  914. })
  915. },
  916. // 点击quotation行事件
  917. rowClickQuotation(row, column, event) {
  918. if (column.label !== '操作') {
  919. this.quotationHeader = row;
  920. }
  921. },
  922. clickProject() {
  923. if (!this.insertData.customerNo) {
  924. this.$message.warning("客户编码不存在")
  925. return
  926. }
  927. this.searchProjectData.projectId = this.insertData.projectId
  928. // setTimeout(()=>{
  929. // this.searchProjectData.projectId = ''
  930. // },200)
  931. this.chooseProjectListFlag = true
  932. },
  933. projectClickRow(row) {
  934. this.insertData.projectId = row.projectId
  935. this.insertData.projectName = row.projectName
  936. this.insertData.finalCustomerId = row.finalCustomerId
  937. this.insertData.finalCustomerName = row.finalCustomerName
  938. this.chooseProjectListFlag = false
  939. },
  940. // 查询
  941. initDataBtn() {
  942. this.$route.params.ids = null;
  943. this.initData();
  944. },
  945. // 初始化数据
  946. initData() {
  947. //如果是跳转过来的
  948. let value = localStorage.getItem('quotationData');
  949. if(value){
  950. let data=JSON.parse(value);
  951. this.searchData.quotationNo=data.quotationNo
  952. localStorage.removeItem('quotationData');
  953. }
  954. let params = {
  955. site: this.$store.state.user.site,
  956. ...this.searchData,
  957. ids: this.$route.params.ids,
  958. }
  959. getQuotationHeaderByPagePost(params,undefined,this.no,this.size).then(({data})=>{
  960. if (data && data.code === 0){
  961. this.tableData = data.rows;
  962. this.total = data.total;
  963. if (this.tableData.length > 0) {
  964. this.quotationHeader = this.tableData[0];
  965. } else {
  966. this.quotationHeader = {};
  967. }
  968. }else {
  969. this.$message.warning(data.msg)
  970. }
  971. }).catch((error)=>{
  972. this.$message.error(error)
  973. })
  974. // let ids = ""
  975. // if (this.$route.params.ids) {
  976. // ids = "?"
  977. // for (let i = 0; i < this.$route.params.ids.length; i++) {
  978. // ids += 'ids=' + this.$route.params.ids[i] + '&'
  979. // }
  980. // ids = ids.substring(0, ids.length - 1);
  981. // }
  982. // let params = {
  983. // no: this.no,
  984. // size: this.size,
  985. // site: this.$store.state.user.site,
  986. // customerNo: this.searchData.customerNo,
  987. // customerName: this.searchData.customerName,
  988. // trackerName: this.searchData.trackerName,
  989. // quotationNo: this.searchData.quotationNo,
  990. // customerInquiryNo: this.searchData.customerInquiryNo,
  991. // internalInquiryNo: this.searchData.internalInquiryNo,
  992. // quotationStatus: this.searchData.quotationStatus,
  993. // projectId: this.searchData.projectId,
  994. // projectName: this.searchData.projectName,
  995. // quoterName: this.searchData.quoterName,
  996. // startDate: this.searchData.startDate,
  997. // endDate: this.searchData.endDate,
  998. // }
  999. // this.init(params, ids)
  1000. },
  1001. init(params, ids) {
  1002. this.initQuotationHeaderLoading = true;
  1003. getQuotationHeaderByPage(params, ids).then(({data}) => {
  1004. this.tableData = data.data.records;
  1005. this.total = data.data.total;
  1006. if (this.tableData.length > 0) {
  1007. this.quotationHeader = this.tableData[0];
  1008. } else {
  1009. this.quotationHeader = null;
  1010. }
  1011. this.initQuotationHeaderLoading = false;
  1012. }).catch((error) => {
  1013. this.initQuotationHeaderLoading = false;
  1014. })
  1015. },
  1016. // 删除方法
  1017. deleteQuotationHeader(row) {
  1018. this.$confirm('确定删除该报价单吗?', '提示', {
  1019. confirmButtonText: '确定',
  1020. cancelButtonText: '取消',
  1021. type: 'warning'
  1022. }).then(() => {
  1023. deleteByQuotationHeaderId(row).then(({data}) => {
  1024. if (data.code === 200) {
  1025. this.$message.success(data.msg);
  1026. this.initData();
  1027. } else {
  1028. this.$message.error(data.msg);
  1029. }
  1030. })
  1031. })
  1032. },
  1033. // 修改方法
  1034. editQuotationHeader(row) {
  1035. this.insertData = JSON.parse(JSON.stringify(row));
  1036. this.insertData.internalInquiryBatchNo = this.insertData.internalInquiryNo.split("-")[0]
  1037. this.insertDiaLogFlag = true;
  1038. },
  1039. // size 发送改变
  1040. quotationHeaderSizeChange(val) {
  1041. this.size = val;
  1042. this.initData();
  1043. },
  1044. // no发生改变
  1045. quotationHeaderCurrentChange(val) {
  1046. this.no = val;
  1047. this.initData();
  1048. },
  1049. // 新增QuotationHeader
  1050. saveQuotationHeader() {
  1051. // 校验
  1052. this.$refs['insertQuotationForm'].validate((valid, objects) => {
  1053. if (valid) {
  1054. this.insertQuotationHeaderBtn = true;
  1055. // 请求
  1056. saveQuotationHeader(this.insertData).then(({data}) => {
  1057. // 返回提示
  1058. if (data.code === 200) {
  1059. this.initData();
  1060. this.insertQuotationHeaderBtn = false;
  1061. this.insertDiaLogFlag = false;
  1062. }
  1063. this.$message.success(data.msg);
  1064. })
  1065. } else {
  1066. this.rulesValidateLabel(objects, this.quotationHeaderColumns);
  1067. }
  1068. })
  1069. },
  1070. // 校验处理
  1071. rulesValidateLabel(objects, labels) {
  1072. for (let filed in objects) {
  1073. for (let i = 0; i < labels.length; i++) {
  1074. let quotationToolColumn = labels[i];
  1075. if (quotationToolColumn.label === filed) {
  1076. this.$message.warning(quotationToolColumn.value + "填写不正确");
  1077. return
  1078. }
  1079. }
  1080. }
  1081. },
  1082. // resetInsertData 重置新增对象
  1083. resetInsertData() {
  1084. this.insertData = {
  1085. site: this.$store.state.user.site,
  1086. quotationNo: "",//客户报价单号
  1087. quotationDate: new Date(),//报价日期
  1088. customerNo: "", // 客户编号
  1089. customerName: "",//客户名称
  1090. versionCode: "001",
  1091. projectId: "",//项目编码
  1092. projectName: "",//项目名称
  1093. tracker: "",//采购专员
  1094. quoter: "",//销售编号
  1095. quoterName: "",//报价专员
  1096. trackerName: "",//采购专员
  1097. currency: "",//货币
  1098. quotationStatus: "草稿",//状态
  1099. remark: "",//备注
  1100. customerInquiryNo: "",//客户询价单号
  1101. internalInquiryNo: "",//内部询价单号
  1102. requireApproval: "",//需要审批
  1103. approvalStatus: "",//审批状态
  1104. createBy: this.$store.state.user.id,//当前登录账号
  1105. createDate: new Date(),//当前时间
  1106. }
  1107. },
  1108. // 销售员输入框清除事件
  1109. clearQuoter() {
  1110. this.insertData.quoter = "";
  1111. this.insertData.quoterName = "";
  1112. },
  1113. // 采购专员输入框清除事件
  1114. clearTracker() {
  1115. this.insertData.tracker = "";
  1116. this.insertData.trackerName = "";
  1117. },
  1118. // 新增弹框关闭事件
  1119. closeInsertDialog() {
  1120. this.resetInsertData();
  1121. this.$refs['insertQuotationForm'].resetFields();
  1122. this.insertData = {
  1123. site: this.$store.state.user.site,
  1124. quotationNo: "",//客户报价单号
  1125. quotationDate: new Date(),//报价日期
  1126. customerNo: "", // 客户编号
  1127. customerName: "",//客户名称
  1128. versionCode: "001",
  1129. projectId: "",//项目编码
  1130. projectName: "",//项目名称
  1131. tracker: "",//采购专员
  1132. quoter: "",//销售编号
  1133. quoterName: "",//报价专员
  1134. trackerName: "",//采购专员
  1135. currency: "",//货币
  1136. quotationStatus: "草稿",//状态
  1137. remark: "",//备注
  1138. customerInquiryNo: "",//客户询价单号
  1139. internalInquiryNo: "",//内部询价单号
  1140. internalInquiryBatchNo: "",//内部询价单号
  1141. requireApproval: "",//需要审批
  1142. approvalStatus: "",//审批状态
  1143. createBy: this.$store.state.user.id,//当前登录账号
  1144. createTime: new Date(),//当前时间
  1145. }
  1146. },
  1147. // 点击标签页
  1148. handleClickTab(tab, event) {
  1149. },
  1150. // ======== chooseList相关方法 ========
  1151. /**
  1152. * 获取基础数据列表S
  1153. * @param val
  1154. * @param type
  1155. */
  1156. getBaseList(val, type) {
  1157. this.tagNo = val
  1158. this.tagNo1 = type
  1159. this.$nextTick(() => {
  1160. let strVal = ''
  1161. let conSql = ''
  1162. if (val === 102) {
  1163. if (type === 1) {
  1164. strVal = this.insertData.customerNo
  1165. }
  1166. }
  1167. if (val === 103) {
  1168. if (type === 1) {
  1169. strVal = this.insertData.tracker
  1170. }
  1171. if (type === 2) {
  1172. strVal = this.insertData.quoter
  1173. }
  1174. }
  1175. if (val === 104) {
  1176. if (type === 1) {
  1177. strVal = this.insertData.projectId
  1178. }
  1179. }
  1180. if (val === 2000) {
  1181. strVal = this.insertData.tracker
  1182. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  1183. }
  1184. if (val === 2002) {
  1185. strVal = this.insertData.quoter
  1186. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  1187. }
  1188. this.$refs.baseList.init(val, strVal, conSql)
  1189. })
  1190. },
  1191. /**
  1192. * 列表方法的回调
  1193. * @param val
  1194. */
  1195. getBaseData(val) {
  1196. if (this.tagNo === 102) {
  1197. if (this.tagNo1 === 1) {
  1198. if (this.insertData.customerNo !== val.Customer_no) {
  1199. this.insertData.projectId = '';
  1200. this.insertData.projectName = '';
  1201. }
  1202. this.insertData.customerNo = val.Customer_no
  1203. this.insertData.customerName = val.Customer_desc
  1204. }
  1205. }
  1206. if (this.tagNo === 103) {
  1207. if (this.tagNo1 === 1) {
  1208. this.insertData.tracker = val.username
  1209. this.insertData.trackerName = val.user_display
  1210. }
  1211. if (this.tagNo1 === 2) {
  1212. this.insertData.quoter = val.username
  1213. this.insertData.quoterName = val.user_display
  1214. }
  1215. }
  1216. if (this.tagNo === 104) {
  1217. if (this.tagNo1 === 1) {
  1218. this.insertData.projectId = val.project_id
  1219. this.insertData.projectName = val.project_name
  1220. }
  1221. }
  1222. if (this.tagNo === 2002) {
  1223. this.insertData.quoter = val.username
  1224. this.insertData.quoterName = val.user_display
  1225. }
  1226. if (this.tagNo === 2000) {
  1227. this.insertData.tracker = val.username
  1228. this.insertData.trackerName = val.user_display
  1229. }
  1230. },
  1231. // 查询 内部报价单编号
  1232. searchQuotationData() {
  1233. searchQuotationByQuotationNo(this.quotationNoSearchData).then(({data}) => {
  1234. if (data && data.code === 0){
  1235. this.quotationNoData = data.data;
  1236. }
  1237. })
  1238. },
  1239. // 打开 内部报价单拟态框
  1240. openQuotationNoDialog() {
  1241. // 请求
  1242. this.searchQuotationData();
  1243. },
  1244. // 关闭
  1245. closeQuotationNoDialog() {
  1246. this.quotationNoSearchData = {
  1247. quotationNo: "",//单号
  1248. quotationBatchNo: "",//批次号
  1249. quotationItemNo: '',//序号
  1250. quotationStatus: '',
  1251. partName:'',//物料描述
  1252. testPartNo:'',//物料编码
  1253. site: this.$store.state.user.site,//工厂编号
  1254. }
  1255. },
  1256. // 询价表双击事件
  1257. dblclickQuotationNo(row) {
  1258. this.insertData.customerNo = row.customerNo;
  1259. this.insertData.customerName = row.customerDesc;//客户名称
  1260. this.insertData.projectId = row.projectId;//项目编码
  1261. this.insertData.projectName = row.projectName;//项目名称
  1262. this.insertData.finalCustomerId = row.finalCustomerId;
  1263. this.insertData.finalCustomerName = row.finalCustomerName;
  1264. this.insertData.tracker = row.tracker;//采购专员
  1265. this.insertData.trackerName = row.trackerName;
  1266. this.insertData.quoter = row.quoter;//销售编号
  1267. this.insertData.quoterName = row.quoterName;//销售编号
  1268. this.insertData.internalInquiryNo = row.quotationNo;//内部询价单号
  1269. this.insertData.internalInquiryBatchNo = row.quotationBatchNo;//内部询价单号
  1270. this.insertData.currency = row.customerCurrency;//内部询价单号
  1271. // 关闭弹框
  1272. this.quotationNoDialogFlag = false;
  1273. },
  1274. quotationAgain(row) {
  1275. quotationAgain(row).then(({data}) => {
  1276. if (data && data.code === 0) {
  1277. this.$message.success(data.msg)
  1278. this.initData();
  1279. } else {
  1280. this.$alert(data.msg, '错误', {
  1281. confirmButtonText: '确定'
  1282. })
  1283. }
  1284. }).catch((error) => {
  1285. this.$message.error(error)
  1286. })
  1287. },
  1288. closeProjectInfoDialog() {
  1289. this.$refs.closeProjectInfoForm.resetFields();
  1290. this.searchProjectData = {
  1291. site: this.$store.state.user.site,
  1292. projectId: undefined,
  1293. projectName: undefined,
  1294. customerId: undefined,
  1295. }
  1296. },
  1297. searchProjectInfoList() {
  1298. this.projectList = [];
  1299. this.searchProjectData.customerId = this.insertData.customerNo
  1300. searchProjectInfoList(this.searchProjectData).then(({data}) => {
  1301. if (data && data.code === 0) {
  1302. this.projectList = data.rows
  1303. } else {
  1304. this.projectList = []
  1305. }
  1306. }).catch((error) => {
  1307. this.$message.error('查询项目信息失败')
  1308. })
  1309. },
  1310. handleUpdateStatus(row, status) {
  1311. this.$confirm(`是否确认${status?'取消下达':'下达'}?`, '提示', {
  1312. confirmButtonText: '确定',
  1313. cancelButtonText: '取消',
  1314. type: 'warning'
  1315. }).then(()=>{
  1316. let params = {
  1317. ...row,
  1318. quotationStatus:status?'草稿':'下达',
  1319. }
  1320. updateQuoteStatus(params).then(({data})=>{
  1321. if (data && data.code === 0){
  1322. this.$message.success(data.msg)
  1323. this.initData()
  1324. }else {
  1325. this.$message.warning(data.msg)
  1326. }
  1327. }).catch((error)=>{
  1328. this.$message.error(error)
  1329. })
  1330. })
  1331. },
  1332. restQuoteHeader() {
  1333. this.insertData = {
  1334. site: this.$store.state.user.site,
  1335. quotationNo: "",//客户报价单号
  1336. quotationDate: new Date(),//报价日期
  1337. customerNo: "", // 客户编号
  1338. customerName: "",//客户名称
  1339. versionCode: "001",
  1340. projectId: "",//项目编码
  1341. projectName: "",//项目名称
  1342. tracker: "",//采购专员
  1343. quoter: "",//销售编号
  1344. quoterName: "",//报价专员
  1345. trackerName: "",//采购专员
  1346. currency: "",//货币
  1347. quotationStatus: "草稿",//状态
  1348. remark: "",//备注
  1349. customerInquiryNo: "",//客户询价单号
  1350. internalInquiryNo: "",//内部询价单号
  1351. internalInquiryBatchNo: "",//内部询价单号
  1352. requireApproval: "",//需要审批
  1353. approvalStatus: "",//审批状态
  1354. createBy: this.$store.state.user.id,//当前登录账号
  1355. createTime: new Date(),//当前时间
  1356. }
  1357. },
  1358. clearCustomer() {
  1359. this.insertData.projectId = '';
  1360. this.insertData.projectName = '';
  1361. },
  1362. quotationHeaderRowStyle({row}) {
  1363. if (!this.quotationHeader){
  1364. return {}
  1365. }
  1366. if (row.quotationHeaderId === this.quotationHeader.quotationHeaderId) {
  1367. return {'background-color': '#E8F7F6'}
  1368. }
  1369. },
  1370. clickInternalInquiryNoHandle(){
  1371. this.quotationNoSearchData.quotationNo = this.insertData.internalInquiryNo;
  1372. // setTimeout(()=>{
  1373. // this.quotationNoSearchData.quotationNo = ''
  1374. // },200)
  1375. this.quotationNoDialogFlag = true
  1376. },
  1377. blurInternalInquiryNoHandle(){
  1378. let params = {
  1379. quotationNo:this.insertData.internalInquiryNo,
  1380. site:this.$store.state.user.site
  1381. }
  1382. searchQuotationByQuotationNo(params).then(({data}) => {
  1383. if (data && data.code === 0){
  1384. // this.quotationNoData = data.data;
  1385. let rows = data.data
  1386. if (rows.length === 1){
  1387. this.dblclickQuotationNo(rows[0])
  1388. }
  1389. }
  1390. })
  1391. },
  1392. routerWatch(){
  1393. if (this.$route.params && this.$route.params.from && this.$route.params.from === 'inquiry'){
  1394. let params = {
  1395. quotationHeaderId:this.$route.params.quotationHeaderId,
  1396. no:1,
  1397. size:this.size,
  1398. }
  1399. getQuotePage(params).then(({data})=>{
  1400. if (data && data.code === 0){
  1401. this.tableData = data.rows;
  1402. this.total = data.total;
  1403. if (this.tableData.length > 0) {
  1404. this.quotationHeader = this.tableData[0];
  1405. } else {
  1406. this.quotationHeader = null;
  1407. }
  1408. }else {
  1409. this.$message.warning(data.msg)
  1410. }
  1411. }).catch((error)=>{
  1412. this.$message.error(error)
  1413. })
  1414. }else if (this.$route.params.quotationNo || this.$route.params.version) {
  1415. let params = {
  1416. quotationNo: this.$route.params.quotationNo,
  1417. versionCode: this.$route.params.version,
  1418. site: this.$store.state.user.site,
  1419. }
  1420. getQuotationHeaderByPagePost(params,undefined,this.no,this.size).then(({data})=>{
  1421. if (data && data.code === 0){
  1422. this.tableData = data.rows;
  1423. this.total = data.total;
  1424. if (this.tableData.length > 0) {
  1425. this.quotationHeader = this.tableData[0];
  1426. } else {
  1427. this.quotationHeader = null;
  1428. }
  1429. }else {
  1430. this.$message.warning(data.msg)
  1431. }
  1432. }).catch((error)=>{
  1433. this.$message.error(error)
  1434. })
  1435. }else if (this.$route.params && this.$route.params.ids && this.$route.params.ids.length > 0){
  1436. let params = {
  1437. site : this.$store.state.user.site,
  1438. }
  1439. getQuotationHeaderByPagePost(params,this.$route.params.ids,this.no,this.size).then(({data})=>{
  1440. if (data && data.code === 0){
  1441. this.tableData = data.rows;
  1442. this.total = data.total;
  1443. if (this.tableData.length > 0) {
  1444. this.quotationHeader = this.tableData[0];
  1445. } else {
  1446. this.quotationHeader = null;
  1447. }
  1448. }else {
  1449. this.$message.warning(data.msg)
  1450. }
  1451. }).catch((error)=>{
  1452. this.$message.error(error)
  1453. })
  1454. }else if (this.initPage === false){
  1455. this.initData();//初始化数据
  1456. }
  1457. this.initPage = true;
  1458. },
  1459. handleQueryCustomer(){
  1460. let params = {
  1461. site:this.$store.state.user.site,
  1462. customerNo:this.insertData.customerNo
  1463. }
  1464. queryCustomer(params).then(({data})=>{
  1465. if (data && data.code === 0 ) {
  1466. if (data.rows && data.rows.length === 1){
  1467. this.insertData.customerName = data.rows[0].customerDesc
  1468. }else {
  1469. this.insertData.customerName = ''
  1470. }
  1471. }else {
  1472. this.$message.warning(data.msg)
  1473. }
  1474. }).catch((error)=>{
  1475. this.$message.error(error)
  1476. })
  1477. },
  1478. handleQueryProjectByCustomer(){
  1479. let params = {
  1480. site:this.$store.state.user.site,
  1481. customerId:this.insertData.customerNo,
  1482. projectId:this.insertData.projectId
  1483. }
  1484. queryProjectByCustomer(params).then(({data})=>{
  1485. if (data && data.code === 0 ){
  1486. if (data.rows && data.rows.length === 1){
  1487. this.insertData.projectName = data.rows[0].projectName
  1488. this.insertData.finalCustomerId = data.rows[0].finalCustomerId
  1489. this.insertData.finalCustomerName = data.rows[0].finalCustomerName
  1490. }else {
  1491. this.insertData.projectName = ''
  1492. this.insertData.finalCustomerId = ''
  1493. this.insertData.finalCustomerName = ''
  1494. }
  1495. }else {
  1496. this.$message.warning(data.msg)
  1497. }
  1498. }).catch((error)=>{
  1499. this.$message.error(error)
  1500. })
  1501. },
  1502. handleDetail(row){
  1503. this.insertData = {
  1504. ...row,
  1505. };
  1506. this.insertData.internalInquiryBatchNo = this.insertData.internalInquiryNo.split("-")[0]
  1507. this.detailDialogVisible = true;
  1508. this.insertDiaLogFlag = true;
  1509. },
  1510. getPriceCheckProperties() {
  1511. if (!this.quotationHeader && !this.quotationHeader.internalInquiryNo){
  1512. this.priceCheckPropertiesList = []
  1513. return
  1514. }
  1515. let params = {
  1516. site: this.quotationHeader.site,
  1517. quotationNo: this.quotationHeader.internalInquiryNo
  1518. }
  1519. getPriceCheckPropertiesList(params).then(({data}) => {
  1520. if (data && data.code === 0) {
  1521. this.priceCheckPropertiesList = data.rows
  1522. } else {
  1523. this.$message.warning(data.msg)
  1524. }
  1525. }).catch((error) => {
  1526. this.$message.error(error)
  1527. })
  1528. },
  1529. handleRouter(internalInquiryNo){
  1530. if (this.$router.resolve('quotation-requestForQuote').resolved.name === '404') {
  1531. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
  1532. } else {
  1533. this.$router.push({
  1534. name: 'quotation-requestForQuote',
  1535. params:{
  1536. quotationNo:internalInquiryNo,
  1537. }
  1538. })
  1539. }
  1540. },
  1541. clearInsertData(field){
  1542. this.insertData[field] = ''
  1543. },
  1544. },
  1545. computed: {},
  1546. watch: {
  1547. "insertData.customerNo": {
  1548. handler() {
  1549. if (!this.insertData.customerNo || this.insertData.customerNo.length === 0) {
  1550. this.insertData.customerName = '';
  1551. this.insertData.projectId = '';
  1552. }
  1553. }
  1554. },
  1555. "insertData.projectId": {
  1556. handler() {
  1557. if (!this.insertData.projectId || this.insertData.projectId.length === 0) {
  1558. this.insertData.projectName = '';
  1559. }
  1560. }
  1561. },
  1562. insertDiaLogFlag(newVal,oldVal){
  1563. if (newVal === false){
  1564. this.detailDialogVisible = false;
  1565. }
  1566. },
  1567. quotationHeader(newVal,oldVal){
  1568. if (newVal){
  1569. this.getApprovalList()
  1570. this.getPriceCheckProperties();
  1571. }
  1572. },
  1573. "searchData.customerNo"(newVal,oldVal){
  1574. this.searchData.customerNo = newVal.toUpperCase()
  1575. },
  1576. "searchData.quotationNo"(newVal,oldVal){
  1577. this.searchData.quotationNo = newVal.toUpperCase()
  1578. },
  1579. "searchData.internalInquiryNo"(newVal,oldVal){
  1580. this.searchData.internalInquiryNo = newVal.toUpperCase()
  1581. },
  1582. "searchData.projectId"(newVal,oldVal){
  1583. this.searchData.projectId = newVal.toUpperCase()
  1584. },
  1585. 'insertData.quoter'(newVal,oldVal){
  1586. if (!newVal){
  1587. this.insertData.quoterName = ''
  1588. }
  1589. },
  1590. 'insertData.tracker'(newVal,oldVal){
  1591. if (!newVal){
  1592. this.insertData.trackerName = ''
  1593. }
  1594. },
  1595. },
  1596. mounted() {
  1597. },
  1598. activated() {
  1599. this.routerWatch()
  1600. },
  1601. }
  1602. </script>
  1603. <style scoped>
  1604. /deep/ .el-range-editor--mini.el-input__inner {
  1605. height: 20px;
  1606. }
  1607. /deep/ .el-range-editor.el-input__inner {
  1608. padding: 0px 10px;
  1609. }
  1610. /deep/ .el-input--mini .el-input__icon {
  1611. line-height: 20px;
  1612. }
  1613. /deep/ .el-table__body tr.current-row > td {
  1614. background-color: #E8F7F6 !important;
  1615. color: #fff;
  1616. }
  1617. </style>