engin_examine.vue 26 KB

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