|
@@ -152,9 +152,10 @@
|
|
|
v-model="item.packQuantity"
|
|
|
:precision="0"
|
|
|
:controls="false"
|
|
|
- :min="0"
|
|
|
+ :min="1"
|
|
|
placeholder="请输入"
|
|
|
onmousewheel="return false;"
|
|
|
+ @change="(val) => handleChangePackQuantity(val, index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -459,7 +460,7 @@ const selectConfig = reactive([
|
|
|
value: "0",
|
|
|
},
|
|
|
{
|
|
|
- label: "出货",
|
|
|
+ label: "已出货",
|
|
|
value: "1",
|
|
|
},
|
|
|
],
|
|
@@ -469,9 +470,9 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
type: "selection",
|
|
|
- // attrs: {
|
|
|
- // checkAtt: "isCheck",
|
|
|
- // },
|
|
|
+ attrs: {
|
|
|
+ checkAtt: "isCheck",
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
@@ -492,12 +493,14 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "总箱数",
|
|
|
prop: "packQuantity",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "净重",
|
|
|
prop: "netWeight",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
render(netWeight) {
|
|
|
return netWeight + "kg";
|
|
@@ -507,6 +510,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "毛重",
|
|
|
prop: "roughWeight",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
|
|
|
render(roughWeight) {
|
|
@@ -517,6 +521,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "长",
|
|
|
prop: "boxLong",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
render(boxLong) {
|
|
|
return boxLong + "cm";
|
|
@@ -527,6 +532,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "宽",
|
|
|
prop: "boxWide",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
render(boxWide) {
|
|
|
return boxWide + "cm";
|
|
@@ -536,6 +542,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "高",
|
|
|
prop: "boxHigh",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
render(boxHigh) {
|
|
|
return boxHigh + "cm";
|
|
@@ -545,6 +552,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "总体积",
|
|
|
prop: "bomVolume",
|
|
|
+ width: 120,
|
|
|
},
|
|
|
render(bomVolume) {
|
|
|
return bomVolume + "m³";
|
|
@@ -554,6 +562,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "出货状态",
|
|
|
prop: "shipmentStatus",
|
|
|
+ width: 90,
|
|
|
},
|
|
|
render(status) {
|
|
|
return status == 1 ? "出货" : status == 0 ? "未出货" : "";
|
|
@@ -563,64 +572,63 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "出货时间",
|
|
|
prop: "shipmentTime",
|
|
|
+ width: 155,
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- width: "200",
|
|
|
- align: "right",
|
|
|
+ width: "90",
|
|
|
+ align: "center",
|
|
|
},
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "打印",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- getDtl(row);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "删除",
|
|
|
- type: "danger",
|
|
|
- text: true,
|
|
|
- disabled: row.status != 30,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- // 弹窗提示是否删除
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久作废该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
- // 删除
|
|
|
- proxy
|
|
|
- .post("/subscribeDetail/edit", {
|
|
|
- ...row,
|
|
|
- status: 99,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "作废成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- getList();
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "打印",
|
|
|
+ // type: "primary",
|
|
|
+ // text: true,
|
|
|
+ // },
|
|
|
+ // el: "button",
|
|
|
+ // click() {
|
|
|
+ // getDtl(row);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "删除",
|
|
|
+ // type: "primary",
|
|
|
+ // text: true,
|
|
|
+ // disabled: row.status != 30,
|
|
|
+ // },
|
|
|
+ // el: "button",
|
|
|
+ // click() {
|
|
|
+ // ElMessageBox.confirm(
|
|
|
+ // "此操作将永久作废该数据, 是否继续?",
|
|
|
+ // "提示",
|
|
|
+ // {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // }
|
|
|
+ // ).then(() => {
|
|
|
+ // // 删除
|
|
|
+ // proxy
|
|
|
+ // .post("/subscribeDetail/edit", {
|
|
|
+ // ...row,
|
|
|
+ // status: 99,
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // ElMessage({
|
|
|
+ // message: "作废成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // getList();
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // },
|
|
|
];
|
|
|
},
|
|
|
},
|
|
@@ -650,13 +658,16 @@ const formConfig = reactive([
|
|
|
]);
|
|
|
|
|
|
const getList = async (req) => {
|
|
|
+ selectData.value = [];
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
proxy
|
|
|
.post("/packDetail/page", sourceList.value.pagination)
|
|
|
.then((message) => {
|
|
|
- console.log(message);
|
|
|
- sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.data = message.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ isCheck: x.shipmentStatus == 1 ? false : true,
|
|
|
+ }));
|
|
|
sourceList.value.pagination.total = message.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
@@ -804,9 +815,9 @@ const handleClickPacking = () => {
|
|
|
formData.data.packDetailList.push({
|
|
|
customerId: customerId,
|
|
|
contractIds: contractIds,
|
|
|
- packQuantity: "",
|
|
|
- netWeight: "",
|
|
|
- roughWeight: "",
|
|
|
+ packQuantity: undefined,
|
|
|
+ netWeight: undefined,
|
|
|
+ roughWeight: undefined,
|
|
|
boxLong: undefined,
|
|
|
boxWide: undefined,
|
|
|
boxHigh: undefined,
|
|
@@ -816,16 +827,6 @@ const handleClickPacking = () => {
|
|
|
packDetailProductList: packDetailProductList,
|
|
|
isShow: false,
|
|
|
});
|
|
|
- // 减去待装箱数量
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- const e = list[i];
|
|
|
- for (let j = 0; j < formData.data.contractProductData.length; j++) {
|
|
|
- const jele = formData.data.contractProductData[j];
|
|
|
- if (e.id === jele.id) {
|
|
|
- formData.data.contractProductData[j].waitQuantity -= e.quantity;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
} else {
|
|
|
return ElMessage({
|
|
|
message: "请选择产品 !",
|
|
@@ -834,6 +835,30 @@ const handleClickPacking = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const handleChangePackQuantity = (val, index) => {
|
|
|
+ if (formData.data.contractProductData.length > 0 && val && val > 0) {
|
|
|
+ for (let j = 0; j < formData.data.contractProductData.length; j++) {
|
|
|
+ const e = formData.data.contractProductData[j];
|
|
|
+ e.waitQuantity = Number(e.cpQuantity) - Number(e.sumPackQuantity);
|
|
|
+ let quantity = e.waitQuantity - val * Number(e.quantity);
|
|
|
+ if (quantity < 0) {
|
|
|
+ formData.data.packDetailList[index].packQuantity = undefined;
|
|
|
+ return ElMessage({
|
|
|
+ message: "装箱数量 * 箱数不可大于待装箱数量",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ e.waitQuantity = quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let j = 0; j < formData.data.contractProductData.length; j++) {
|
|
|
+ const e = formData.data.contractProductData[j];
|
|
|
+ e.waitQuantity = Number(e.cpQuantity) - Number(e.sumPackQuantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleCustomPush = (index) => {
|
|
|
formData.data.packDetailList[index].packDetailGoodsList.push({
|
|
|
unit: "",
|