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.

1619 lines
57 KiB

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