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.

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