|
@@ -225,7 +225,7 @@
|
|
|
{{scope.row.orderType | orderTypeFilter}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="工程登录编号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="工程登录编号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
@@ -275,7 +275,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getEnginDetail, addEngin, editEngin, getEnginGoodsList, getWarehouseList, getDealerList } from "@/api/supply/apply";
|
|
|
+import { getEnginDetail, addEngin, editEngin, getEnginGoodsList, getWarehouseList, getDealerList, getEnginGoodsDetail } from "@/api/supply/apply";
|
|
|
import { getDictList } from '@/api/common'
|
|
|
import { findElem } from '@/utils/util'
|
|
|
import fileUpload from '@/components/Common/file-upload.vue'
|
|
@@ -397,15 +397,26 @@ export default {
|
|
|
getEnginDetail({id: this.listItem.id}).then(res => {
|
|
|
let data = res.data;
|
|
|
this.mainForm.orderNum = data.id;
|
|
|
- this.mainForm.date = data.orderTime;
|
|
|
+ this.mainForm.orderDate = data.orderTime.slice(0, 10);
|
|
|
this.mainForm.jxsNum = data.customerNumber;
|
|
|
this.mainForm.jxsName = data.customerName;
|
|
|
+ this.mainForm.loginNum = data.enginOrderNo;
|
|
|
+ this.mainForm.enginName = data.refProjectName;
|
|
|
+ this.mainForm.loginType = data.enginOrderType;
|
|
|
+ this.mainForm.factoryNum = data.refFactoryNo;
|
|
|
+ this.mainForm.company = data.refUseUnit;
|
|
|
+ this.mainForm.saleType = data.saleTypeId;
|
|
|
+ this.mainForm.contactMan = data.refLinkman;
|
|
|
+ this.mainForm.tel = data.refTel;
|
|
|
+ this.mainForm.phone = data.refPhone;
|
|
|
+ this.mainForm.address = data.refInstallAddress;
|
|
|
this.mainForm.createMan = data.createBy;
|
|
|
+ this.mainForm.createDate = data.createTime;
|
|
|
this.mainForm.remark = data.remark;
|
|
|
this.screenForm.warehouse = data.correspondId;
|
|
|
this.fileList = data.fileUrl ? [{
|
|
|
url: data.fileUrl,
|
|
|
- name: data.fileName
|
|
|
+ name: data.fileName,
|
|
|
}] : [];
|
|
|
data.orders.forEach(item => {
|
|
|
item.orderId = item.id;
|
|
@@ -548,6 +559,17 @@ export default {
|
|
|
return newArr;
|
|
|
},
|
|
|
|
|
|
+ // 检查是否一致
|
|
|
+ isAllEqual(array) {
|
|
|
+ if (array.length > 0) {
|
|
|
+ return !array.some(function(item, index) {
|
|
|
+ return item.enginOrderNo !== array[0].enginOrderNo;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 确定 添加产品
|
|
|
submitAddGoods() {
|
|
|
let allList = this.tableGoodsList;
|
|
@@ -556,16 +578,38 @@ export default {
|
|
|
|
|
|
for(let i = 0; i < allList.length; i++) {
|
|
|
for(let j = 0; j < selectList.length; j++) {
|
|
|
- if(selectList[j].orderId == allList[i].orderId){
|
|
|
+ if(selectList[j].enginOrderNo == allList[i].enginOrderNo){
|
|
|
submitList.push(allList[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// this.goodsList = this.goodsList.concat(submitList);
|
|
|
|
|
|
+ if(!this.isAllEqual(submitList)) {
|
|
|
+ return this.$errorMsg('只能选择同一个工程编号的订单');
|
|
|
+ }
|
|
|
+
|
|
|
this.goodsList = this.delRepeat(submitList, this.goodsList);
|
|
|
this.isShowDialog = false;
|
|
|
this.tableGoodsList = [];
|
|
|
+
|
|
|
+ this.getEnginGoodsDetail(submitList[0].enginOrderNo);
|
|
|
+ },
|
|
|
+
|
|
|
+ getEnginGoodsDetail(enginOrderNo) {
|
|
|
+ getEnginGoodsDetail({enginOrderNo}).then(res => {
|
|
|
+ let data = res.data;
|
|
|
+ this.mainForm.loginNum = data.refEnginRecordNo;
|
|
|
+ this.mainForm.enginName = data.refProjectName;
|
|
|
+ this.mainForm.loginType = data.refPromiseStatus;
|
|
|
+ this.mainForm.factoryNum = data.refFactoryNo;
|
|
|
+ this.mainForm.company = data.refUseUnit;
|
|
|
+ this.mainForm.saleType = data.saleTypeId;
|
|
|
+ this.mainForm.contactMan = data.refLinkman;
|
|
|
+ this.mainForm.tel = data.refTel;
|
|
|
+ this.mainForm.phone = data.refPhone;
|
|
|
+ this.mainForm.address = data.refInstallAddress;
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 删除产品
|
|
@@ -598,7 +642,7 @@ export default {
|
|
|
|
|
|
let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name;
|
|
|
let params = {
|
|
|
- orderTime: this.mainForm.date + ' 00:00:00',
|
|
|
+ orderTime: this.mainForm.orderDate + ' 00:00:00',
|
|
|
remark: this.mainForm.remark,
|
|
|
enginOrderNo: this.mainForm.loginNum,
|
|
|
refProjectName: this.mainForm.enginName,
|