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.

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