engin_examine.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. <template>
  2. <div class="detail-container">
  3. <!-- <el-page-header content="审批" @back="goBack" /> -->
  4. <div class="main-title">
  5. <div class="title">工程信息单</div>
  6. </div>
  7. <div class="diy-table-1">
  8. <el-row>
  9. <el-col :span="8" class="item">
  10. <div class="label">工程登录编号</div>
  11. <div class="value">{{ detailData.enginInfoNo }}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{ detailData.orderDate }}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">业务员</div>
  19. <div class="value">
  20. <el-select
  21. v-model="detailData.serviceId"
  22. placeholder="选择业务员"
  23. size="small"
  24. filterable
  25. clearable
  26. style="width: 100%"
  27. >
  28. <el-option
  29. v-for="item in salesmanList"
  30. :key="item.adminUserId"
  31. :label="item.nickName"
  32. :value="item.adminUserId"
  33. />
  34. </el-select>
  35. </div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">经销商编码</div>
  39. <div class="value">{{ detailData.customerNumber }}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">项目名称</div>
  43. <div class="value">
  44. <el-input v-model="detailData.projectName" placeholder="请输入项目名称" />
  45. </div>
  46. </el-col>
  47. <el-col :span="8" class="item">
  48. <div class="label">机型类别</div>
  49. <div class="value">
  50. <el-select
  51. v-model="detailData.machineType"
  52. placeholder="选择机型类别"
  53. size="small"
  54. clearable
  55. style="width: 100%"
  56. >
  57. <el-option
  58. v-for="item in machineTypeList"
  59. :key="item.dictCode"
  60. :label="item.dictValue"
  61. :value="item.dictCode"
  62. />
  63. </el-select>
  64. </div>
  65. </el-col>
  66. <el-col :span="8" class="item">
  67. <div class="label">经销商名称</div>
  68. <div class="value">{{ detailData.customerName }}</div>
  69. </el-col>
  70. <el-col :span="8" class="item">
  71. <div class="label">使用单位</div>
  72. <div class="value">
  73. <el-input v-model="detailData.useUnit" placeholder="请输入使用单位" />
  74. </div>
  75. </el-col>
  76. <el-col :span="8" class="item">
  77. <div class="label">行业类别</div>
  78. <div class="value">
  79. <el-select
  80. v-model="detailData.tradeCategory"
  81. placeholder="选择行业类别"
  82. size="small"
  83. clearable
  84. style="width: 100%"
  85. >
  86. <el-option v-for="item in tradeCategoryList" :key="item.value" :label="item.label" :value="item.value" />
  87. </el-select>
  88. </div>
  89. </el-col>
  90. <el-col :span="8" class="item">
  91. <div class="label">工程编号</div>
  92. <div class="value">
  93. <el-input v-model="detailData.projectNo" placeholder="请输入工程编号" />
  94. </div>
  95. </el-col>
  96. <el-col :span="8" class="item">
  97. <div class="label">厂工程编码</div>
  98. <div class="value">
  99. <el-input v-model="detailData.enginFactoryNo" placeholder="请输入厂工程编码" />
  100. </div>
  101. </el-col>
  102. <el-col :span="8" class="item">
  103. <div class="label">工程登录类型</div>
  104. <div class="value">
  105. <el-select
  106. v-model="detailData.enginSignType"
  107. placeholder="选择工程登录类型"
  108. size="small"
  109. clearable
  110. style="width: 100%"
  111. >
  112. <el-option
  113. v-for="item in loginTypeList"
  114. :key="item.dictCode"
  115. :label="item.dictValue"
  116. :value="item.dictCode"
  117. />
  118. </el-select>
  119. </div>
  120. </el-col>
  121. <el-col :span="8" class="item">
  122. <div class="label">联系人</div>
  123. <div class="value">
  124. <el-input v-model="detailData.linkman" placeholder="请输入联系人" />
  125. </div>
  126. </el-col>
  127. <el-col :span="8" class="item">
  128. <div class="label">联系电话</div>
  129. <div class="value">
  130. <el-input v-model="detailData.phone" placeholder="请输入联系电话" />
  131. </div>
  132. </el-col>
  133. <el-col :span="8" class="item">
  134. <div class="label">固定电话</div>
  135. <div class="value">
  136. <el-input v-model="detailData.tel" placeholder="请输入固定电话" />
  137. </div>
  138. </el-col>
  139. <el-col :span="8" class="item">
  140. <div class="label">文件编号</div>
  141. <div class="value">{{ detailData.fileNo }}</div>
  142. </el-col>
  143. <el-col :span="24" class="item">
  144. <div class="label">安装地址</div>
  145. <div class="value">
  146. <el-input v-model="detailData.installAddress" placeholder="请输入安装地址" />
  147. </div>
  148. </el-col>
  149. <el-col v-if="!isCustomer" :span="24" class="item">
  150. <div class="label">格力内部备注</div>
  151. <div class="value">
  152. <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注" />
  153. </div>
  154. </el-col>
  155. <el-col :span="24" class="item">
  156. <div class="label">格力回复</div>
  157. <div class="value">
  158. <el-input v-model="detailData.geLiNote" placeholder="请输入格力回复" />
  159. </div>
  160. </el-col>
  161. <el-col :span="24" class="item">
  162. <div class="label">备注</div>
  163. <div class="value">
  164. <el-input v-model="detailData.remark" placeholder="请输入备注" />
  165. </div>
  166. </el-col>
  167. <el-col :span="8" class="item">
  168. <div class="label">制单人</div>
  169. <div class="value">{{ detailData.createName }}</div>
  170. </el-col>
  171. <el-col :span="8" class="item">
  172. <div class="label">制单日期</div>
  173. <div class="value">{{ detailData.createTime }}</div>
  174. </el-col>
  175. <el-col :span="8" class="item">
  176. <div class="label">合同有效期</div>
  177. <div class="value">
  178. <el-date-picker
  179. v-model="detailData.contractExpireDate"
  180. type="date"
  181. prefix-icon="none"
  182. value-format="yyyy-MM-dd"
  183. style="width: 100%"
  184. placeholder="选择日期"
  185. />
  186. </div>
  187. </el-col>
  188. </el-row>
  189. </div>
  190. <div class="main-title">
  191. <div class="title">货品信息</div>
  192. <div>
  193. <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
  194. </div>
  195. </div>
  196. <div class="table" style="margin-top: 20px">
  197. <el-table
  198. :data="goodsList"
  199. element-loading-text="Loading"
  200. border
  201. fit
  202. highlight-current-row
  203. stripe
  204. max-height="400"
  205. show-summary
  206. :summary-method="$getSummaries"
  207. >
  208. <el-table-column align="center" label="序号" type="index" width="50" />
  209. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip />
  210. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
  211. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
  212. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  213. <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
  214. <template slot-scope="scope">
  215. <el-input v-model="scope.row.specification" size="small" />
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  219. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  220. <template slot-scope="scope">
  221. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent />
  222. </template>
  223. </el-table-column>
  224. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  225. <template slot-scope="scope">
  226. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
  227. </template>
  228. </el-table-column>
  229. <el-table-column align="right" label="订单金额" min-width="100" prop="compute_amount" show-overflow-tooltip>
  230. <template slot-scope="scope">
  231. {{ scope.row.compute_amount | numToFixed }}
  232. </template>
  233. </el-table-column>
  234. <el-table-column align="left" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
  235. <template slot-scope="scope">
  236. <el-input v-model="scope.row.remark" size="small" />
  237. </template>
  238. </el-table-column>
  239. <el-table-column align="left" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip />
  240. <el-table-column align="center" label="操作" width="100" fixed="right">
  241. <template slot-scope="scope">
  242. <el-button type="text" @click="deleteItem(scope.$index, scope.row.cid)">删除</el-button>
  243. </template>
  244. </el-table-column>
  245. </el-table>
  246. </div>
  247. <div class="main-title">
  248. <div class="title">审批信息</div>
  249. </div>
  250. <div class="diy-table-1">
  251. <el-row :gutter="0">
  252. <el-col :span="12" class="item">
  253. <div class="label">审批人</div>
  254. <div class="value">{{ userName }}</div>
  255. </el-col>
  256. <!-- <el-col :span="8" class="item">-->
  257. <!-- <div class="label">是否计划单</div>-->
  258. <!-- <div class="value">-->
  259. <!-- <el-radio-group v-model="examineForm.isPlanOrder" :disabled="websitNumber === 'GZ'">-->
  260. <!-- <el-radio :label="true">是</el-radio>-->
  261. <!-- <el-radio :label="false">否</el-radio>-->
  262. <!-- </el-radio-group>-->
  263. <!-- </div>-->
  264. <!-- </el-col>-->
  265. <el-col :span="12" class="item">
  266. <div class="label">审批结果</div>
  267. <div class="value">
  268. <el-radio-group v-model="examineForm.examineResult">
  269. <el-radio :label="true">通过</el-radio>
  270. <el-radio :label="false">驳回</el-radio>
  271. </el-radio-group>
  272. </div>
  273. </el-col>
  274. <el-col :span="24" class="item">
  275. <div class="label">审批说明</div>
  276. <div class="value">
  277. <el-input v-model="examineForm.remark" placeholder="请输入内容" />
  278. </div>
  279. </el-col>
  280. </el-row>
  281. </div>
  282. <div class="page-footer">
  283. <div class="footer">
  284. <el-button type="primary" :loading="formLoading" @click="clickSubmitForm">{{
  285. formLoading ? '提交中 ...' : '提 交'
  286. }}</el-button>
  287. <el-popconfirm title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
  288. <el-button slot="reference">返回列表</el-button>
  289. </el-popconfirm>
  290. </div>
  291. </div>
  292. <el-dialog
  293. title="添加产品"
  294. :modal-append-to-body="true"
  295. :append-to-body="true"
  296. :visible.sync="isShowGoodsDialog"
  297. width="80%"
  298. >
  299. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  300. <el-row :gutter="20">
  301. <el-col :xs="12" :sm="6" :lg="6">
  302. <el-form-item prop="salesType">
  303. <el-select v-model="goodsScreenForm.salesType" placeholder="选择销售类型" style="width: 100%" clearable>
  304. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id" />
  305. </el-select>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :xs="12" :sm="6" :lg="6">
  309. <el-form-item prop="proNum">
  310. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入产品编码" />
  311. </el-form-item>
  312. </el-col>
  313. <el-col :xs="12" :sm="6" :lg="6">
  314. <el-form-item prop="proName">
  315. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称" />
  316. </el-form-item>
  317. </el-col>
  318. <el-col :xs="12" :sm="6" :lg="6">
  319. <el-form-item prop="proModel">
  320. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号" />
  321. </el-form-item>
  322. </el-col>
  323. <el-col :xs="12" :sm="6" :lg="6">
  324. <el-form-item prop="price1" style="display: flex">
  325. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%" />
  326. <span> - </span>
  327. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%" />
  328. </el-form-item>
  329. </el-col>
  330. <el-col :xs="12" :sm="18" :lg="18" class="tr">
  331. <el-form-item label="">
  332. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  333. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  334. </el-form-item>
  335. </el-col>
  336. </el-row>
  337. </el-form>
  338. <div class="tables">
  339. <div class="table">
  340. <el-table
  341. :data="leftGoodsList"
  342. element-loading-text="Loading"
  343. border
  344. fit
  345. highlight-current-row
  346. stripe
  347. height="400"
  348. @selection-change="leftSelectionChange"
  349. >
  350. <el-table-column align="center" type="selection" width="55" :selectable="checkboxSelect" />
  351. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  352. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  353. <el-table-column
  354. align="center"
  355. label="产品型号"
  356. prop="specification"
  357. min-width="160"
  358. show-overflow-tooltip
  359. />
  360. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  361. </el-table>
  362. <div class="pagination clearfix" style="margin-top: 10px">
  363. <div class="fr">
  364. <el-pagination
  365. :current-page="currentPage"
  366. :page-size="10"
  367. background
  368. layout="prev, pager, next"
  369. :total="listTotal"
  370. @current-change="handleTableCurrentChange"
  371. />
  372. </div>
  373. </div>
  374. </div>
  375. <div class="buttons">
  376. <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
  377. <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
  378. <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
  379. <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
  380. </div>
  381. <div class="table">
  382. <el-table
  383. :data="rightGoodsList"
  384. element-loading-text="Loading"
  385. border
  386. fit
  387. highlight-current-row
  388. stripe
  389. height="400"
  390. @selection-change="rightSelectionChange"
  391. >
  392. <el-table-column align="center" type="selection" width="55" />
  393. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  394. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  395. <el-table-column
  396. align="center"
  397. label="产品型号"
  398. prop="specification"
  399. min-width="160"
  400. show-overflow-tooltip
  401. />
  402. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  403. </el-table>
  404. </div>
  405. </div>
  406. <span slot="footer" class="dialog-footer">
  407. <el-button @click="closeDialog">取 消</el-button>
  408. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  409. </span>
  410. </el-dialog>
  411. </div>
  412. </template>
  413. <script>
  414. import { getEnginDetail, getRetailProductList, examineEngin } from '@/api/supply/engin'
  415. import { getTypeList, getSalesmanList, getDictList } from '@/api/common'
  416. import { mapGetters } from 'vuex'
  417. export default {
  418. name: 'EnginExamine',
  419. componentName: 'EnginExamine',
  420. filters: {
  421. statusFilter(val) {
  422. const statusList = [
  423. { label: '已保存', value: 'SAVE' },
  424. { label: '待审核', value: 'WAIT' },
  425. { label: '审核通过', value: 'OK' },
  426. // { label: '审核驳回', value: 'FAIL' },,
  427. { label: '已关闭', value: 'CLOSE' }
  428. ]
  429. const obj = statusList.find(o => o.value == val)
  430. return obj ? obj.label : ''
  431. }
  432. },
  433. props: ['listItem'],
  434. data() {
  435. return {
  436. detailData: {},
  437. goodsList: [],
  438. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  439. formLoading: false,
  440. examineForm: {
  441. examineResult: true,
  442. remark: '',
  443. isPlanOrder: ''
  444. },
  445. salesTypeList: [],
  446. salesmanList: [],
  447. machineTypeList: [],
  448. loginTypeList: [],
  449. powerList: [],
  450. tradeCategoryList: [
  451. { value: '房地产', label: '房地产' },
  452. { value: '公共建筑', label: '公共建筑' },
  453. { value: '工业制造', label: '工业制造' },
  454. { value: '商业项目', label: '商业项目' },
  455. { value: '采暖及清洁能源', label: '采暖及清洁能源' },
  456. { value: '轨道交通', label: '轨道交通' },
  457. { value: '数据通讯', label: '数据通讯' },
  458. { value: '冷冻冷藏', label: '冷冻冷藏' },
  459. { value: '高端制造', label: '高端制造' },
  460. { value: '医院医疗', label: '医院医疗' },
  461. { value: '其他', label: '其他' }
  462. ],
  463. isShowGoodsDialog: false,
  464. goodsScreenForm: {
  465. proNum: '',
  466. proName: '',
  467. proModel: '',
  468. price1: '',
  469. price2: '',
  470. salesType: ''
  471. },
  472. currentPage: 1,
  473. listTotal: 0,
  474. leftGoodsList: [],
  475. rightGoodsList: [],
  476. leftSelection: [],
  477. rightSelection: [],
  478. examineStatus: ''
  479. }
  480. },
  481. computed: {
  482. ...mapGetters(['isCustomer', 'websitNumber'])
  483. },
  484. watch: {
  485. goodsList: {
  486. handler(newValue, oldValue) {
  487. if (newValue && newValue.length) {
  488. newValue.forEach((item, index) => {
  489. this.goodsList[index].compute_amount = item.price * item.qty
  490. })
  491. }
  492. },
  493. immediate: true,
  494. deep: true
  495. }
  496. },
  497. created() {
  498. this.getDetail()
  499. this.getTypeList()
  500. this.getSalesmanList()
  501. this.getDictList()
  502. },
  503. methods: {
  504. // 返回列表
  505. goBack() {
  506. this.$emit('backListFormDetail')
  507. },
  508. // 获取详情
  509. getDetail() {
  510. // if (this.websitNumber === 'GZ') {
  511. // this.examineForm.isPlanOrder = false
  512. // }
  513. getEnginDetail({ id: this.listItem.enginInfoId }).then(res => {
  514. this.detailData = res.data
  515. this.examineStatus = res.data.examineStatus
  516. res.data.items.forEach(item => {
  517. item.sums1 = ['qty', 'hasOrderQty', 'hasDeliverQty']
  518. item.sums2 = ['compute_amount', 'price']
  519. item.cid = item.id
  520. })
  521. this.goodsList = res.data.items
  522. })
  523. },
  524. // 获取销售类型列表
  525. getTypeList() {
  526. getTypeList({
  527. pageNum: 1,
  528. pageSize: -1
  529. }).then(res => {
  530. this.salesTypeList = res.data.records
  531. })
  532. },
  533. getSalesmanList() {
  534. getSalesmanList({
  535. pageNum: 1,
  536. pageSize: -1,
  537. isCustomer: 0,
  538. status: true
  539. }).then(res => {
  540. this.salesmanList = res.data.records
  541. })
  542. },
  543. // 获取产品大类列表
  544. getDictList() {
  545. getDictList({ sysDictEnum: 'MACHINE_TYPE' }).then(res => {
  546. this.machineTypeList = res.data
  547. })
  548. getDictList({ sysDictEnum: 'POWER_CATEGORY' }).then(res => {
  549. this.powerList = res.data
  550. })
  551. getDictList({ sysDictEnum: 'SIGN_TYPE' }).then(res => {
  552. this.loginTypeList = res.data
  553. })
  554. },
  555. // 获取商品列表
  556. getGoodsList() {
  557. getRetailProductList({
  558. pageNum: this.currentPage,
  559. pageSize: 10,
  560. saleId: this.goodsScreenForm.salesType,
  561. materialCode: this.goodsScreenForm.proNum,
  562. materialName: this.goodsScreenForm.proName,
  563. specification: this.goodsScreenForm.proModel,
  564. price1: this.goodsScreenForm.price1,
  565. price2: this.goodsScreenForm.price2
  566. }).then(res => {
  567. const oldGoodsList = this.goodsList
  568. const newGoodsList = res.data.records
  569. for (let i = 0; i < oldGoodsList.length; i++) {
  570. const oldItem = oldGoodsList[i]
  571. for (let j = 0; j < newGoodsList.length; j++) {
  572. const newItem = newGoodsList[j]
  573. if (newItem.id === oldItem.id) {
  574. newGoodsList[j].selected = true
  575. break
  576. }
  577. }
  578. }
  579. res.data.records.forEach(item => {
  580. item.materialName = item.name
  581. item.materialCode = item.number
  582. item.saleTypeName = item.saleName
  583. item.unit = item.baseUnit
  584. item.price = item.batchPrice
  585. item.tax = item.taxRate
  586. item.isDirectTransfer = false
  587. item.directTransferQty = ''
  588. item.status1 = ''
  589. item.status2 = ''
  590. item.rebateAmount = ''
  591. item.rebateRate = ''
  592. item.productPriceId = item.id
  593. // item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  594. })
  595. this.leftGoodsList = res.data.records
  596. this.listTotal = res.data.total
  597. })
  598. },
  599. // 查询重复值并禁选
  600. checkboxSelect(row, rowIndex) {
  601. if (row.selected) {
  602. return false // 禁用
  603. } else {
  604. return true // 不禁用
  605. }
  606. },
  607. // 点击 选择商品
  608. openDialog() {
  609. this.isShowGoodsDialog = true
  610. this.getGoodsList()
  611. },
  612. // 提交筛选表单
  613. submitGoodsScreenForm() {
  614. this.currentPage = 1
  615. this.getGoodsList()
  616. },
  617. // 重置筛选表单
  618. resetGoodsScreenForm() {
  619. this.$refs.goodsScreenForm.resetFields()
  620. this.currentPage = 1
  621. this.getGoodsList()
  622. },
  623. // 更改列表当前页
  624. handleTableCurrentChange(val) {
  625. this.currentPage = val
  626. this.getGoodsList()
  627. },
  628. // 关闭 弹窗
  629. closeDialog() {
  630. this.isShowGoodsDialog = false
  631. },
  632. // 左侧列表选择
  633. leftSelectionChange(val) {
  634. this.leftSelection = val
  635. },
  636. // 右侧列表选择
  637. rightSelectionChange(val) {
  638. this.rightSelection = val
  639. },
  640. // 数组去重
  641. delRepeat(arr1, arr2) {
  642. const allArr = arr1.concat(arr2) // 两个数组对象合并
  643. const newArr = [] // 存放去重后数据的新数组
  644. for (let i = 0; i < allArr.length; i++) {
  645. // 循环allArr数组对象的内容
  646. let flag = true // 建立标记,判断数据是否重复,true为不重复
  647. for (let j = 0; j < newArr.length; j++) {
  648. // 循环新数组的内容
  649. if (allArr[i].id == newArr[j].id) {
  650. // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  651. flag = false
  652. }
  653. }
  654. if (flag) {
  655. // 判断是否重复
  656. newArr.push(allArr[i]) // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  657. }
  658. }
  659. return newArr
  660. },
  661. // 全部添加
  662. addAllGoods() {
  663. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList)
  664. },
  665. // 添加
  666. addGoods() {
  667. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList)
  668. },
  669. // 删除
  670. deleteGoods() {
  671. const rightGoodsList = this.rightGoodsList
  672. const rightSelection = this.rightSelection
  673. for (let i = 0; i < rightGoodsList.length; i++) {
  674. for (let j = 0; j < rightSelection.length; j++) {
  675. if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
  676. this.rightGoodsList.splice(i, 1)
  677. }
  678. }
  679. }
  680. },
  681. // 全部删除
  682. deleteAllGoods() {
  683. this.rightGoodsList = []
  684. },
  685. // 确定 添加产品
  686. submitAddGoods() {
  687. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  688. this.goodsList = this.goodsList.concat(this.rightGoodsList)
  689. this.goodsList = this.goodsList.concat(this.rightGoodsList)
  690. this.goodsList.forEach(k => {
  691. k.cid = ''
  692. })
  693. this.isShowGoodsDialog = false
  694. this.leftGoodsList = []
  695. this.rightGoodsList = []
  696. },
  697. // 删除产品
  698. deleteItem(index, id) {
  699. if (this.listItem && this.examineStatus === 'OK' && id) {
  700. this.$errorMsg('不能删除')
  701. return
  702. }
  703. this.goodsList.splice(index, 1)
  704. },
  705. clickSubmitForm() {
  706. // if (this.websitNumber === 'GZ') {
  707. if (!this.detailData.serviceId) {
  708. return this.$errorMsg('请选择业务员')
  709. }
  710. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  711. confirmButtonText: '确定',
  712. cancelButtonText: '取消',
  713. type: 'warning'
  714. })
  715. .then(() => {
  716. const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  717. const params = JSON.parse(JSON.stringify(this.detailData))
  718. params.enginInfoId = this.listItem.enginInfoId
  719. params.mainId = this.listItem.mainId
  720. params.examineResult = this.examineForm.examineResult
  721. params.examineNote = this.examineForm.remark
  722. params.isPlanOrder = this.examineForm.isPlanOrder
  723. params.serviceName = saleManItem.nickName
  724. params.items = this.goodsList
  725. this.formLoading = true
  726. examineEngin(params)
  727. .then(res => {
  728. this.$successMsg('审批成功')
  729. this.goBack()
  730. })
  731. .finally(res => {
  732. this.formLoading = false
  733. })
  734. })
  735. .catch(() => {})
  736. // return
  737. // }
  738. // this.$confirm('请确认信息单是否未计划单,请勾选是否计划单选项', '提示', {
  739. // confirmButtonText: '是计划单',
  740. // cancelButtonText: '不是计划单',
  741. // type: 'warning'
  742. // })
  743. // .then(() => {
  744. // this.examineForm.isPlanOrder = true
  745. // })
  746. // .catch(() => {
  747. // this.examineForm.isPlanOrder = false
  748. // })
  749. // .finally(() => {
  750. // if (!this.detailData.serviceId) {
  751. // return this.$errorMsg('请选择业务员')
  752. // }
  753. // this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  754. // confirmButtonText: '确定',
  755. // cancelButtonText: '取消',
  756. // type: 'warning'
  757. // })
  758. // .then(() => {
  759. // const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  760. // const params = JSON.parse(JSON.stringify(this.detailData))
  761. // params.enginInfoId = this.listItem.enginInfoId
  762. // params.mainId = this.listItem.mainId
  763. // params.examineResult = this.examineForm.examineResult
  764. // params.examineNote = this.examineForm.remark
  765. // params.isPlanOrder = this.examineForm.isPlanOrder
  766. // params.serviceName = saleManItem.nickName
  767. // params.items = this.goodsList
  768. // this.formLoading = true
  769. // examineEngin(params)
  770. // .then(res => {
  771. // this.$successMsg('审批成功')
  772. // this.goBack()
  773. //
  774. // })
  775. // .finally(res => {
  776. // this.formLoading = false
  777. // })
  778. // })
  779. // .catch(() => {})
  780. // })
  781. }
  782. }
  783. }
  784. </script>
  785. <style scoped lang="scss">
  786. .detail-container {
  787. width: 100%;
  788. height: 100%;
  789. }
  790. .main-title {
  791. display: flex;
  792. justify-content: space-between;
  793. align-items: center;
  794. margin-top: 20px;
  795. height: 60px;
  796. border-bottom: 1px solid #dcdfe6;
  797. margin-bottom: 20px;
  798. .title {
  799. font-size: 16px;
  800. font-weight: 600;
  801. padding-left: 10px;
  802. }
  803. }
  804. .tables {
  805. display: flex;
  806. margin-top: 10px;
  807. .table {
  808. width: 45%;
  809. }
  810. .buttons {
  811. display: flex;
  812. flex-direction: column;
  813. justify-content: center;
  814. align-items: center;
  815. padding: 0 10px;
  816. button {
  817. margin: 0;
  818. margin-top: 10px;
  819. }
  820. }
  821. }
  822. ::v-deep input::-webkit-outer-spin-button,
  823. ::v-deep input::-webkit-inner-spin-button {
  824. -webkit-appearance: none;
  825. }
  826. ::v-deep input[type='number'] {
  827. -moz-appearance: textfield;
  828. }
  829. </style>