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.

2781 lines
94 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.bu" placeholder="请选择" clearable style="width: 120px">
  7. <el-option
  8. v-for = "i in userBuList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="询价单号">
  16. <el-input v-model="searchData.rfqNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item label="客户编码">
  19. <span style="cursor: pointer" slot="label" @click="getBaseList(509,2)"><a herf="#">客户编码</a></span>
  20. <el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'客户名称'">
  23. <el-input v-model="searchData.customerDesc" clearable style="width: 120px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'询价日期'">
  26. <el-date-picker
  27. style="width: 120px"
  28. v-model="searchData.requestStartDate"
  29. type="date"
  30. value-format="yyyy-MM-dd"
  31. placeholder="选择日期">
  32. </el-date-picker>
  33. </el-form-item>
  34. <el-form-item label=" ">
  35. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  36. </el-form-item>
  37. <el-form-item :label="' '">
  38. <el-date-picker
  39. style="width: 120px"
  40. v-model="searchData.requestEndDate"
  41. type="date"
  42. value-format="yyyy-MM-dd"
  43. placeholder="选择日期">
  44. </el-date-picker>
  45. </el-form-item>
  46. </el-form>
  47. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  48. <el-form-item :label="'优先等级'">
  49. <dict-data-select v-model="searchData.priorityLevel" clearable style="width: 120px" :use-default-value="false"
  50. dict-type="inquiry_info_priority_level"/>
  51. </el-form-item>
  52. <el-form-item :label="'状态'">
  53. <el-select v-model="searchData.status" style="width: 120px">
  54. <el-option label="全部" value=""></el-option>
  55. <el-option label="草稿" value="C"></el-option>
  56. <el-option label="下达" value="B"></el-option>
  57. <el-option label="已转报价" value="A"></el-option>
  58. <el-option label="已驳回" value="D"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item :label="'PjM'">
  62. <span style="cursor: pointer" slot="label" @click="getBaseList(2008,1)"><a herf="#">PjM</a></span>
  63. <el-input v-model="searchData.requesterName" clearable style="width: 120px"></el-input>
  64. </el-form-item>
  65. <el-form-item :label="'报价专员'">
  66. <span style="cursor: pointer" slot="label" @click="getBaseList(2002,1)"><a herf="#">报价专员</a></span>
  67. <el-input v-model="searchData.quoterName" clearable style="width: 120px"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="'要求报价日期'">
  70. <el-date-picker
  71. style="width: 120px"
  72. v-model="searchData.requiredCompletionStartDate"
  73. type="date"
  74. value-format="yyyy-MM-dd"
  75. placeholder="选择日期">
  76. </el-date-picker>
  77. </el-form-item>
  78. <el-form-item label=" ">
  79. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  80. </el-form-item>
  81. <el-form-item :label="' '">
  82. <el-date-picker
  83. style="width: 120px"
  84. v-model="searchData.requiredCompletionEndDate"
  85. type="date"
  86. value-format="yyyy-MM-dd"
  87. placeholder="选择日期">
  88. </el-date-picker>
  89. </el-form-item>
  90. <el-form-item :label="' '">
  91. <el-button @click="getDataList()">查询</el-button>
  92. <el-button type="primary" @click="addModal()">新增</el-button>
  93. <el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>
  94. <download-excel
  95. :fields="fields()"
  96. :data="exportData"
  97. type="xls"
  98. :name="exportName"
  99. :header="exportHeader"
  100. :footer="exportFooter"
  101. :fetch="createExportData"
  102. :before-generate="startDownload"
  103. :before-finish="finishDownload"
  104. worksheet="导出信息"
  105. class="el-button el-button--primary el-button--medium">
  106. {{ "导出" }}
  107. </download-excel>
  108. </el-form-item>
  109. </el-form>
  110. <!-- 询价列表 -->
  111. <el-table
  112. @header-dragend="handleColumnResize"
  113. height="37vh"
  114. :data="dataList"
  115. border
  116. :row-style="rowStyle"
  117. ref="mainTable"
  118. @row-click="inquiryClickRow"
  119. @current-change="changeCurrentRow"
  120. v-loading="dataListLoading"
  121. style="width: 100%;margin-top: 5px">
  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. :align="item.align"
  128. :fixed="item.fixed === ''?false:item.fixed"
  129. :min-width="item.columnWidth"
  130. :label="item.columnLabel">
  131. <template slot-scope="scope">
  132. <div v-if="item.columnProp !== 'status' && item.columnProp !== 'priorityLevel'">
  133. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  134. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  135. style="width: 100px; height: 80px"/></span>
  136. </div>
  137. <div v-else-if="item.columnProp === 'status'">
  138. <span v-if="!item.columnHidden">
  139. <span v-if="scope.row.visible === 'N'">审批未通过</span>
  140. <span v-else-if="scope.row.status === 'C'">草稿</span>
  141. <span v-else-if="scope.row.status === 'B'">下达</span>
  142. <span v-else-if="scope.row.status === 'A'">已转报价</span>
  143. <span v-else-if="scope.row.status === 'D'">已驳回</span>
  144. </span>
  145. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  146. style="width: 100px; height: 80px"/></span>
  147. </div>
  148. <div v-else-if="item.columnProp === 'priorityLevel'">
  149. <span v-if="!item.columnHidden">
  150. <span v-if="scope.row.priorityLevel === 'A'">普通</span>
  151. <span v-if="scope.row.priorityLevel === ' B'">重要</span>
  152. <span v-if="scope.row.priorityLevel === ' C'">紧急</span>
  153. </span>
  154. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  155. style="width: 100px; height: 80px"/></span>
  156. </div>
  157. </template>
  158. </el-table-column>
  159. <el-table-column
  160. fixed="right"
  161. header-align="center"
  162. align="center"
  163. width="100"
  164. label="操作">
  165. <template slot-scope="scope">
  166. <!-- <el-link style="cursor: pointer" @click="addInquiryPartModal(scope.row)">新增产品</el-link>-->
  167. <el-link style="cursor: pointer" v-if="scope.row.status === 'C' || scope.row.visible === 'N'"
  168. @click="updateModalStatus(scope.row,'B')">下达
  169. </el-link>
  170. <el-link style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  171. <el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. <!-- 分页插件 -->
  176. <el-pagination style="margin-top: 0px"
  177. @size-change="sizeChangeHandle"
  178. @current-change="currentChangeHandle"
  179. :current-page="pageIndex"
  180. :page-sizes="[20, 50, 100, 200, 500]"
  181. :page-size="pageSize"
  182. :total="totalPage"
  183. layout="total, sizes, prev, pager, next, jumper">
  184. </el-pagination>
  185. <!-- 询价模态框 -->
  186. <el-dialog :title="modalData.title" v-drag @close="closeSaveDataDialog"
  187. :close-on-click-modal="false" top="10%" :visible.sync="modalFlag" width="568px">
  188. <!-- @open="openSaveDataDialog"-->
  189. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  190. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  191. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 110px">
  192. <el-option
  193. v-for = "i in userBuList"
  194. :key = "i.buNo"
  195. :label = "i.buDesc"
  196. :value = "i.buNo">
  197. </el-option>
  198. </el-select>
  199. </el-form-item>
  200. <el-form-item prop="customerNo" label="客户编码">
  201. <span style="cursor: pointer" slot="label" @click="getBaseList(509,1)"><a herf="#">客户编码</a></span>
  202. <el-input v-model="modalData.customerNo" @blur="customerNoBlur" style="width: 110px;"></el-input>
  203. <el-input disabled v-model="modalData.customerDesc" style="width: 300px;"></el-input>
  204. </el-form-item>
  205. </el-form>
  206. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  207. <el-form-item label="询价日期" prop="requestDate" :rules="rules.requestDate">
  208. <el-date-picker
  209. v-model="modalData.requestDate"
  210. type="date"
  211. placeholder="选择日期"
  212. value-format="yyyy-MM-dd"
  213. style="width: 110px;">
  214. </el-date-picker>
  215. </el-form-item>
  216. <el-form-item prop="requesterName" label="PjM">
  217. <span style="cursor: pointer" slot="label" @click="getBaseList(2008,2)"><a herf="#">PjM</a></span>
  218. <el-input v-model="modalData.requester" @blur="requesterBlur(2008)" style="width: 110px;"></el-input>
  219. <el-input disabled v-model="modalData.requesterName" style="width: 120px;"></el-input>
  220. </el-form-item>
  221. <el-form-item label="客户询价单号" prop="customerInquiryNo">
  222. <el-input v-model="modalData.customerInquiryNo" style="width: 166px;"></el-input>
  223. </el-form-item>
  224. </el-form>
  225. <!-- <el-col :span="4">-->
  226. <!-- <el-form-item prop="trackerName">-->
  227. <!-- <span v-if="quotationInformationFlag('tracker') === 'N' && modalData.flag === '2'" slot="label">采购专员</span>-->
  228. <!-- <span v-else style="cursor: pointer" slot="label" @click="getBaseList(2000)"><a herf="#">采购专员</a></span>-->
  229. <!-- <el-input :disabled="quotationInformationFlag('tracker') === 'N' && modalData.flag === '2'" v-model="modalData.trackerName" readonly></el-input>-->
  230. <!-- </el-form-item>-->
  231. <!-- </el-col>-->
  232. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  233. <el-form-item label="要求报价日期" prop="requiredCompletionDate" :rules="rules.requiredCompletionDate">
  234. <el-date-picker
  235. v-model="modalData.requiredCompletionDate"
  236. type="date"
  237. placeholder="选择日期"
  238. value-format="yyyy-MM-dd"
  239. style="width: 110px;">
  240. </el-date-picker>
  241. </el-form-item>
  242. <el-form-item prop="quoterName" label="报价专员">
  243. <span style="cursor: pointer" slot="label" @click="getBaseList(2002,2)"><a herf="#">报价专员</a></span>
  244. <el-input v-model="modalData.quoter" @blur="quoterBlur(2002)" style="width: 110px;"></el-input>
  245. <el-input disabled v-model="modalData.quoterName" style="width: 120px;"></el-input>
  246. </el-form-item>
  247. <el-form-item label="优先等级" >
  248. <dict-data-select v-if="modalFlag"
  249. v-model="modalData.priorityLevel" dict-type="inquiry_info_priority_level"
  250. style="width: 166px;">
  251. </dict-data-select>
  252. </el-form-item>
  253. </el-form>
  254. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  255. <el-form-item label="备注" style="display: block;min-height: 90px">
  256. <el-input type="textarea" :autosize="{minRows: 2, maxRows: 3}" resize='none'
  257. v-model="modalData.remark"></el-input>
  258. </el-form-item>
  259. </el-form>
  260. <el-footer style="height:35px;margin-top: -10px;padding-bottom:5px;text-align:center">
  261. <el-button type="primary" @click="saveData()">保存</el-button>
  262. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  263. </el-footer>
  264. </el-dialog>
  265. <!-- 页签 -->
  266. <el-tabs style="margin-top: 0px; width: 100%; height: 40vh;" v-model="activeTable" class="customer-tab" type="border-card" @tab-click="tabClick">
  267. <!-- 询价详细信息页签 -->
  268. <el-tab-pane label="产品明细" name="inquiryPart">
  269. <!-- 询价产品明细列表 -->
  270. <el-table
  271. @header-dragend="handleColumnResize"
  272. height="37vh"
  273. :data="inquiryPartDataList"
  274. border
  275. ref="secondaryTable"
  276. v-loading="dataListLoading"
  277. style="width: 100%;margin-top: 5px">
  278. <el-table-column
  279. v-for="(item,index) in inquiryPartColumnList" :key="index"
  280. :sortable="item.columnSortable"
  281. :prop="item.columnProp"
  282. :header-align="item.headerAlign"
  283. :align="item.align"
  284. :fixed="item.fixed === ''?false:item.fixed"
  285. :min-width="item.columnWidth"
  286. :label="item.columnLabel">
  287. <template slot-scope="scope">
  288. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  289. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  290. style="width: 100px; height: 80px"/></span>
  291. </template>
  292. </el-table-column>
  293. <el-table-column
  294. fixed="right"
  295. header-align="center"
  296. align="center"
  297. width="120"
  298. label="操作">
  299. <template slot-scope="scope">
  300. <el-link style="cursor: pointer" @click="updateInquiryPartModal(scope.row)">编辑</el-link>
  301. <el-link style="cursor: pointer" @click="delInquiryPartModal(scope.row)">删除</el-link>
  302. <el-link style="cursor: pointer" @click="inquiryPartItemModal(scope.row)">属性</el-link>
  303. <el-link style="cursor: pointer" @click.native="navigateToMes(scope.row.id)">详情</el-link>
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </el-tab-pane>
  308. <!-- 询价明细 相关文档 -->
  309. <el-tab-pane label="相关文档" name="inquiryDocument">
  310. <oss-components label="申请单号" style="margin-top: 5px" height="44vh" :columns="ossColumns" :order-ref1="inquiryCurrentRow.site" :order-ref2="inquiryCurrentRow.id"
  311. :rfq-no="inquiryCurrentRow.rfqNo">
  312. </oss-components>
  313. </el-tab-pane>
  314. </el-tabs>
  315. <el-dialog :title="inquiryPartModalData.title" v-drag @close="closeInquiryPartSaveDataDialog"
  316. :close-on-click-modal="false" top="10%" :visible.sync="inquiryPartModalFlag" width="422px">
  317. <!-- @open="openInquiryPartSaveDataDialog"-->
  318. <el-form :inline="true" label-position="top" :model="inquiryPartModalData" :rules="inquiryPartRules" style="margin-top: -5px;">
  319. <!-- <el-form-item prop="partNo" label="产品编码">-->
  320. <!-- <el-input v-model="inquiryPartModalData.partNo" disabled style="width: 128px;"></el-input>-->
  321. <!-- </el-form-item>-->
  322. <el-form-item prop="partDesc" label="产品名称">
  323. <el-input v-model="inquiryPartModalData.partDesc" style="width: 128px"></el-input>
  324. </el-form-item>
  325. <el-form-item label="BU" prop="bu" :rules="inquiryPartRules.bu">
  326. <el-select v-model="inquiryPartModalData.bu" placeholder="请选择" :disabled="inquiryPartModalDisableFlag" style="width: 118px">
  327. <el-option
  328. v-for = "i in userBuList"
  329. :key = "i.buNo"
  330. :label = "i.buDesc"
  331. :value = "i.buNo">
  332. </el-option>
  333. </el-select>
  334. </el-form-item>
  335. <el-form-item label="询价数量" prop="inquiryQty" :rules="inquiryPartRules.inquiryQty">
  336. <el-input-number :controls="false" :step="0" v-model="inquiryPartModalData.inquiryQty" style="width: 118px;"></el-input-number>
  337. </el-form-item>
  338. </el-form>
  339. <el-form :inline="true" label-position="top" :model="inquiryPartModalData" :rules="inquiryPartRules" style="margin-top: -5px;">
  340. <el-form-item prop="umId">
  341. <span style="cursor: pointer" slot="label" @click="getBaseList(510)"><a herf="#">计量单位</a></span>
  342. <el-input v-model="inquiryPartModalData.umId" @blur="umIdBlur(510)" style="width: 128px"></el-input>
  343. <el-input v-model="inquiryPartModalData.umName" disabled style="width: 260px"></el-input>
  344. </el-form-item>
  345. </el-form>
  346. <el-form :inline="true" label-position="top" :model="inquiryPartModalData" :rules="inquiryPartRules" style="margin-top: -5px;">
  347. <el-form-item prop="codeNo" :rules="rules.codeNo">
  348. <span style="cursor: pointer" slot="label" @click="getBaseList(220)"><a herf="#">属性模板</a></span>
  349. <el-input v-model="inquiryPartModalData.codeNo" @blur="modelBlur(220)" style="width: 128px"></el-input>
  350. <el-input v-model="inquiryPartModalData.codeDesc" disabled style="width: 260px"></el-input>
  351. </el-form-item>
  352. <el-form-item label="备注" style="display: block;min-height: 90px">
  353. <el-input type="textarea" :autosize="{minRows: 2, maxRows: 3}" resize='none'
  354. v-model="inquiryPartModalData.remark"></el-input>
  355. </el-form-item>
  356. </el-form>
  357. <el-footer style="height:35px;margin-top: -10px;padding-bottom:5px;text-align:center">
  358. <el-button type="primary" @click="saveInquiryPartData()">保存</el-button>
  359. <el-button type="primary" @click="inquiryPartModalFlag = false">关闭</el-button>
  360. </el-footer>
  361. </el-dialog>
  362. <el-dialog title="询价产品属性维护" v-drag :visible.sync="inquiryPartItemModalFlag" :close-on-click-modal="false"
  363. width="690px" style="height: 100%;margin-top: -60px" class="customer-dialog">
  364. <el-container style="height: 100%;">
  365. <el-form :inline="true" label-position="top" label-width="80px">
  366. <!-- 第一行 -->
  367. <el-row class="customer-row">
  368. <el-col :span="8">
  369. <el-form-item label="BU">
  370. <el-input v-model="this.inquiryPartItemModalData.buDesc" disabled></el-input>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="8">
  374. <el-form-item label="询价单号">
  375. <el-input v-model="this.inquiryPartItemModalData.rfqNo" disabled></el-input>
  376. </el-form-item>
  377. </el-col>
  378. <el-col :span="8">
  379. <el-form-item label="产品编码">
  380. <el-input v-model="this.inquiryPartItemModalData.partNo" disabled></el-input>
  381. </el-form-item>
  382. </el-col>
  383. </el-row>
  384. <!--工具属性的使用记录-->
  385. <fieldset class="customer-fieldset" style="width: 650px;">
  386. <legend>属性维护</legend>
  387. <div style="margin-top: 5px">
  388. <el-button type="primary" :loading="loading" @click="clickInquiryPartItemSave">{{ attributeDialog?'编辑':'保存' }}</el-button>
  389. <!-- <el-button type="primary" @click="refreshPropertiesModal" v-if="attributeDialog">刷新属性模板</el-button>-->
  390. </div>
  391. <div class="rq ">
  392. <el-table
  393. @header-dragend="handleColumnResize"
  394. :height="height - 78"
  395. :data="inquiryPartItemDataList"
  396. border
  397. style="width: 100%;margin-top: 5px">
  398. <el-table-column
  399. v-for="(item,index) in inquiryPartItemColumnList" :key="index"
  400. :sortable="item.columnSortable"
  401. :prop="item.columnProp"
  402. :header-align="item.headerAlign"
  403. :show-overflow-tooltip="item.showOverflowTooltip"
  404. :align="item.align"
  405. :fixed="item.fixed===''?false:item.fixed"
  406. :min-width="item.columnWidth"
  407. :label="item.columnLabel">
  408. <template slot-scope="scope">
  409. <div v-if="attributeDialog">
  410. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  411. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  412. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  413. </div>
  414. <div v-else>
  415. {{scope.row.valueTypeDb==='T'?scope.row.textValue:scope.row.numValue}}
  416. </div>
  417. </div>
  418. <div v-else>
  419. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  420. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  421. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  422. </div>
  423. <div v-else>
  424. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  425. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"></el-input-number>
  426. <el-input v-model="scope.row.textValue" v-else></el-input>
  427. </div>
  428. <div v-else>
  429. <el-select style="width: 100%;" v-if="scope.row.valueType === '文本'" v-model="scope.row.textValue">
  430. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  431. </el-select>
  432. <el-select style="width: 100%;" v-else v-model="scope.row.numValue">
  433. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  434. </el-select>
  435. </div>
  436. </div>
  437. </div>
  438. </template>
  439. </el-table-column>
  440. </el-table>
  441. </div>
  442. </fieldset>
  443. </el-form>
  444. </el-container>
  445. <el-footer style="height:30px;margin-top: 10px;padding-bottom:5px;text-align:center">
  446. <!-- <el-button type="primary" @click="saveInquiryPartData()">保存</el-button>-->
  447. <el-button type="primary" @click="inquiryPartItemModalFlag = false">关闭</el-button>
  448. </el-footer>
  449. </el-dialog>
  450. <!-- chooseList模态框 -->
  451. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  452. <!-- 导入 -->
  453. <quotationUpload ref="quotationUpload" @refreshPageTables="getDataList()" v-drag></quotationUpload>
  454. </div>
  455. </template>
  456. <script>
  457. import Chooselist from '@/views/modules/common/Chooselist_eam'
  458. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  459. import {searchInquiryApplicationInfo,addInquiryApplicationInfo,updateInquiryApplicationInfo,deleteInquiryApplicationInfo} from "@/api/inquiry/inquiryApplication";
  460. import {searchInquiryDetailInfo,addInquiryDetailInfo,updateInquiryDetailInfo,deleteInquiryDetailInfo} from "@/api/inquiry/inquiryDetail";
  461. import {getItemListByInquiryPartAndCodeNo,updateInquiryPartItemList} from "@/api/inquiry/inquiryDetail";
  462. import DictDataSelect from "../sys/dict-data-select.vue";
  463. import {queryCustomerList} from "@/api/customer/customer";
  464. import {verifyData} from "@/api/part/partInformation";
  465. import {EventBus} from "../../../main";
  466. import {partInformationSearch} from "../../../api/part/partInformation";
  467. import quotationUpload from "../quote/quotation_upload.vue";
  468. import OssComponents from "../oss/ossComponents.vue";
  469. import {getTableDefaultListLanguage, getTableUserListLanguage, updateColumnSize} from "../../../api/table";
  470. import {deleteQuotationFile, downLoadQuotationFile} from "../../../api/quote/quotationInformation";
  471. export default {
  472. computed: {
  473. // quotationInformationFlag () {
  474. // return (value) => {
  475. // if (!this.plmQuotationInformationArr){
  476. // return 'N'
  477. // }
  478. // let arr = this.plmQuotationInformationArr.filter(a => a.fieldId === value)
  479. // if (arr.length > 0) {
  480. // return arr[0].updateFlag
  481. // }
  482. // return 'N'
  483. // }
  484. // },
  485. },
  486. components: {
  487. OssComponents,
  488. quotationUpload,
  489. DictDataSelect,
  490. Chooselist
  491. },
  492. props:{
  493. height:{
  494. type:Number,
  495. default:200
  496. }
  497. },
  498. watch: {
  499. searchData: {
  500. deep: true,
  501. handler: function (newV, oldV) {
  502. if (this.searchData.customerNo !== '' || this.searchData.rfqNo !== ''){
  503. this.searchData.customerNo = this.searchData.customerNo.toUpperCase()
  504. this.searchData.rfqNo = this.searchData.rfqNo.toUpperCase()
  505. }
  506. }
  507. },
  508. modalData: {
  509. deep: true,
  510. handler: function (newV, oldV) {
  511. if (this.modalData.customerNo !== '' || this.modalData.rfqNo !== '') {
  512. this.modalData.customerNo = this.modalData.customerNo.toUpperCase()
  513. this.modalData.rfqNo = this.modalData.rfqNo.toUpperCase()
  514. }
  515. }
  516. },
  517. inquiryPartModalData: {
  518. deep: true,
  519. handler: function (newV, oldV) {
  520. if (this.inquiryPartModalData.partNo !== '' || this.inquiryPartModalData.codeNo !== '' || this.inquiryPartModalData.umId !== '') {
  521. this.inquiryPartModalData.partNo = this.inquiryPartModalData.partNo.toUpperCase()
  522. this.inquiryPartModalData.codeNo = this.inquiryPartModalData.codeNo.toUpperCase()
  523. this.inquiryPartModalData.umId = this.inquiryPartModalData.umId.toUpperCase()
  524. }
  525. }
  526. }
  527. },
  528. data() {
  529. return {
  530. userBuList: [],
  531. copyPriceCheckDetail:{},
  532. loading:false,
  533. attributeDialog:true,
  534. priceCheckRule: {
  535. associatedPartNo:[{required: true, message: ' ', trigger: 'change'},],
  536. materialRequired:[{required: true, message: ' ', trigger: 'change'},],
  537. yearlyOrMonthlyRequirement:[{required: true, message: ' ', trigger: 'change'},],
  538. runningWidth:[{required: true, message: ' ', trigger: 'change'},],
  539. },
  540. savePriceDetail:{
  541. site:'',
  542. quotationNo:'',
  543. associatedPartNo:'',
  544. materialRequired:'',
  545. yearlyOrMonthlyRequirement:'',
  546. runningWidth:'',
  547. },
  548. activeTab:'part',
  549. priceCheckPropertiesList: [],
  550. // 导出
  551. exportData: [],
  552. exportName: '询价申请' + this.dayjs().format('YYYYMMDDHHmmss'),
  553. exportHeader: ['询价申请'],
  554. exportFooter: [],
  555. resultList: [],
  556. uploadUrl: '/plm/quotationInformation/uploadExcel',
  557. // ======== 行高 ========
  558. secondHeight: 200,
  559. // ======== 分页 ========
  560. pageIndex: 1,
  561. pageSize: 50,
  562. totalPage: 0,
  563. selectedDataNum: 0,
  564. // 条件查询
  565. searchData: {
  566. site: this.$store.state.user.site,
  567. id: '',
  568. customerNo: '',
  569. customerDesc: '',
  570. rfqNo: '',
  571. bu: '',
  572. requestStartDate: '',
  573. requestEndDate: '',
  574. requiredCompletionStartDate: '',
  575. requiredCompletionEndDate: '',
  576. status: '',
  577. quoterName: '',
  578. requesterName: '',
  579. priorityLevel: '',
  580. page: 1,
  581. limit: 10,
  582. menuId: this.$route.meta.menuId,
  583. },
  584. // 其它
  585. dataListLoading: false,
  586. // 选择项目弹框开关
  587. chooseProjectListFlag: false,
  588. // 初始页签
  589. activeTable: 'inquiryPart',
  590. // ======== 数据对象 ========
  591. modalData: {
  592. flag: '',
  593. title: '',
  594. site: this.$store.state.user.site,
  595. userName: this.$store.state.user.name,
  596. id: '',
  597. rfqNo: '',
  598. customerNo: '',
  599. customerDesc: '',
  600. requestDate: '',
  601. requester: '',
  602. requesterName: '',
  603. customerInquiryNo: '',
  604. priorityLevel: '',
  605. requiredCompletionDate: '',
  606. quoter: '',
  607. quoterName: '',
  608. status: '',
  609. bomStatusDb: '',
  610. remark: '',
  611. createDate: '',
  612. createBy: '',
  613. updateDate: '',
  614. updateBy: '',
  615. },
  616. inquiryPartModalData: {
  617. flag: '',
  618. title: '',
  619. site: this.$store.state.user.site,
  620. userName: this.$store.state.user.name,
  621. id: '',
  622. rfqId: '',
  623. partNo: '',
  624. partDesc: '',
  625. inquiryQty: '',
  626. umId: '',
  627. umName: '',
  628. codeNo: '',
  629. codeDesc: '',
  630. remark: '',
  631. createDate: '',
  632. createBy: '',
  633. updateDate: '',
  634. updateBy: '',
  635. },
  636. inquiryPartItemModalData: {
  637. bu: '',
  638. buDesc: '',
  639. rfqNo: '',
  640. partNo: '',
  641. partDesc: '',
  642. umId: '',
  643. umName: '',
  644. codeNo: '',
  645. codeDesc: '',
  646. textValue: '',
  647. numValue: '',
  648. valueType: '',
  649. valueTypeDb: '',
  650. valueChooseFlag: '',
  651. availableValueList: [],
  652. },
  653. ossColumns:[
  654. {
  655. userId: this.$store.state.user.name,
  656. functionId: 103001,
  657. serialNumber: '103001Table2FileName',
  658. tableId: '103001Table2',
  659. tableName: '文件信息表',
  660. columnProp: 'fileName',
  661. headerAlign: 'center',
  662. align: 'center',
  663. columnLabel: '文件名称',
  664. columnHidden: false,
  665. columnImage: false,
  666. columnSortable: false,
  667. sortLv: 0,
  668. status: true,
  669. fixed: '',
  670. columnWidth: 140
  671. },
  672. {
  673. userId: this.$store.state.user.name,
  674. functionId: 103001,
  675. serialNumber: '103001Table2FileRemark',
  676. tableId: '103001Table2',
  677. tableName: '文件信息表',
  678. columnProp: 'fileRemark',
  679. headerAlign: 'center',
  680. align: 'center',
  681. columnLabel: '备注',
  682. columnHidden: false,
  683. columnImage: false,
  684. columnSortable: false,
  685. sortLv: 0,
  686. status: true,
  687. fixed: '',
  688. columnWidth: 240
  689. },
  690. // {
  691. // userId: this.$store.state.user.name,
  692. // functionId: 103001,
  693. // serialNumber: '103001Table2OrderRef3',
  694. // tableId: '103001Table2',
  695. // tableName: '文件信息表',
  696. // columnProp: 'orderRef3',
  697. // headerAlign: 'center',
  698. // align: 'center',
  699. // columnLabel: '文件描述',
  700. // columnHidden: false,
  701. // columnImage: false,
  702. // columnSortable: false,
  703. // sortLv: 0,
  704. // status: true,
  705. // fixed: '',
  706. // columnWidth: 120
  707. // },
  708. {
  709. userId: this.$store.state.user.name,
  710. functionId: 103001,
  711. serialNumber: '103001Table2CreateDate',
  712. tableId: '103001Table2',
  713. tableName: '文件信息表',
  714. columnProp: 'createDate',
  715. headerAlign: 'center',
  716. align: 'center',
  717. columnLabel: '上传时间',
  718. columnHidden: false,
  719. columnImage: false,
  720. columnSortable: false,
  721. sortLv: 0,
  722. status: true,
  723. fixed: '',
  724. columnWidth: 140
  725. },
  726. {
  727. userId: this.$store.state.user.name,
  728. functionId: 103001,
  729. serialNumber: '103001Table2CreatedBy',
  730. tableId: '103001Table2',
  731. tableName: '文件信息表',
  732. columnProp: 'createdBy',
  733. headerAlign: 'center',
  734. align: 'center',
  735. columnLabel: '上传人',
  736. columnHidden: false,
  737. columnImage: false,
  738. columnSortable: false,
  739. sortLv: 0,
  740. status: true,
  741. fixed: '',
  742. columnWidth: 140
  743. }
  744. ],
  745. // ======== 数据列表 ========
  746. dataList: [],
  747. inquiryPartDataList: [],
  748. inquiryPartItemDataList: [],
  749. // ======== 列表表头 ========
  750. columnList: [
  751. {
  752. userId: this.$store.state.user.name,
  753. functionId: 5022,
  754. serialNumber: '5022Table1BuDesc',
  755. tableId: '5022Table1',
  756. tableName: '询价信息表',
  757. columnProp: 'buDesc',
  758. headerAlign: 'center',
  759. align: 'center',
  760. columnLabel: 'BU',
  761. columnHidden: false,
  762. columnImage: false,
  763. columnSortable: false,
  764. sortLv: 0,
  765. status: true,
  766. fixed: '',
  767. columnWidth: 80
  768. },
  769. {
  770. userId: this.$store.state.user.name,
  771. functionId: 5022,
  772. serialNumber: '5022Table1rfqNo',
  773. tableId: '5022Table1',
  774. tableName: '询价信息表',
  775. columnProp: 'rfqNo',
  776. headerAlign: 'center',
  777. align: 'center',
  778. columnLabel: '询价单号',
  779. columnHidden: false,
  780. columnImage: false,
  781. columnSortable: false,
  782. sortLv: 0,
  783. status: true,
  784. fixed: '',
  785. columnWidth: 120
  786. },
  787. {
  788. userId: this.$store.state.user.name,
  789. functionId: 5022,
  790. serialNumber: '5022Table1CustomerNo',
  791. tableId: '5022Table1',
  792. tableName: '询价信息表',
  793. columnProp: 'customerNo',
  794. headerAlign: 'center',
  795. align: 'center',
  796. columnLabel: '客户编码',
  797. columnHidden: false,
  798. columnImage: false,
  799. columnSortable: false,
  800. sortLv: 0,
  801. status: true,
  802. fixed: '',
  803. columnWidth: 100
  804. },
  805. {
  806. userId: this.$store.state.user.name,
  807. functionId: 5022,
  808. serialNumber: '5022Table1CustomerDesc',
  809. tableId: '5022Table1',
  810. tableName: '询价信息表',
  811. columnProp: 'customerDesc',
  812. headerAlign: 'center',
  813. align: 'center',
  814. columnLabel: '客户名称',
  815. columnHidden: false,
  816. columnImage: false,
  817. columnSortable: false,
  818. sortLv: 0,
  819. status: true,
  820. fixed: '',
  821. columnWidth: 120
  822. },
  823. {
  824. userId: this.$store.state.user.name,
  825. functionId: 5022,
  826. serialNumber: '5022Table1RequestDate',
  827. tableId: '5022Table1',
  828. tableName: '询价信息表',
  829. columnProp: 'requestDate',
  830. headerAlign: 'center',
  831. align: 'center',
  832. columnLabel: '询价日期',
  833. columnHidden: false,
  834. columnImage: false,
  835. columnSortable: false,
  836. sortLv: 0,
  837. status: true,
  838. fixed: '',
  839. columnWidth: 120
  840. },
  841. {
  842. userId: this.$store.state.user.name,
  843. functionId: 5022,
  844. serialNumber: '5022Table1RequesterName',
  845. tableId: '5022Table1',
  846. tableName: '询价信息表',
  847. columnProp: 'requesterName',
  848. headerAlign: 'center',
  849. align: 'center',
  850. columnLabel: 'PjM',
  851. columnHidden: false,
  852. columnImage: false,
  853. columnSortable: false,
  854. sortLv: 0,
  855. status: true,
  856. fixed: '',
  857. columnWidth: 80
  858. },
  859. {
  860. userId: this.$store.state.user.name,
  861. functionId: 5022,
  862. serialNumber: '5022Table1QuoterName',
  863. tableId: '5022Table1',
  864. tableName: '询价信息表',
  865. columnProp: 'quoterName',
  866. headerAlign: 'center',
  867. align: 'center',
  868. columnLabel: '报价专员',
  869. columnHidden: false,
  870. columnImage: false,
  871. columnSortable: false,
  872. sortLv: 0,
  873. status: true,
  874. fixed: '',
  875. columnWidth: 80
  876. },
  877. {
  878. userId: this.$store.state.user.name,
  879. functionId: 5022,
  880. serialNumber: '5022Table1RequiredCompletionDate',
  881. tableId: '5022Table1',
  882. tableName: '询价信息表',
  883. columnProp: 'requiredCompletionDate',
  884. headerAlign: 'center',
  885. align: 'center',
  886. columnLabel: '要求报价日期',
  887. columnHidden: false,
  888. columnImage: false,
  889. columnSortable: false,
  890. sortLv: 0,
  891. status: true,
  892. fixed: '',
  893. columnWidth: 120
  894. },
  895. {
  896. userId: this.$store.state.user.name,
  897. functionId: 5022,
  898. serialNumber: '5022Table1CustomerInquiryNo',
  899. tableId: '5022Table1',
  900. tableName: '询价信息表',
  901. columnProp: 'customerInquiryNo',
  902. headerAlign: 'center',
  903. align: 'center',
  904. columnLabel: '客户询价单号',
  905. columnHidden: false,
  906. columnImage: false,
  907. columnSortable: false,
  908. sortLv: 0,
  909. status: true,
  910. fixed: '',
  911. columnWidth: 120
  912. },
  913. {
  914. userId: this.$store.state.user.name,
  915. functionId: 5022,
  916. serialNumber: '5022Table1PriorityLevel',
  917. tableId: '5022Table1',
  918. tableName: '询价信息表',
  919. columnProp: 'priorityLevel',
  920. headerAlign: 'center',
  921. align: 'center',
  922. columnLabel: '优先等级',
  923. columnHidden: false,
  924. columnImage: false,
  925. columnSortable: false,
  926. sortLv: 0,
  927. status: true,
  928. fixed: '',
  929. columnWidth: 80
  930. },
  931. {
  932. userId: this.$store.state.user.name,
  933. functionId: 5022,
  934. serialNumber: '5022Table1Status',
  935. tableId: '5022Table1',
  936. tableName: '询价信息表',
  937. columnProp: 'status',
  938. headerAlign: 'center',
  939. align: 'center',
  940. columnLabel: '状态',
  941. columnHidden: false,
  942. columnImage: false,
  943. columnSortable: false,
  944. sortLv: 0,
  945. status: true,
  946. fixed: '',
  947. columnWidth: 100
  948. },
  949. {
  950. userId: this.$store.state.user.name,
  951. functionId: 5022,
  952. serialNumber: '5022Table1BomStatus',
  953. tableId: '5022Table1',
  954. tableName: '询价信息表',
  955. columnProp: 'bomStatus',
  956. headerAlign: 'center',
  957. align: 'center',
  958. columnLabel: 'BOM状态',
  959. columnHidden: false,
  960. columnImage: false,
  961. columnSortable: false,
  962. sortLv: 0,
  963. status: true,
  964. fixed: '',
  965. columnWidth: 100
  966. },
  967. {
  968. userId: this.$store.state.user.name,
  969. functionId: 5022,
  970. serialNumber: '5022Table1BomStatusDb',
  971. tableId: '5022Table1',
  972. tableName: '询价信息表',
  973. columnProp: 'bomStatusDb',
  974. headerAlign: 'center',
  975. align: 'center',
  976. columnLabel: '是否创建技术资料',
  977. columnHidden: false,
  978. columnImage: false,
  979. columnSortable: false,
  980. sortLv: 0,
  981. status: true,
  982. fixed: '',
  983. columnWidth: 110
  984. },
  985. {
  986. userId: this.$store.state.user.name,
  987. functionId: 5022,
  988. serialNumber: '5022Table1Status',
  989. tableId: '5022Table1',
  990. tableName: '询价信息表',
  991. columnProp: 'remark',
  992. headerAlign: 'center',
  993. align: 'center',
  994. columnLabel: '备注',
  995. columnHidden: false,
  996. columnImage: false,
  997. columnSortable: false,
  998. sortLv: 0,
  999. status: true,
  1000. fixed: '',
  1001. columnWidth: 120
  1002. },
  1003. {
  1004. userId: this.$store.state.user.name,
  1005. functionId: 5022,
  1006. serialNumber: '5022Table1CreateDate',
  1007. tableId: '5022Table1',
  1008. tableName: '询价信息表',
  1009. columnProp: 'createDate',
  1010. headerAlign: 'center',
  1011. align: 'center',
  1012. columnLabel: '创建时间',
  1013. columnHidden: false,
  1014. columnImage: false,
  1015. columnSortable: false,
  1016. sortLv: 0,
  1017. status: true,
  1018. fixed: '',
  1019. columnWidth: 160
  1020. },
  1021. {
  1022. userId: this.$store.state.user.name,
  1023. functionId: 5022,
  1024. serialNumber: '5022Table1CreateBy',
  1025. tableId: '5022Table1',
  1026. tableName: '询价信息表',
  1027. columnProp: 'createBy',
  1028. headerAlign: 'center',
  1029. align: 'center',
  1030. columnLabel: '创建人',
  1031. columnHidden: false,
  1032. columnImage: false,
  1033. columnSortable: false,
  1034. sortLv: 0,
  1035. status: true,
  1036. fixed: '',
  1037. columnWidth: 80
  1038. },
  1039. {
  1040. userId: this.$store.state.user.name,
  1041. functionId: 5022,
  1042. serialNumber: '5022Table1UpdateDate',
  1043. tableId: '5022Table1',
  1044. tableName: '询价信息表',
  1045. columnProp: 'updateDate',
  1046. headerAlign: 'center',
  1047. align: 'center',
  1048. columnLabel: '更新时间',
  1049. columnHidden: false,
  1050. columnImage: false,
  1051. columnSortable: false,
  1052. sortLv: 0,
  1053. status: true,
  1054. fixed: '',
  1055. columnWidth: 160
  1056. },
  1057. {
  1058. userId: this.$store.state.user.name,
  1059. functionId: 5022,
  1060. serialNumber: '5022Table1UpdateBy',
  1061. tableId: '5022Table1',
  1062. tableName: '询价信息表',
  1063. columnProp: 'updateBy',
  1064. headerAlign: 'center',
  1065. align: 'center',
  1066. columnLabel: '更新人',
  1067. columnHidden: false,
  1068. columnImage: false,
  1069. columnSortable: false,
  1070. sortLv: 0,
  1071. status: true,
  1072. fixed: '',
  1073. columnWidth: 80
  1074. }
  1075. ],
  1076. inquiryPartColumnList: [
  1077. {
  1078. userId: this.$store.state.user.name,
  1079. functionId: 5022,
  1080. serialNumber: '5022Table2BuDesc',
  1081. tableId: '5022Table2',
  1082. tableName: '询价产品表',
  1083. columnProp: 'buDesc',
  1084. headerAlign: 'center',
  1085. align: 'center',
  1086. columnLabel: 'BU',
  1087. columnHidden: false,
  1088. columnImage: false,
  1089. columnSortable: false,
  1090. sortLv: 0,
  1091. status: true,
  1092. fixed: '',
  1093. columnWidth: 80
  1094. },
  1095. {
  1096. userId: this.$store.state.user.name,
  1097. functionId: 5022,
  1098. serialNumber: '5022Table2PartNo',
  1099. tableId: '5022Table2',
  1100. tableName: '询价产品表',
  1101. columnProp: 'partNo',
  1102. headerAlign: 'center',
  1103. align: 'center',
  1104. columnLabel: '产品编码',
  1105. columnHidden: false,
  1106. columnImage: false,
  1107. columnSortable: false,
  1108. sortLv: 0,
  1109. status: true,
  1110. fixed: '',
  1111. columnWidth: 120
  1112. },
  1113. {
  1114. userId: this.$store.state.user.name,
  1115. functionId: 5022,
  1116. serialNumber: '5022Table2TestPartDesc',
  1117. tableId: '5022Table2',
  1118. tableName: '询价产品表',
  1119. columnProp: 'testPartDesc',
  1120. headerAlign: 'center',
  1121. align: 'left',
  1122. columnLabel: '产品描述',
  1123. columnHidden: false,
  1124. columnImage: false,
  1125. columnSortable: false,
  1126. sortLv: 0,
  1127. status: true,
  1128. fixed: '',
  1129. columnWidth: 150
  1130. },
  1131. {
  1132. userId: this.$store.state.user.name,
  1133. functionId: 5022,
  1134. serialNumber: '5022Table2InquiryQty',
  1135. tableId: '5022Table2',
  1136. tableName: '询价产品表',
  1137. columnProp: 'inquiryQty',
  1138. headerAlign: 'center',
  1139. align: 'right',
  1140. columnLabel: '询价数量',
  1141. columnHidden: false,
  1142. columnImage: false,
  1143. columnSortable: false,
  1144. sortLv: 0,
  1145. status: true,
  1146. fixed: '',
  1147. columnWidth: 100
  1148. },
  1149. {
  1150. userId: this.$store.state.user.name,
  1151. functionId: 5022,
  1152. serialNumber: '5022Table2Unit',
  1153. tableId: '5022Table2',
  1154. tableName: '询价产品表',
  1155. columnProp: 'umName',
  1156. headerAlign: 'center',
  1157. align: 'center',
  1158. columnLabel: '计量单位',
  1159. columnHidden: false,
  1160. columnImage: false,
  1161. columnSortable: false,
  1162. sortLv: 0,
  1163. status: true,
  1164. fixed: '',
  1165. columnWidth: 80
  1166. },
  1167. {
  1168. userId: this.$store.state.user.name,
  1169. functionId: 5022,
  1170. serialNumber: '5022Table2CodeNo',
  1171. tableId: '5022Table2',
  1172. tableName: '询价产品表',
  1173. columnProp: 'codeNo',
  1174. headerAlign: 'center',
  1175. align: 'center',
  1176. columnLabel: '属性模版',
  1177. columnHidden: false,
  1178. columnImage: false,
  1179. columnSortable: false,
  1180. sortLv: 0,
  1181. status: true,
  1182. fixed: '',
  1183. columnWidth: 100
  1184. },
  1185. {
  1186. userId: this.$store.state.user.name,
  1187. functionId: 5022,
  1188. serialNumber: '5022Table2PartBomStatus',
  1189. tableId: '5022Table2',
  1190. tableName: '询价产品表',
  1191. columnProp: 'partBomStatus',
  1192. headerAlign: 'center',
  1193. align: 'center',
  1194. columnLabel: '状态',
  1195. columnHidden: false,
  1196. columnImage: false,
  1197. columnSortable: false,
  1198. sortLv: 0,
  1199. status: true,
  1200. fixed: '',
  1201. columnWidth: 100
  1202. },
  1203. {
  1204. userId: this.$store.state.user.name,
  1205. functionId: 5022,
  1206. serialNumber: '5022Table2Remark',
  1207. tableId: '5022Table2',
  1208. tableName: '询价产品表',
  1209. columnProp: 'remark',
  1210. headerAlign: 'center',
  1211. align: 'left',
  1212. columnLabel: '备注',
  1213. columnHidden: false,
  1214. columnImage: false,
  1215. columnSortable: false,
  1216. sortLv: 0,
  1217. status: true,
  1218. fixed: '',
  1219. columnWidth: 160
  1220. },
  1221. {
  1222. userId: this.$store.state.user.name,
  1223. functionId: 5022,
  1224. serialNumber: '5022Table2CreateDate',
  1225. tableId: '5022Table2',
  1226. tableName: '询价产品表',
  1227. columnProp: 'createDate',
  1228. headerAlign: 'center',
  1229. align: 'center',
  1230. columnLabel: '创建时间',
  1231. columnHidden: false,
  1232. columnImage: false,
  1233. columnSortable: false,
  1234. sortLv: 0,
  1235. status: true,
  1236. fixed: '',
  1237. columnWidth: 160
  1238. },
  1239. {
  1240. userId: this.$store.state.user.name,
  1241. functionId: 5022,
  1242. serialNumber: '5022Table2CreateBy',
  1243. tableId: '5022Table2',
  1244. tableName: '询价产品表',
  1245. columnProp: 'createBy',
  1246. headerAlign: 'center',
  1247. align: 'center',
  1248. columnLabel: '创建人',
  1249. columnHidden: false,
  1250. columnImage: false,
  1251. columnSortable: false,
  1252. sortLv: 0,
  1253. status: true,
  1254. fixed: '',
  1255. columnWidth: 80
  1256. },
  1257. {
  1258. userId: this.$store.state.user.name,
  1259. functionId: 5022,
  1260. serialNumber: '5022Table2UpdateDate',
  1261. tableId: '5022Table2',
  1262. tableName: '询价产品表',
  1263. columnProp: 'updateDate',
  1264. headerAlign: 'center',
  1265. align: 'center',
  1266. columnLabel: '更新时间',
  1267. columnHidden: false,
  1268. columnImage: false,
  1269. columnSortable: false,
  1270. sortLv: 0,
  1271. status: true,
  1272. fixed: '',
  1273. columnWidth: 160
  1274. },
  1275. {
  1276. userId: this.$store.state.user.name,
  1277. functionId: 5022,
  1278. serialNumber: '5022Table2UpdateBy',
  1279. tableId: '5022Table2',
  1280. tableName: '询价产品表',
  1281. columnProp: 'updateBy',
  1282. headerAlign: 'center',
  1283. align: 'center',
  1284. columnLabel: '更新人',
  1285. columnHidden: false,
  1286. columnImage: false,
  1287. columnSortable: false,
  1288. sortLv: 0,
  1289. status: true,
  1290. fixed: '',
  1291. columnWidth: 80
  1292. }
  1293. ],
  1294. inquiryPartItemColumnList: [
  1295. {
  1296. userId: this.$store.state.user.name,
  1297. functionId: 100002001,
  1298. serialNumber: '100002001TableItemNo',
  1299. tableId: "100002001Table",
  1300. tableName: "属性表",
  1301. columnProp: 'itemNo',
  1302. headerAlign: "center",
  1303. align: "center",
  1304. columnLabel: '属性编码',
  1305. columnHidden: false,
  1306. columnImage: false,
  1307. columnSortable: false,
  1308. sortLv: 0,
  1309. status: true,
  1310. fixed: '',
  1311. },{
  1312. userId: this.$store.state.user.name,
  1313. functionId: 100002001,
  1314. serialNumber: '100002001TableItemDesc',
  1315. tableId: "100002001Table",
  1316. tableName: "属性表",
  1317. columnProp: 'itemDesc',
  1318. headerAlign: "center",
  1319. align: "center",
  1320. columnLabel: '属性名称',
  1321. columnHidden: false,
  1322. columnImage: false,
  1323. columnSortable: false,
  1324. sortLv: 0,
  1325. status: true,
  1326. fixed: '',
  1327. },
  1328. {
  1329. userId: this.$store.state.user.name,
  1330. functionId: 100002001,
  1331. serialNumber: '100002001TableValueType',
  1332. tableId: "100002001Table",
  1333. tableName: "属性表",
  1334. columnProp: 'valueType',
  1335. headerAlign: "center",
  1336. align: "center",
  1337. columnLabel: '值类型',
  1338. columnHidden: false,
  1339. columnImage: false,
  1340. columnSortable: false,
  1341. sortLv: 0,
  1342. status: true,
  1343. fixed: '',
  1344. columnWidth:80,
  1345. },
  1346. // {
  1347. // userId: this.$store.state.user.name,
  1348. // functionId: 100002001,
  1349. // serialNumber: '100002001TableMinValue',
  1350. // tableId: "100002001Table",
  1351. // tableName: "属性表",
  1352. // columnProp: 'minValue',
  1353. // headerAlign: "center",
  1354. // align: "center",
  1355. // columnLabel: '最小值',
  1356. // columnHidden: false,
  1357. // columnImage: false,
  1358. // columnSortable: false,
  1359. // sortLv: 0,
  1360. // status: true,
  1361. // fixed: '',
  1362. // columnWidth:80,
  1363. // },{
  1364. // userId: this.$store.state.user.name,
  1365. // functionId: 100002001,
  1366. // serialNumber: '100002001TableMaxValue',
  1367. // tableId: "100002001Table",
  1368. // tableName: "属性表",
  1369. // columnProp: 'maxValue',
  1370. // headerAlign: "center",
  1371. // align: "center",
  1372. // columnLabel: '最大值',
  1373. // columnHidden: false,
  1374. // columnImage: false,
  1375. // columnSortable: false,
  1376. // sortLv: 0,
  1377. // status: true,
  1378. // fixed: '',
  1379. // columnWidth:80,
  1380. // },
  1381. {
  1382. userId: this.$store.state.user.name,
  1383. functionId: 100002001,
  1384. serialNumber: '100002001TableMaxValue',
  1385. tableId: "100002001Table",
  1386. tableName: "属性表",
  1387. columnProp: 'textValue',
  1388. headerAlign: "center",
  1389. align: "center",
  1390. columnLabel: '属性值',
  1391. columnHidden: false,
  1392. columnImage: false,
  1393. columnSortable: false,
  1394. sortLv: 0,
  1395. status: true,
  1396. fixed: '',
  1397. columnWidth:120,
  1398. },
  1399. // {
  1400. // userId: this.$store.state.user.name,
  1401. // functionId: 100002001,
  1402. // serialNumber: '100002001TableMinValue',
  1403. // tableId: "100002001Table",
  1404. // tableName: "属性表",
  1405. // columnProp: 'numValue',
  1406. // headerAlign: "center",
  1407. // align: "right",
  1408. // columnLabel: '数字值',
  1409. // columnHidden: false,
  1410. // columnImage: false,
  1411. // columnSortable: false,
  1412. // sortLv: 0,
  1413. // status: true,
  1414. // fixed: '',
  1415. // columnWidth:120,
  1416. // },
  1417. // {
  1418. // userId: this.$store.state.user.name,
  1419. // functionId: 100002001,
  1420. // serialNumber: '100002001TableDefaultValue',
  1421. // tableId: "100002001Table",
  1422. // tableName: "属性表",
  1423. // columnProp: 'defaultValue',
  1424. // headerAlign: "center",
  1425. // align: "right",
  1426. // columnLabel: '参照值',
  1427. // columnHidden: false,
  1428. // columnImage: false,
  1429. // columnSortable: false,
  1430. // sortLv: 0,
  1431. // status: true,
  1432. // fixed: '',
  1433. // },
  1434. ],
  1435. // ======== 必填规则 ========
  1436. rules: {
  1437. bu: [
  1438. {required: true, message: ' ', trigger: 'change'},
  1439. {required: true, message: ' ', trigger: 'blur'},
  1440. ],
  1441. rfqNo: [
  1442. {required: true, message: ' ', trigger: 'change'},
  1443. {required: true, message: ' ', trigger: 'blur'},
  1444. ],
  1445. customerNo: [
  1446. {required: true, message: ' ', trigger: 'change'},
  1447. {required: true, message: ' ', trigger: 'blur'},
  1448. ],
  1449. customerDesc: [
  1450. {required: true, message: ' ', trigger: 'change'},
  1451. {required: true, message: ' ', trigger: 'blur'},
  1452. ],
  1453. requester: [
  1454. {required: true, message: ' ', trigger: 'change'},
  1455. {required: true, message: ' ', trigger: 'blur'},
  1456. ],
  1457. requesterName: [
  1458. {required: true, message: ' ', trigger: 'change'},
  1459. {required: true, message: ' ', trigger: 'blur'},
  1460. ],
  1461. quoter: [
  1462. {required: true, message: ' ', trigger: 'change'},
  1463. {required: true, message: ' ', trigger: 'blur'},
  1464. ],
  1465. quoterName: [
  1466. {required: true, message: ' ', trigger: 'change'},
  1467. {required: true, message: ' ', trigger: 'blur'},
  1468. ],
  1469. priorityLevel: [
  1470. {required: true, message: ' ', trigger: 'change'},
  1471. ],
  1472. requiredCompletionDate: [
  1473. {required: true, message: ' ', trigger: 'change'},
  1474. {required: true, message: ' ', trigger: 'blur'},
  1475. ],
  1476. requestDate: [
  1477. {required: true, message: ' ', trigger: 'change'},
  1478. {required: true, message: ' ', trigger: 'blur'},
  1479. ],
  1480. },
  1481. inquiryPartRules: {
  1482. bu: [
  1483. {required: true, message: ' ', trigger: 'change'},
  1484. {required: true, message: ' ', trigger: 'blur'},
  1485. ],
  1486. partNo: [
  1487. {required: true, message: ' ', trigger: 'change'},
  1488. {required: true, message: ' ', trigger: 'blur'},
  1489. ],
  1490. partDesc: [
  1491. {required: true, message: ' ', trigger: 'change'},
  1492. {required: true, message: ' ', trigger: 'blur'},
  1493. ],
  1494. inquiryQty: [
  1495. {required: true, message: ' ', trigger: 'change'},
  1496. {required: true, message: ' ', trigger: 'blur'},
  1497. ],
  1498. umId: [
  1499. {required: true, message: ' ', trigger: 'change'},
  1500. {required: true, message: ' ', trigger: 'blur'},
  1501. ],
  1502. codeNo: [
  1503. {required: true, message: ' ', trigger: 'change'},
  1504. {required: true, message: ' ', trigger: 'blur'},
  1505. ],
  1506. },
  1507. // ======== 选中的当前行数据 ========
  1508. inquiryCurrentRow: {},
  1509. // ======== 模态框开关控制 ========
  1510. modalFlag: false,
  1511. modalDisableFlag: false,
  1512. inquiryPartModalFlag: false,
  1513. inquiryPartModalDisableFlag: false,
  1514. inquiryPartItemModalFlag: false,
  1515. }
  1516. },
  1517. mounted() {
  1518. this.$nextTick(() => {
  1519. /*第二个表格高度的动态调整*/
  1520. this.height = window.innerHeight - 210;
  1521. })
  1522. EventBus.$on('refreshInquiryOneDetail1', () => {
  1523. this.refreshCurrentTabTable();
  1524. });
  1525. },
  1526. created() {
  1527. this.getSiteAndBuByUserName()
  1528. // 动态列
  1529. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1530. this.getDataList()
  1531. },
  1532. methods: {
  1533. handleColumnResize(newWidth, oldWidth, column, event){
  1534. let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
  1535. inData.columnWidth=newWidth
  1536. updateColumnSize(inData).then(({data}) => {
  1537. if (data.code === 0) {
  1538. console.log("栏位宽度保存成功!")
  1539. }
  1540. })
  1541. },
  1542. // 获取用户的bu
  1543. getSiteAndBuByUserName () {
  1544. let tempData = {
  1545. username: this.$store.state.user.name,
  1546. }
  1547. getSiteAndBuByUserName(tempData).then(({data}) => {
  1548. if (data.code === 0) {
  1549. this.userBuList = data.rows
  1550. }
  1551. })
  1552. },
  1553. // ======== 分页相关方法 ========
  1554. /**
  1555. * 每页数
  1556. * @param val
  1557. */
  1558. sizeChangeHandle(val) {
  1559. this.pageSize = val
  1560. this.pageIndex = 1
  1561. this.getDataList()
  1562. },
  1563. /**
  1564. * 当前页
  1565. * @param val
  1566. */
  1567. currentChangeHandle(val) {
  1568. this.pageIndex = val
  1569. this.getDataList()
  1570. },
  1571. // ======== 页签切换相关方法 ========
  1572. /**
  1573. * 列表表格选择替换
  1574. * @param tab
  1575. * @param event
  1576. */
  1577. tabClick(tab, event) {
  1578. // 刷新列表数据
  1579. this.refreshCurrentTabTable()
  1580. },
  1581. // ======== 列表操作方法 ========
  1582. /**
  1583. * 单机选中询价信息
  1584. * @param row
  1585. */
  1586. inquiryClickRow(row) {
  1587. this.inquiryCurrentRow = JSON.parse(JSON.stringify(row))
  1588. },
  1589. /**
  1590. * 当前值发生变化的时候修改
  1591. * @param row
  1592. * @param oldRow
  1593. */
  1594. changeCurrentRow(row, oldRow) {
  1595. // 判断是否是获取焦点的事件
  1596. if (row) {
  1597. this.inquiryCurrentRow = JSON.parse(JSON.stringify(row))
  1598. //刷新当前页表
  1599. this.refreshCurrentTabTable()
  1600. }
  1601. },
  1602. /**
  1603. * 刷新页签的table数据
  1604. */
  1605. refreshCurrentTabTable() {
  1606. if (this.activeTable === 'inquiryPart') {
  1607. this.searchInquiryDetailInfo()
  1608. }
  1609. },
  1610. // ======== 列表数据刷新方法 ========
  1611. /**
  1612. * 获取数据列表
  1613. */
  1614. getDataList() {
  1615. this.searchData.limit = this.pageSize
  1616. this.searchData.page = this.pageIndex
  1617. searchInquiryApplicationInfo(this.searchData).then(({data}) => {
  1618. if (data.code === 0) {
  1619. this.dataList = data.page.list
  1620. this.pageIndex = data.page.currPage
  1621. this.pageSize = data.page.pageSize
  1622. this.totalPage = data.page.totalCount
  1623. //判断是否全部存在数据
  1624. if (this.totalPage > 0) {
  1625. //设置选中行
  1626. this.$refs.mainTable.setCurrentRow(this.dataList[0])
  1627. this.refreshCurrentTabTable() //加载当前的页签的table
  1628. this.inquiryClickRow(this.dataList[0])
  1629. }
  1630. }
  1631. this.dataListLoading = false
  1632. })
  1633. },
  1634. // ======== 新增/编辑模态框 ========
  1635. /**
  1636. * 询价信息新增模态框
  1637. */
  1638. addModal() {
  1639. this.modalData = {
  1640. flag: '1',
  1641. title: '询价新增',
  1642. site: this.$store.state.user.site,
  1643. bu: this.userBuList[0].buNo,
  1644. buNo: this.userBuList[0].buNo.split('_')[1],
  1645. buDesc: this.userBuList[0].buDesc,
  1646. id: '',
  1647. rfqNo: '',
  1648. customerNo: '',
  1649. customerDesc: '',
  1650. requester:'',
  1651. requesterName: '',
  1652. quoter: '',
  1653. quoterName: '',
  1654. customerInquiryNo: '',
  1655. status: 'C',
  1656. bomStatusDb: '未创建',
  1657. priorityLevel: '',
  1658. requestDate: new Date(),
  1659. requiredCompletionDate: '',
  1660. remark: '',
  1661. createBy: this.$store.state.user.name
  1662. }
  1663. this.modalDisableFlag = false
  1664. this.modalFlag = true
  1665. },
  1666. /**
  1667. * 询价信息编辑模态框
  1668. * @param row
  1669. */
  1670. async updateModal(row) {
  1671. this.modalData = {
  1672. flag: '2',
  1673. title: '询价编辑-' + row.rfqNo,
  1674. site: row.site,
  1675. bu: row.bu,
  1676. buNo: row.buNo,
  1677. buDesc: row.buDesc,
  1678. id: row.id,
  1679. rfqNo: row.rfqNo,
  1680. customerNo: row.customerNo,
  1681. customerDesc: row.customerDesc,
  1682. requester: row.requester,
  1683. requesterName: row.requesterName,
  1684. quoter: row.quoter,
  1685. quoterName: row.quoterName,
  1686. customerInquiryNo: row.customerInquiryNo,
  1687. status: row.status,
  1688. priorityLevel: row.priorityLevel,
  1689. requestDate: row.requestDate,
  1690. requiredCompletionDate: row.requiredCompletionDate,
  1691. remark: row.remark,
  1692. updateBy: this.$store.state.user.name
  1693. }
  1694. if(this.modalData.buNo === null || this.modalData.buNo === ''){
  1695. this.modalData.buDesc = ''
  1696. this.modalData.bu = ''
  1697. this.modalDisableFlag = false
  1698. }else {
  1699. this.modalDisableFlag = true
  1700. }
  1701. this.modalFlag = true
  1702. },
  1703. /**
  1704. * 客户信息新增/编辑
  1705. */
  1706. async saveData() {
  1707. await this.customerNoBlur()
  1708. await this.requesterBlur(2008)
  1709. await this.quoterBlur(2002)
  1710. if (this.modalData.customerNo === '' || this.modalData.customerNo == null) {
  1711. this.$message.warning('请选择客户编码!')
  1712. return
  1713. }
  1714. if (this.modalData.customerDesc === '' || this.modalData.customerDesc == null) {
  1715. this.$alert('该客户不存在,请重新输入客户编码!', '错误', {
  1716. confirmButtonText: '确定'
  1717. })
  1718. return
  1719. }
  1720. if (this.modalData.requestDate === '' || this.modalData.requestDate == null) {
  1721. this.$message.warning('请输入要求询价日期!')
  1722. return
  1723. }
  1724. if (this.modalData.requester === '' || this.modalData.requester == null) {
  1725. this.$message.warning('请输入PjM编码!')
  1726. return
  1727. }
  1728. if (this.modalData.requesterName === '' || this.modalData.requesterName == null) {
  1729. this.$alert('该PjM人员不存在,请重新输入PjM人员用户名!', '错误', {
  1730. confirmButtonText: '确定'
  1731. })
  1732. return
  1733. }
  1734. if (this.modalData.priorityLevel === '' || this.modalData.priorityLevel == null) {
  1735. this.$message.warning('请选择优先等级!')
  1736. return
  1737. }
  1738. if (this.modalData.requiredCompletionDate === '' || this.modalData.requiredCompletionDate == null) {
  1739. this.$message.warning('请输入要求报价日期!')
  1740. return
  1741. }
  1742. if (this.modalData.quoter === '' || this.modalData.quoter == null) {
  1743. this.$message.warning('请输入报价专员编码!')
  1744. return
  1745. }
  1746. if (this.modalData.quoterName === '' || this.modalData.quoterName == null) {
  1747. this.$alert('该报价专员人员不存在,请重新输入报价专员用户名!', '错误', {
  1748. confirmButtonText: '确定'
  1749. })
  1750. return
  1751. }
  1752. if (this.modalData.flag === '1') {
  1753. addInquiryApplicationInfo(this.modalData).then(({data}) => {
  1754. if (data && data.code === 0) {
  1755. this.getDataList()
  1756. this.modalFlag = false
  1757. this.$message({
  1758. message: '操作成功',
  1759. type: 'success',
  1760. duration: 1500,
  1761. onClose: () => {
  1762. }
  1763. })
  1764. } else {
  1765. this.$alert(data.msg, '错误', {
  1766. confirmButtonText: '确定'
  1767. })
  1768. }
  1769. })
  1770. } else {
  1771. updateInquiryApplicationInfo(this.modalData).then(({data}) => {
  1772. if (data && data.code === 0) {
  1773. this.getDataList()
  1774. this.modalFlag = false
  1775. this.$message({
  1776. message: '操作成功',
  1777. type: 'success',
  1778. duration: 1500,
  1779. onClose: () => {
  1780. }
  1781. })
  1782. } else {
  1783. this.$alert(data.msg, '错误', {
  1784. confirmButtonText: '确定'
  1785. })
  1786. }
  1787. })
  1788. }
  1789. },
  1790. /**
  1791. * 询价信息删除
  1792. */
  1793. delModal(row) {
  1794. let confirmMsg = '是否删除这条询价信息?'
  1795. if (row.status === 'B') {
  1796. confirmMsg = '该询价单已经下达,是否删除这条询价信息?'
  1797. } else if (row.status === 'A') {
  1798. confirmMsg = '该询价单已经报价,是否删除这条询价信息?'
  1799. }
  1800. this.$confirm(confirmMsg, '提示', {
  1801. confirmButtonText: '确定',
  1802. cancelButtonText: '取消',
  1803. type: 'warning'
  1804. }).then(() => {
  1805. deleteInquiryApplicationInfo(row).then(({data}) => {
  1806. if (data && data.code === 0) {
  1807. this.getDataList()
  1808. this.$message({
  1809. message: '操作成功',
  1810. type: 'success',
  1811. duration: 1500,
  1812. onClose: () => {
  1813. }
  1814. })
  1815. } else {
  1816. this.$alert(data.msg, '错误', {
  1817. confirmButtonText: '确定'
  1818. })
  1819. }
  1820. })
  1821. }).catch(() => {
  1822. })
  1823. },
  1824. updateModalStatus(row,type) {
  1825. if (type === 'B') {
  1826. this.$confirm('是否确认下达该询价单?', '提示', {
  1827. confirmButtonText: '确定',
  1828. cancelButtonText: '取消',
  1829. type: 'warning'
  1830. }).then(() => {
  1831. let inData = JSON.parse(JSON.stringify(row))
  1832. inData.status = type
  1833. updateInquiryApplicationInfo(inData).then(({data}) => {
  1834. if (data && data.code === 0) {
  1835. this.getDataList()
  1836. this.$message({
  1837. message: '操作成功',
  1838. type: 'success',
  1839. duration: 1500,
  1840. onClose: () => {
  1841. }
  1842. })
  1843. } else {
  1844. this.$alert(data.msg, '错误', {
  1845. confirmButtonText: '确定'
  1846. })
  1847. }
  1848. })
  1849. }).catch(() => {
  1850. })
  1851. }
  1852. },
  1853. // ======== 校验方法 ========
  1854. async customerNoBlur(){
  1855. if (this.modalData.customerNo !== '' || this.modalData.customerNo != null) {
  1856. let params = {
  1857. customerNo: this.modalData.customerNo,
  1858. createBy: this.$store.state.user.name,
  1859. }
  1860. return queryCustomerList(params).then(({data}) => {
  1861. if (data && data.code === 0) {
  1862. if (data.rows.length === 1) {
  1863. this.modalData.customerDesc = data.rows[0].customerDesc
  1864. } else {
  1865. this.modalData.customerDesc = ''
  1866. }
  1867. } else {
  1868. this.$message.warning(data.message)
  1869. this.modalData.customerDesc = ''
  1870. }
  1871. }).catch((error) => {
  1872. this.$message.error('校验失败,请重试:' + error);
  1873. this.modalData.customerDesc = ''
  1874. })
  1875. } else {
  1876. this.modalData.customerDesc = ''
  1877. return Promise.resolve()
  1878. }
  1879. },
  1880. async requesterBlur (tagNo) {
  1881. if (this.modalData.requester != null && this.modalData.requester !== '') {
  1882. let tempData = {
  1883. tagno: tagNo,
  1884. conditionSql: " and a.username = '" + this.modalData.requester + "'" +
  1885. " and b.site = '" + this.modalData.bu.split('_')[0] + "'"
  1886. };
  1887. // 返回 Promise
  1888. return verifyData(tempData).then(({ data }) => {
  1889. if (data && data.code === 0) {
  1890. if (data.baseListData.length > 0) {
  1891. this.modalData.requesterName = data.baseListData[0].user_display;
  1892. } else {
  1893. this.modalData.requesterName = '';
  1894. }
  1895. } else {
  1896. this.$message.warning(data.msg);
  1897. this.modalData.requesterName = '';
  1898. }
  1899. }).catch(error => {
  1900. console.error(error);
  1901. this.$message.error('校验失败,请重试:' + error);
  1902. this.modalData.requesterName = '';
  1903. });
  1904. } else {
  1905. this.modalData.requesterName = '';
  1906. return Promise.resolve(); // 如果 requester 为空,直接返回 resolved Promise
  1907. }
  1908. },
  1909. async quoterBlur (tagNo) {
  1910. if (this.modalData.quoter != null && this.modalData.quoter !== '') {
  1911. let tempData = {
  1912. tagno: tagNo,
  1913. conditionSql: " and a.username = '" + this.modalData.quoter + "'" +
  1914. " and b.site = '" + this.modalData.bu.split('_')[0] + "'"
  1915. };
  1916. // 返回 Promise
  1917. return verifyData(tempData).then(({ data }) => {
  1918. if (data && data.code === 0) {
  1919. if (data.baseListData.length > 0) {
  1920. this.modalData.quoterName = data.baseListData[0].user_display;
  1921. } else {
  1922. this.modalData.quoterName = '';
  1923. }
  1924. } else {
  1925. this.$message.warning(data.msg);
  1926. this.modalData.quoterName = '';
  1927. }
  1928. }).catch(error => {
  1929. console.error(error);
  1930. this.$message.error('校验失败,请重试');
  1931. this.modalData.quoterName = '';
  1932. });
  1933. } else {
  1934. this.modalData.quoterName = '';
  1935. return Promise.resolve(); // 如果 quoter 为空,直接返回 resolved Promise
  1936. }
  1937. },
  1938. // /**
  1939. // * 获得这些询价号的全部附件
  1940. // */
  1941. // getFileContentList () {
  1942. // let currentData = {
  1943. // orderRef1: this.$store.state.user.site,
  1944. // orderRef2: this.enterResultData.quotationNo
  1945. // }
  1946. // getFileContentList(currentData).then(({data}) => {
  1947. // if (data && data.code === 0) {
  1948. // this.enterResultData.fileContentList = data.rows
  1949. // } else {
  1950. // this.enterResultData.fileContentList = []
  1951. // }
  1952. // })
  1953. // },
  1954. /**
  1955. * 上传文件
  1956. */
  1957. uploadFile() {
  1958. let currentData = {
  1959. titleCon: '询价附件上传',
  1960. site: this.$store.state.user.site,
  1961. createBy: this.$store.state.user.name,
  1962. quotationNo: this.enterResultData.quotationNo,
  1963. fileRemark: '',
  1964. folder: 'quotationFile',
  1965. // options: []
  1966. }
  1967. // let num = 0
  1968. // let arr = this.enterResultData.quotationNo.split(';')
  1969. // arr.forEach(val => {
  1970. // currentData.options.push({key: num++, value: val})
  1971. // })
  1972. //打开组件 去做新增业务
  1973. this.$nextTick(() => {
  1974. this.$refs.quotationUploadFile.init(currentData);
  1975. })
  1976. },
  1977. /**
  1978. * 文件删除
  1979. * @param row
  1980. */
  1981. deleteFile(row) {
  1982. this.$confirm('确定要删除此文件?', '提示', {
  1983. confirmButtonText: '确定',
  1984. cancelButtonText: '取消',
  1985. type: 'warning'
  1986. }).then(() => {
  1987. deleteQuotationFile(row).then(({data}) => {
  1988. if (data && data.code === 0) {
  1989. this.getFileContentList();
  1990. this.$message({
  1991. message: '操作成功',
  1992. type: 'success',
  1993. duration: 1500,
  1994. onClose: () => {
  1995. }
  1996. })
  1997. } else {
  1998. this.$alert(data.msg, '错误', {
  1999. confirmButtonText: '确定'
  2000. })
  2001. }
  2002. })
  2003. }).catch(() => {
  2004. })
  2005. },
  2006. /**
  2007. * 文件下载
  2008. * @param row
  2009. */
  2010. downloadFile(row) {
  2011. downLoadQuotationFile(row).then(({data}) => {
  2012. // 不限制文件下载类型
  2013. const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
  2014. // 下载文件名称
  2015. const fileName = row.fileName
  2016. // a标签下载
  2017. const linkNode = document.createElement('a')
  2018. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  2019. linkNode.style.display = 'none'
  2020. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  2021. document.body.appendChild(linkNode)
  2022. linkNode.click() // 模拟在按钮上的一次鼠标单击
  2023. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  2024. document.body.removeChild(linkNode)
  2025. })
  2026. },
  2027. // ======== chooseList相关方法 ========
  2028. /**
  2029. * 获取基础数据列表S
  2030. * @param val
  2031. * @param type
  2032. */
  2033. getBaseList(val, type) {
  2034. this.tagNo = val
  2035. this.tagNo1 = type
  2036. this.$nextTick(() => {
  2037. let strVal = ''
  2038. let conSql = ''
  2039. if (val === 220) {
  2040. strVal = this.inquiryPartModalData.codeNo ? this.inquiryPartModalData.codeNo : ''
  2041. conSql =" and function_type = 'PRICECHECK'" + " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'" +
  2042. " and bu_no = '" + this.inquiryPartModalData.bu.split('_')[1] + "'"
  2043. }
  2044. if (val === 509) {
  2045. if (type === 1) {
  2046. strVal = this.modalData.customerNo ? this.modalData.customerNo : ''
  2047. }
  2048. if (type === 2) {
  2049. strVal = this.searchData.customerNo ? this.searchData.customerNo : ''
  2050. }
  2051. }
  2052. if (val === 510) {
  2053. strVal = this.inquiryPartModalData.umId ? this.inquiryPartModalData.umId : ''
  2054. conSql = " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'"
  2055. }
  2056. if (val === 2002) {
  2057. if (type === 1) {
  2058. strVal = this.searchData.quoterName ? this.searchData.quoterName : ''
  2059. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2060. }
  2061. if (type === 2) {
  2062. strVal = this.modalData.quoterName ? this.modalData.quoterName : ''
  2063. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2064. }
  2065. }
  2066. if (val === 2008) {
  2067. if (type === 1) {
  2068. strVal = this.searchData.requesterName ? this.searchData.requesterName : ''
  2069. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2070. }
  2071. if (type === 2) {
  2072. strVal = this.modalData.requesterName ? this.modalData.requesterName : ''
  2073. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2074. }
  2075. }
  2076. this.$refs.baseList.init(val, strVal, conSql)
  2077. })
  2078. },
  2079. /**
  2080. * 列表方法的回调
  2081. * @param val
  2082. */
  2083. getBaseData(val) {
  2084. if (this.tagNo ===220) {
  2085. this.inquiryPartModalData.codeNo = val.code_no
  2086. this.inquiryPartModalData.codeDesc = val.code_desc
  2087. }
  2088. if (this.tagNo === 509) {
  2089. if (this.tagNo1 === 1) {
  2090. if (val.customer_no === this.modalData.customerNo) {
  2091. return
  2092. }
  2093. this.modalData.customerNo = val.customer_no
  2094. this.modalData.customerDesc = val.customer_desc
  2095. }
  2096. if (this.tagNo1 === 2) {
  2097. if (val.customer_no === this.searchData.customerNo) {
  2098. return
  2099. }
  2100. this.searchData.customerNo = val.customer_no
  2101. }
  2102. }
  2103. if (this.tagNo === 510) {
  2104. this.inquiryPartModalData.umId = val.UMID
  2105. this.inquiryPartModalData.umName = val.UMName
  2106. }
  2107. if (this.tagNo === 2002) {
  2108. if (this.tagNo1 === 1) {
  2109. this.searchData.quoter = val.username
  2110. this.searchData.quoterName = val.user_display
  2111. }
  2112. if (this.tagNo1 === 2) {
  2113. this.modalData.quoter = val.username
  2114. this.modalData.quoterName = val.user_display
  2115. }
  2116. }
  2117. if (this.tagNo === 2008) {
  2118. if (this.tagNo1 === 1) {
  2119. this.searchData.requester = val.username
  2120. this.searchData.requesterName = val.user_display
  2121. }
  2122. if (this.tagNo1 === 2) {
  2123. this.modalData.requester = val.username
  2124. this.modalData.requesterName = val.user_display
  2125. }
  2126. }
  2127. },
  2128. // ======== 询价产品相关方法 ========
  2129. searchInquiryDetailInfo() {
  2130. let tempData = {
  2131. rfqId: this.inquiryCurrentRow.id,
  2132. buNo: this.inquiryCurrentRow.buNo,
  2133. page: this.pageIndex,
  2134. limit: this.pageSize
  2135. }
  2136. searchInquiryDetailInfo(tempData).then(({data}) => {
  2137. if (data.code === 0) {
  2138. this.inquiryPartDataList = data.page
  2139. //判断是否全部存在数据
  2140. if (this.inquiryPartDataList != null && this.inquiryPartDataList.length > 0) {
  2141. //设置选中行
  2142. this.$refs.secondaryTable.setCurrentRow(this.inquiryPartDataList[0])
  2143. }
  2144. }
  2145. })
  2146. },
  2147. /**
  2148. * 询价产品新增
  2149. */
  2150. addInquiryPartModal(row) {
  2151. this.inquiryCurrentRow = JSON.parse(JSON.stringify(row))
  2152. this.inquiryPartModalData = {
  2153. title: '询价产品新增',
  2154. site: this.inquiryCurrentRow.site,
  2155. bu: this.inquiryCurrentRow.bu,
  2156. buNo: this.inquiryCurrentRow.buNo,
  2157. buDesc: this.inquiryCurrentRow.buDesc,
  2158. rfqId: this.inquiryCurrentRow.id,
  2159. partNo: '',
  2160. partDesc: '',
  2161. inquiryQty: '',
  2162. umId: '',
  2163. umName: '',
  2164. codeNo: '',
  2165. codeDesc: '',
  2166. remark: '',
  2167. createBy: this.$store.state.user.name
  2168. }
  2169. this.inquiryPartModalFlag = true
  2170. },
  2171. async saveInquiryPartData() {
  2172. await this.modelBlur(220)
  2173. await this.umIdBlur(510)
  2174. if (this.inquiryPartModalData.partDesc === '' || this.inquiryPartModalData.partDesc == null) {
  2175. this.$message.warning('请输入产品描述!')
  2176. return
  2177. }
  2178. if (this.inquiryPartModalData.inquiryQty === '' || this.inquiryPartModalData.inquiryQty == null) {
  2179. this.$message.warning('请输入询价数量!')
  2180. return
  2181. }
  2182. if (this.inquiryPartModalData.inquiryQty < 0) {
  2183. this.$message.warning('询价数量必须大于等于0!')
  2184. return
  2185. }
  2186. if (this.inquiryPartModalData.umId === '' || this.inquiryPartModalData.umId == null) {
  2187. this.$message.warning('请选择计量单位!')
  2188. return
  2189. }
  2190. if (this.inquiryPartModalData.umName === '' || this.inquiryPartModalData.umName == null) {
  2191. this.$alert('该计量单位不存在,请重新输入计量单位编码!', '错误', {
  2192. confirmButtonText: '确定'
  2193. })
  2194. }
  2195. if (this.inquiryPartModalData.codeNo === '' || this.inquiryPartModalData.codeNo == null) {
  2196. this.$message.warning('请选择属性模版!')
  2197. return
  2198. }
  2199. if (this.inquiryPartModalData.codeDesc === '' || this.inquiryPartModalData.codeDesc == null) {
  2200. this.$alert('该属性模版不存在,请重新输入属性模版编码!', '错误', {
  2201. confirmButtonText: '确定'
  2202. })
  2203. }
  2204. if (this.inquiryPartModalData.title === '询价产品新增') {
  2205. addInquiryDetailInfo(this.inquiryPartModalData).then(({data}) => {
  2206. if (data && data.code === 0) {
  2207. this.refreshCurrentTabTable()
  2208. this.inquiryPartModalFlag = false
  2209. EventBus.$emit('updateInquiryPartInfo')
  2210. this.$message({
  2211. message: '操作成功',
  2212. type: 'success',
  2213. duration: 1500,
  2214. onClose: () => {
  2215. }
  2216. })
  2217. } else {
  2218. this.$alert(data.msg, '错误', {
  2219. confirmButtonText: '确定'
  2220. })
  2221. }
  2222. })
  2223. } else {
  2224. updateInquiryDetailInfo(this.inquiryPartModalData).then(({data}) => {
  2225. if (data && data.code === 0) {
  2226. this.refreshCurrentTabTable()
  2227. this.inquiryPartModalFlag = false
  2228. EventBus.$emit('updateInquiryPartInfo')
  2229. this.$message({
  2230. message: '操作成功',
  2231. type: 'success',
  2232. duration: 1500,
  2233. onClose: () => {
  2234. }
  2235. })
  2236. } else {
  2237. this.$alert(data.msg, '错误', {
  2238. confirmButtonText: '确定'
  2239. })
  2240. }
  2241. })
  2242. }
  2243. },
  2244. /**
  2245. * 询价产品编辑
  2246. * @param row
  2247. */
  2248. updateInquiryPartModal(row) {
  2249. this.inquiryPartModalData = {
  2250. flag: '2',
  2251. title: '询价产品编辑',
  2252. site: row.site,
  2253. bu: row.site + '_' + row.buNo,
  2254. buNo: row.buNo,
  2255. buDesc: row.buDesc,
  2256. id: row.id,
  2257. testPartId: row.testPartId,
  2258. rfqId: row.rfqId,
  2259. partNo: row.partNo,
  2260. partDesc: row.partDesc,
  2261. inquiryQty: row.inquiryQty,
  2262. umId: row.umId,
  2263. umName: row.umName,
  2264. codeNo: row.codeNo,
  2265. codeDesc: row.codeDesc,
  2266. remark: row.remark,
  2267. updateBy: this.$store.state.user.name,
  2268. }
  2269. this.inquiryPartModalFlag = true
  2270. this.inquiryPartModalDisableFlag = true
  2271. },
  2272. /**
  2273. * 询价产品删除
  2274. * @param row
  2275. */
  2276. async delInquiryPartModal(row) {
  2277. let inData = {
  2278. site: row.site,
  2279. bu: row.bu,
  2280. buNo: row.buNo,
  2281. buDesc: row.buDesc,
  2282. inquiryPartId: row.id,
  2283. rfqId: this.inquiryCurrentRow.id,
  2284. rfqNo: this.inquiryCurrentRow.rfqNo,
  2285. testPartId: row.testPartId,
  2286. partNo: row.partNo,
  2287. codeNo: row.codeNo,
  2288. recordType: 'PRICECHECK',
  2289. codeDesc: '',
  2290. remark: '',
  2291. }
  2292. await this.getItemListByInquiryPartAndCodeNo(inData)
  2293. let confirmMassage = '是否删除这条询价产品信息以及相应的物料档案信息?'
  2294. this.inquiryPartItemDataList.forEach((item) => {
  2295. if ((item.textValue !== '' && item.textValue !== null) || (item.numberValue !== '' && item.numberValue !== null)) {
  2296. confirmMassage = '该询价产品已录入属性值,确认继续删除这条询价产品信息及其物料档案、属性信息?'
  2297. }
  2298. })
  2299. this.$confirm(confirmMassage, '提示', {
  2300. confirmButtonText: '确定',
  2301. cancelButtonText: '取消',
  2302. type: 'warning'
  2303. }).then(() => {
  2304. deleteInquiryDetailInfo(row).then(({data}) => {
  2305. if (data && data.code === 0) {
  2306. this.refreshCurrentTabTable()
  2307. EventBus.$emit('updateInquiryPartInfo')
  2308. this.$message({
  2309. message: '操作成功',
  2310. type: 'success',
  2311. duration: 1500,
  2312. onClose: () => {
  2313. }
  2314. })
  2315. } else {
  2316. this.$alert(data.msg, '错误', {
  2317. confirmButtonText: '确定'
  2318. })
  2319. }
  2320. })
  2321. }).catch(() => {
  2322. })
  2323. },
  2324. inquiryPartItemModal(row) {
  2325. this.inquiryPartItemModalData = {
  2326. site: row.site,
  2327. bu: row.bu,
  2328. buNo: row.buNo,
  2329. buDesc: row.buDesc,
  2330. inquiryPartId: row.id,
  2331. rfqId: this.inquiryCurrentRow.id,
  2332. rfqNo: this.inquiryCurrentRow.rfqNo,
  2333. testPartId: row.testPartId,
  2334. partNo: row.partNo,
  2335. codeNo: row.codeNo,
  2336. recordType: 'PRICECHECK',
  2337. codeDesc: '',
  2338. remark: '',
  2339. createBy: this.$store.state.user.name
  2340. }
  2341. this.getItemListByInquiryPartAndCodeNo(this.inquiryPartItemModalData)
  2342. this.inquiryPartItemModalFlag = true
  2343. },
  2344. async getItemListByInquiryPartAndCodeNo(inquiryPartItemModalData){
  2345. return getItemListByInquiryPartAndCodeNo(inquiryPartItemModalData).then(({data})=>{
  2346. if (data && data.code === 0){
  2347. this.inquiryPartItemDataList = data.rows;
  2348. }else {
  2349. this.$message.warning(data.msg)
  2350. }
  2351. }).catch((error)=>{
  2352. this.$message.error(error)
  2353. })
  2354. },
  2355. clickInquiryPartItemSave(){
  2356. if(this.inquiryPartItemDataList.length === 0){
  2357. return false
  2358. }
  2359. if (!this.attributeDialog){
  2360. this.updateInquiryPartItemList();
  2361. }else {
  2362. this.attributeDialog = false;
  2363. }
  2364. },
  2365. updateInquiryPartItemList(){
  2366. this.loading = true
  2367. let list = JSON.parse(JSON.stringify(this.inquiryPartItemDataList));
  2368. updateInquiryPartItemList(list).then(({data})=>{
  2369. if (data && data.code === 0){
  2370. this.$message.success(data.msg);
  2371. this.getItemListByInquiryPartAndCodeNo(this.inquiryPartItemModalData);
  2372. this.attributeDialog = true;
  2373. EventBus.$emit('updateInquiryPartInfo')
  2374. }else {
  2375. this.$message.warning(data.msg);
  2376. }
  2377. this.loading = false
  2378. }).catch((error)=>{
  2379. this.$message.error(error)
  2380. this.loading = false
  2381. })
  2382. },
  2383. // 属性输入校验
  2384. async modelBlur(tagNo) {
  2385. if (this.inquiryPartModalData.codeNo != null && this.inquiryPartModalData.codeNo !== '') {
  2386. let tempData = {
  2387. tagno: tagNo,
  2388. conditionSql: " and code_no = '" + this.inquiryPartModalData.codeNo + "'" +
  2389. " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'" +
  2390. " and bu_no = '" + this.inquiryPartModalData.bu.split('_')[1] + "'"
  2391. };
  2392. // 返回 Promise
  2393. return verifyData(tempData).then(({ data }) => {
  2394. if (data && data.code === 0) {
  2395. if (data.baseListData.length > 0) {
  2396. this.inquiryPartModalData.codeDesc = data.baseListData[0].code_desc;
  2397. } else {
  2398. this.inquiryPartModalData.codeDesc = '';
  2399. }
  2400. } else {
  2401. this.$message.warning(data.msg);
  2402. this.inquiryPartModalData.codeDesc = '';
  2403. }
  2404. }).catch(error => {
  2405. console.error(error);
  2406. this.$message.error('校验失败,请重试');
  2407. this.inquiryPartModalData.codeDesc = '';
  2408. });
  2409. } else {
  2410. this.inquiryPartModalData.codeDesc = '';
  2411. return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
  2412. }
  2413. },
  2414. // 计量单位输入校验
  2415. async umIdBlur(tagNo) {
  2416. if (this.inquiryPartModalData.umId != null && this.inquiryPartModalData.umId !== '') {
  2417. let tempData = {
  2418. tagno: tagNo,
  2419. conditionSql: " and UMID = '" + this.inquiryPartModalData.umId + "'" +
  2420. " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'"
  2421. };
  2422. // 返回 Promise
  2423. return verifyData(tempData).then(({ data }) => {
  2424. if (data && data.code === 0) {
  2425. if (data.baseListData.length > 0) {
  2426. this.inquiryPartModalData.umName = data.baseListData[0].UMName;
  2427. } else {
  2428. this.inquiryPartModalData.umName = '';
  2429. }
  2430. } else {
  2431. this.$message.warning(data.msg);
  2432. this.inquiryPartModalData.umName = '';
  2433. }
  2434. }).catch(error => {
  2435. console.error(error);
  2436. this.$message.error('校验失败,请重试');
  2437. this.inquiryPartModalData.umName = '';
  2438. });
  2439. } else {
  2440. this.inquiryPartModalData.umName = '';
  2441. return Promise.resolve(); // 如果 umId 为空,直接返回 resolved Promise
  2442. }
  2443. },
  2444. // ======== 导出相关方法 ========
  2445. /**
  2446. * 导出excel
  2447. */
  2448. async createExportData() {
  2449. this.searchData.limit = -1
  2450. this.searchData.page = 1
  2451. await searchInquiryApplicationInfo(this.searchData).then(({data}) => {
  2452. this.resultList = data.page.list
  2453. // 遍历dataList 取-后的值
  2454. this.resultList.forEach((item) => {
  2455. if (item.status === 'A') {
  2456. item.status = '已转报价'
  2457. } else if (item.status === 'B') {
  2458. item.status = '下达'
  2459. } else if (item.status === 'C') {
  2460. item.status = '草稿'
  2461. }
  2462. if (item.priorityLevel === 'A') {
  2463. item.priorityLevel = '普通'
  2464. } else if (item.priorityLevel === ' B') {
  2465. item.priorityLevel = '重要'
  2466. } else if (item.priorityLevel === ' C') {
  2467. item.priorityLevel = '紧急'
  2468. }
  2469. })
  2470. })
  2471. return this.resultList
  2472. },
  2473. startDownload() {
  2474. },
  2475. finishDownload() {
  2476. },
  2477. fields() {
  2478. let json = '{'
  2479. this.columnList.forEach((item, index) => {
  2480. if (index == this.columnList.length - 1) {
  2481. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  2482. } else {
  2483. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  2484. }
  2485. })
  2486. json += '}'
  2487. let s = eval('(' + json + ')')
  2488. return s
  2489. },
  2490. // ======== 导入相关方法 ========
  2491. handleImportQuotation() {
  2492. let currentData = {
  2493. createBy: this.$store.state.user.name,
  2494. site: this.$store.state.user.site,
  2495. }
  2496. //打开组件 去做新增业务
  2497. this.$nextTick(() => {
  2498. this.$refs.quotationUpload.init(currentData)
  2499. })
  2500. },
  2501. // openSaveDataDialog(){
  2502. // if (this.modalData.title === '询价新增') {
  2503. // let rfqNos = [];
  2504. // this.dataList.forEach((item) => {
  2505. // // 如果item.rfqNo为XJ开头
  2506. // if (item.rfqNo.startsWith('XJ')) {
  2507. // // 解析数字部分
  2508. // const numPart = parseInt(item.rfqNo.replace('XJ', ''), 10);
  2509. // if (!isNaN(numPart)) {
  2510. // rfqNos.push(numPart);
  2511. // }
  2512. // }
  2513. // });
  2514. // if (rfqNos.length === 0) {
  2515. // // 如果没有XJ开头的rfqNo
  2516. // this.modalData.rfqNo = 'XJ00000001';
  2517. // } else {
  2518. // // 取到最大的XJ开头的rfqNo
  2519. // let maxRfqNo = Math.max(...rfqNos);
  2520. //
  2521. // // 生成新的rfqNo,确保有9位数,前面补零
  2522. // maxRfqNo += 1; // 增加最大值
  2523. // this.modalData.rfqNo = 'XJ' + String(maxRfqNo).padStart(8, '0');
  2524. // }
  2525. // }
  2526. // },
  2527. // 保存弹框关闭事件
  2528. closeSaveDataDialog() {
  2529. this.modalData = {
  2530. flag: '',
  2531. title: '',
  2532. site: '',
  2533. bu: '',
  2534. buNo: '',
  2535. buDesc: '',
  2536. id: '',
  2537. rfqNo: '',
  2538. customerNo: '',
  2539. customerDesc: '',
  2540. requester:'',
  2541. requesterName: '',
  2542. quoter: '',
  2543. quoterName: '',
  2544. customerInquiryNo: '',
  2545. status: '',
  2546. priorityLevel: '',
  2547. requestDate: '',
  2548. requiredCompletionDate: '',
  2549. remark: '',
  2550. }
  2551. this.modalFlag = false
  2552. },
  2553. openInquiryPartSaveDataDialog() {
  2554. if (this.inquiryPartModalData.title === '询价产品新增') {
  2555. let partNos = [];
  2556. this.inquiryPartModalData.queryType = 'TP';
  2557. this.inquiryPartModalData.userName = this.$store.state.user.name;
  2558. this.inquiryPartModalData.limit = -1;
  2559. this.inquiryPartModalData.page = 1;
  2560. this.inquiryPartModalData.buNo = '';
  2561. partInformationSearch(this.inquiryPartModalData).then(({data}) => {
  2562. if (data && data.code === 0) {
  2563. data.page.list.forEach((item) => {
  2564. // 如果item.partNo为TP开头
  2565. if (item.partNo.startsWith('TP')) {
  2566. // 解析数字部分
  2567. const numPart = parseInt(item.partNo.replace('TP', ''), 10);
  2568. if (!isNaN(numPart)) {
  2569. partNos.push(numPart);
  2570. }
  2571. }
  2572. });
  2573. if (partNos.length === 0) {
  2574. // 如果没有TP开头的partNo
  2575. this.inquiryPartModalData.partNo = 'TP00000001';
  2576. } else {
  2577. // 取到最大的TP开头的partNo
  2578. let maxPartNo = Math.max(...partNos);
  2579. // 生成新的partNo,确保有9位数,前面补零
  2580. maxPartNo += 1; // 增加最大值
  2581. this.inquiryPartModalData.partNo = 'TP' + String(maxPartNo).padStart(8, '0');
  2582. }
  2583. }
  2584. });
  2585. }
  2586. },
  2587. closeInquiryPartSaveDataDialog() {
  2588. this.inquiryPartModalData = {
  2589. title: '',
  2590. site: '',
  2591. bu: '',
  2592. buNo: '',
  2593. buDesc: '',
  2594. rfqId: '',
  2595. partNo: '',
  2596. partDesc: '',
  2597. inquiryQty: '',
  2598. umId: '',
  2599. umName: '',
  2600. codeNo: '',
  2601. codeDesc: '',
  2602. remark: '',
  2603. createBy: ''
  2604. }
  2605. this.inquiryPartModalFlag = false
  2606. },
  2607. rowStyle({row}) {
  2608. if (this.inquiryCurrentRow.id === row.id) {
  2609. return {'background-color': '#E8F7F6', cursor: 'pointer'};
  2610. }
  2611. },
  2612. navigateToMes(id){
  2613. this.$router.push({ path: 'inquiry-inquiryDetail', query: { id : id} });
  2614. },
  2615. // 动态列开始 获取 用户保存的 格式列
  2616. async getTableUserColumn(tableId, columnId) {
  2617. let queryTableUser = {
  2618. userId: this.$store.state.user.name,
  2619. functionId: this.$route.meta.menuId,
  2620. tableId: tableId,
  2621. status: true,
  2622. languageCode: this.$i18n.locale
  2623. }
  2624. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2625. if (data.rows.length > 0) {
  2626. switch (columnId) {
  2627. case 1:
  2628. this.columnList = data.rows
  2629. break;
  2630. }
  2631. } else {
  2632. this.getColumnList(tableId, columnId)
  2633. }
  2634. })
  2635. },
  2636. // 获取 tableDefault 列
  2637. async getColumnList (tableId, columnId) {
  2638. let queryTable= {
  2639. functionId: this.$route.meta.menuId,
  2640. tableId: tableId,
  2641. languageCode: this.$i18n.locale
  2642. }
  2643. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2644. if (!data.rows.length === 0) {
  2645. switch (columnId) {
  2646. case 1:
  2647. this.columnList = data.rows
  2648. break;
  2649. }
  2650. }
  2651. })
  2652. },
  2653. },
  2654. }
  2655. </script>
  2656. <style scoped>
  2657. /deep/ .customer-tab .el-tabs__content {
  2658. padding: 0px !important;
  2659. height: 100%;
  2660. }
  2661. /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  2662. background-color: #17B3A3;
  2663. border-color: #17B3A3;
  2664. }
  2665. /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
  2666. border-color: #FFF
  2667. }
  2668. /deep/ .el-form-item--medium .el-form-item__content{
  2669. height: auto;
  2670. }
  2671. .el-input-number /deep/ .el-input__inner {
  2672. text-align: right;
  2673. padding-right: 5px !important;
  2674. }
  2675. /deep/ .el-input .el-input--medium{
  2676. line-height: 20px;
  2677. }
  2678. /deep/ .el-input-number .el-input--medium{
  2679. line-height: 20px;
  2680. }
  2681. /*table中input 修改样式*/
  2682. /deep/ div.table-el-date {
  2683. padding: 0px 0px;
  2684. height: 25px !important;
  2685. }
  2686. /*table中input*/
  2687. div.table-el-date /deep/ input.el-input__inner{
  2688. padding: 0px 0px;
  2689. height: 23px !important;
  2690. text-align: right;
  2691. }
  2692. /* 特殊的样式*/
  2693. /deep/ .el-table div.cell:has(.table-el-date) {
  2694. /* 直接作用于 <td> 元素 */
  2695. padding: 0px;
  2696. height: 25px;
  2697. }
  2698. .el-transfer-panel {
  2699. border: 2px solid #17b3a3;
  2700. border-radius: 4px;
  2701. overflow: hidden;
  2702. background: #fff;
  2703. display: inline-block;
  2704. vertical-align: middle;
  2705. width: 200px;
  2706. max-height: 100%;
  2707. -webkit-box-sizing: border-box;
  2708. box-sizing: border-box;
  2709. position: relative;
  2710. }
  2711. .el-transfer-panel .el-transfer-panel__header {
  2712. height: 40px;
  2713. line-height: 40px;
  2714. background: #17b3a3;
  2715. margin: 0;
  2716. padding-left: 15px;
  2717. border-bottom: 1px solid #17b3a3;
  2718. -webkit-box-sizing: border-box;
  2719. box-sizing: border-box;
  2720. color: #000;
  2721. }
  2722. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  2723. font-size: 14px;
  2724. color: #303133;
  2725. font-weight: 400;
  2726. }
  2727. </style>