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.

2977 lines
101 KiB

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