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.

2544 lines
87 KiB

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