engin_examine.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  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 title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
  293. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  294. <el-row :gutter="20">
  295. <el-col :xs="12" :sm="6" :lg="6">
  296. <el-form-item prop="salesType">
  297. <el-select v-model="goodsScreenForm.salesType" placeholder="选择销售类型" style="width: 100%" clearable>
  298. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id" />
  299. </el-select>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :xs="12" :sm="6" :lg="6">
  303. <el-form-item prop="proNum">
  304. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入产品编码" />
  305. </el-form-item>
  306. </el-col>
  307. <el-col :xs="12" :sm="6" :lg="6">
  308. <el-form-item prop="proName">
  309. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称" />
  310. </el-form-item>
  311. </el-col>
  312. <el-col :xs="12" :sm="6" :lg="6">
  313. <el-form-item prop="proModel">
  314. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号" />
  315. </el-form-item>
  316. </el-col>
  317. <el-col :xs="12" :sm="6" :lg="6">
  318. <el-form-item prop="price1" style="display: flex">
  319. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%" />
  320. <span> - </span>
  321. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%" />
  322. </el-form-item>
  323. </el-col>
  324. <el-col :xs="12" :sm="18" :lg="18" class="tr">
  325. <el-form-item label="">
  326. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  327. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  328. </el-form-item>
  329. </el-col>
  330. </el-row>
  331. </el-form>
  332. <div class="tables">
  333. <div class="table">
  334. <el-table
  335. :data="leftGoodsList"
  336. element-loading-text="Loading"
  337. border
  338. fit
  339. highlight-current-row
  340. stripe
  341. height="400"
  342. @selection-change="leftSelectionChange"
  343. >
  344. <el-table-column align="center" type="selection" width="55" :selectable="checkboxSelect" />
  345. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  346. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  347. <el-table-column
  348. align="center"
  349. label="产品型号"
  350. prop="specification"
  351. min-width="160"
  352. show-overflow-tooltip
  353. />
  354. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  355. </el-table>
  356. <div class="pagination clearfix" style="margin-top: 10px">
  357. <div class="fr">
  358. <el-pagination
  359. :current-page="currentPage"
  360. :page-size="10"
  361. background
  362. layout="prev, pager, next"
  363. :total="listTotal"
  364. @current-change="handleTableCurrentChange"
  365. />
  366. </div>
  367. </div>
  368. </div>
  369. <div class="buttons">
  370. <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
  371. <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
  372. <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
  373. <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
  374. </div>
  375. <div class="table">
  376. <el-table
  377. :data="rightGoodsList"
  378. element-loading-text="Loading"
  379. border
  380. fit
  381. highlight-current-row
  382. stripe
  383. height="400"
  384. @selection-change="rightSelectionChange"
  385. >
  386. <el-table-column align="center" type="selection" width="55" />
  387. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  388. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  389. <el-table-column
  390. align="center"
  391. label="产品型号"
  392. prop="specification"
  393. min-width="160"
  394. show-overflow-tooltip
  395. />
  396. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  397. </el-table>
  398. </div>
  399. </div>
  400. <span slot="footer" class="dialog-footer">
  401. <el-button @click="closeDialog">取 消</el-button>
  402. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  403. </span>
  404. </el-dialog>
  405. </div>
  406. </template>
  407. <script>
  408. import { getEnginDetail, getRetailProductList, examineEngin } from '@/api/supply/engin'
  409. import { getTypeList, getSalesmanList, getDictList } from '@/api/common'
  410. import { mapGetters } from 'vuex'
  411. export default {
  412. name: 'EnginExamine',
  413. componentName: 'EnginExamine',
  414. filters: {
  415. statusFilter(val) {
  416. const statusList = [
  417. { label: '已保存', value: 'SAVE' },
  418. { label: '待审核', value: 'WAIT' },
  419. { label: '审核通过', value: 'OK' },
  420. // { label: '审核驳回', value: 'FAIL' },,
  421. { label: '已关闭', value: 'CLOSE' }
  422. ]
  423. const obj = statusList.find(o => o.value == val)
  424. return obj ? obj.label : ''
  425. }
  426. },
  427. props: ['listItem'],
  428. data() {
  429. return {
  430. detailData: {},
  431. goodsList: [],
  432. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  433. formLoading: false,
  434. examineForm: {
  435. examineResult: true,
  436. remark: '',
  437. isPlanOrder: ''
  438. },
  439. salesTypeList: [],
  440. salesmanList: [],
  441. machineTypeList: [],
  442. loginTypeList: [],
  443. powerList: [],
  444. tradeCategoryList: [
  445. { value: '房地产', label: '房地产' },
  446. { value: '公共建筑', label: '公共建筑' },
  447. { value: '工业制造', label: '工业制造' },
  448. { value: '商业项目', label: '商业项目' },
  449. { value: '采暖及清洁能源', label: '采暖及清洁能源' },
  450. { value: '轨道交通', label: '轨道交通' },
  451. { value: '数据通讯', label: '数据通讯' },
  452. { value: '冷冻冷藏', label: '冷冻冷藏' },
  453. { value: '高端制造', label: '高端制造' },
  454. { value: '医院医疗', label: '医院医疗' },
  455. { value: '其他', label: '其他' }
  456. ],
  457. isShowGoodsDialog: false,
  458. goodsScreenForm: {
  459. proNum: '',
  460. proName: '',
  461. proModel: '',
  462. price1: '',
  463. price2: '',
  464. salesType: ''
  465. },
  466. currentPage: 1,
  467. listTotal: 0,
  468. leftGoodsList: [],
  469. rightGoodsList: [],
  470. leftSelection: [],
  471. rightSelection: [],
  472. examineStatus: ''
  473. }
  474. },
  475. computed: {
  476. ...mapGetters(['isCustomer', 'websitNumber'])
  477. },
  478. watch: {
  479. goodsList: {
  480. handler(newValue, oldValue) {
  481. if (newValue && newValue.length) {
  482. newValue.forEach((item, index) => {
  483. this.goodsList[index].compute_amount = item.price * item.qty
  484. })
  485. }
  486. },
  487. immediate: true,
  488. deep: true
  489. }
  490. },
  491. created() {
  492. this.getDetail()
  493. this.getTypeList()
  494. this.getSalesmanList()
  495. this.getDictList()
  496. },
  497. methods: {
  498. // 返回列表
  499. goBack() {
  500. this.$emit('backListFormDetail')
  501. },
  502. // 获取详情
  503. getDetail() {
  504. // if (this.websitNumber === 'GZ') {
  505. // this.examineForm.isPlanOrder = false
  506. // }
  507. getEnginDetail({ id: this.listItem.enginInfoId }).then(res => {
  508. this.detailData = res.data
  509. this.examineStatus = res.data.examineStatus
  510. res.data.items.forEach(item => {
  511. item.sums1 = ['qty', 'hasOrderQty', 'hasDeliverQty']
  512. item.sums2 = ['compute_amount', 'price']
  513. item.cid = item.id
  514. })
  515. this.goodsList = res.data.items
  516. })
  517. },
  518. // 获取销售类型列表
  519. getTypeList() {
  520. getTypeList({
  521. pageNum: 1,
  522. pageSize: -1
  523. }).then(res => {
  524. this.salesTypeList = res.data.records
  525. })
  526. },
  527. getSalesmanList() {
  528. getSalesmanList({
  529. pageNum: 1,
  530. pageSize: -1,
  531. isCustomer: 0,
  532. status: true
  533. }).then(res => {
  534. this.salesmanList = res.data.records
  535. })
  536. },
  537. // 获取产品大类列表
  538. getDictList() {
  539. getDictList({ sysDictEnum: 'MACHINE_TYPE' }).then(res => {
  540. this.machineTypeList = res.data
  541. })
  542. getDictList({ sysDictEnum: 'POWER_CATEGORY' }).then(res => {
  543. this.powerList = res.data
  544. })
  545. getDictList({ sysDictEnum: 'SIGN_TYPE' }).then(res => {
  546. this.loginTypeList = res.data
  547. })
  548. },
  549. // 获取商品列表
  550. getGoodsList() {
  551. getRetailProductList({
  552. pageNum: this.currentPage,
  553. pageSize: 10,
  554. saleId: this.goodsScreenForm.salesType,
  555. materialCode: this.goodsScreenForm.proNum,
  556. materialName: this.goodsScreenForm.proName,
  557. specification: this.goodsScreenForm.proModel,
  558. price1: this.goodsScreenForm.price1,
  559. price2: this.goodsScreenForm.price2
  560. }).then(res => {
  561. const oldGoodsList = this.goodsList
  562. const newGoodsList = res.data.records
  563. for (let i = 0; i < oldGoodsList.length; i++) {
  564. const oldItem = oldGoodsList[i]
  565. for (let j = 0; j < newGoodsList.length; j++) {
  566. const newItem = newGoodsList[j]
  567. if (newItem.id === oldItem.id) {
  568. newGoodsList[j].selected = true
  569. break
  570. }
  571. }
  572. }
  573. res.data.records.forEach(item => {
  574. item.materialName = item.name
  575. item.materialCode = item.number
  576. item.saleTypeName = item.saleName
  577. item.unit = item.baseUnit
  578. item.price = item.batchPrice
  579. item.tax = item.taxRate
  580. item.isDirectTransfer = false
  581. item.directTransferQty = ''
  582. item.status1 = ''
  583. item.status2 = ''
  584. item.rebateAmount = ''
  585. item.rebateRate = ''
  586. item.productPriceId = item.id
  587. // item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  588. })
  589. this.leftGoodsList = res.data.records
  590. this.listTotal = res.data.total
  591. })
  592. },
  593. // 查询重复值并禁选
  594. checkboxSelect(row, rowIndex) {
  595. if (row.selected) {
  596. return false // 禁用
  597. } else {
  598. return true // 不禁用
  599. }
  600. },
  601. // 点击 选择商品
  602. openDialog() {
  603. this.isShowGoodsDialog = true
  604. this.getGoodsList()
  605. },
  606. // 提交筛选表单
  607. submitGoodsScreenForm() {
  608. this.currentPage = 1
  609. this.getGoodsList()
  610. },
  611. // 重置筛选表单
  612. resetGoodsScreenForm() {
  613. this.$refs.goodsScreenForm.resetFields()
  614. this.currentPage = 1
  615. this.getGoodsList()
  616. },
  617. // 更改列表当前页
  618. handleTableCurrentChange(val) {
  619. this.currentPage = val
  620. this.getGoodsList()
  621. },
  622. // 关闭 弹窗
  623. closeDialog() {
  624. this.isShowGoodsDialog = false
  625. },
  626. // 左侧列表选择
  627. leftSelectionChange(val) {
  628. this.leftSelection = val
  629. },
  630. // 右侧列表选择
  631. rightSelectionChange(val) {
  632. this.rightSelection = val
  633. },
  634. // 数组去重
  635. delRepeat(arr1, arr2) {
  636. const allArr = arr1.concat(arr2) // 两个数组对象合并
  637. const newArr = [] // 存放去重后数据的新数组
  638. for (let i = 0; i < allArr.length; i++) {
  639. // 循环allArr数组对象的内容
  640. let flag = true // 建立标记,判断数据是否重复,true为不重复
  641. for (let j = 0; j < newArr.length; j++) {
  642. // 循环新数组的内容
  643. if (allArr[i].id == newArr[j].id) {
  644. // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  645. flag = false
  646. }
  647. }
  648. if (flag) {
  649. // 判断是否重复
  650. newArr.push(allArr[i]) // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  651. }
  652. }
  653. return newArr
  654. },
  655. // 全部添加
  656. addAllGoods() {
  657. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList)
  658. },
  659. // 添加
  660. addGoods() {
  661. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList)
  662. },
  663. // 删除
  664. deleteGoods() {
  665. const rightGoodsList = this.rightGoodsList
  666. const rightSelection = this.rightSelection
  667. for (let i = 0; i < rightGoodsList.length; i++) {
  668. for (let j = 0; j < rightSelection.length; j++) {
  669. if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
  670. this.rightGoodsList.splice(i, 1)
  671. }
  672. }
  673. }
  674. },
  675. // 全部删除
  676. deleteAllGoods() {
  677. this.rightGoodsList = []
  678. },
  679. // 确定 添加产品
  680. submitAddGoods() {
  681. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  682. this.goodsList = this.goodsList.concat(this.rightGoodsList)
  683. this.goodsList = this.goodsList.concat(this.rightGoodsList)
  684. this.goodsList.forEach(k => {
  685. k.cid = ''
  686. })
  687. this.isShowGoodsDialog = false
  688. this.leftGoodsList = []
  689. this.rightGoodsList = []
  690. },
  691. // 删除产品
  692. deleteItem(index, id) {
  693. if (this.listItem && this.examineStatus === 'OK' && id) {
  694. this.$errorMsg('不能删除')
  695. return
  696. }
  697. this.goodsList.splice(index, 1)
  698. },
  699. clickSubmitForm() {
  700. // if (this.websitNumber === 'GZ') {
  701. if (!this.detailData.serviceId) {
  702. return this.$errorMsg('请选择业务员')
  703. }
  704. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  705. confirmButtonText: '确定',
  706. cancelButtonText: '取消',
  707. type: 'warning'
  708. })
  709. .then(() => {
  710. const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  711. const params = JSON.parse(JSON.stringify(this.detailData))
  712. params.enginInfoId = this.listItem.enginInfoId
  713. params.mainId = this.listItem.mainId
  714. params.examineResult = this.examineForm.examineResult
  715. params.examineNote = this.examineForm.remark
  716. params.isPlanOrder = this.examineForm.isPlanOrder
  717. params.serviceName = saleManItem.nickName
  718. params.items = this.goodsList
  719. this.formLoading = true
  720. examineEngin(params)
  721. .then(res => {
  722. this.$successMsg('审批成功')
  723. this.goBack()
  724. this.$parent.getList()
  725. })
  726. .finally(res => {
  727. this.formLoading = false
  728. })
  729. })
  730. .catch(() => {})
  731. // return
  732. // }
  733. // this.$confirm('请确认信息单是否未计划单,请勾选是否计划单选项', '提示', {
  734. // confirmButtonText: '是计划单',
  735. // cancelButtonText: '不是计划单',
  736. // type: 'warning'
  737. // })
  738. // .then(() => {
  739. // this.examineForm.isPlanOrder = true
  740. // })
  741. // .catch(() => {
  742. // this.examineForm.isPlanOrder = false
  743. // })
  744. // .finally(() => {
  745. // if (!this.detailData.serviceId) {
  746. // return this.$errorMsg('请选择业务员')
  747. // }
  748. // this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  749. // confirmButtonText: '确定',
  750. // cancelButtonText: '取消',
  751. // type: 'warning'
  752. // })
  753. // .then(() => {
  754. // const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  755. // const params = JSON.parse(JSON.stringify(this.detailData))
  756. // params.enginInfoId = this.listItem.enginInfoId
  757. // params.mainId = this.listItem.mainId
  758. // params.examineResult = this.examineForm.examineResult
  759. // params.examineNote = this.examineForm.remark
  760. // params.isPlanOrder = this.examineForm.isPlanOrder
  761. // params.serviceName = saleManItem.nickName
  762. // params.items = this.goodsList
  763. // this.formLoading = true
  764. // examineEngin(params)
  765. // .then(res => {
  766. // this.$successMsg('审批成功')
  767. // this.goBack()
  768. // this.$parent.getList()
  769. // })
  770. // .finally(res => {
  771. // this.formLoading = false
  772. // })
  773. // })
  774. // .catch(() => {})
  775. // })
  776. }
  777. }
  778. }
  779. </script>
  780. <style scoped lang="scss">
  781. .detail-container {
  782. width: 100%;
  783. height: 100%;
  784. }
  785. .main-title {
  786. display: flex;
  787. justify-content: space-between;
  788. align-items: center;
  789. margin-top: 20px;
  790. height: 60px;
  791. border-bottom: 1px solid #dcdfe6;
  792. margin-bottom: 20px;
  793. .title {
  794. font-size: 16px;
  795. font-weight: 600;
  796. padding-left: 10px;
  797. }
  798. }
  799. .tables {
  800. display: flex;
  801. margin-top: 10px;
  802. .table {
  803. width: 45%;
  804. }
  805. .buttons {
  806. display: flex;
  807. flex-direction: column;
  808. justify-content: center;
  809. align-items: center;
  810. padding: 0 10px;
  811. button {
  812. margin: 0;
  813. margin-top: 10px;
  814. }
  815. }
  816. }
  817. ::v-deep input::-webkit-outer-spin-button,
  818. ::v-deep input::-webkit-inner-spin-button {
  819. -webkit-appearance: none;
  820. }
  821. ::v-deep input[type='number'] {
  822. -moz-appearance: textfield;
  823. }
  824. </style>