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.

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